MdePkg: Do not use CreateEventEx unless required

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2446

There are many firmwares in the wild not supporting CreateEventEx,
including devices less than 5 years old.

Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Vitaly Cheptsov via Groups.Io 2020-01-07 18:50:32 +08:00 committed by mergify[bot]
parent e18792566c
commit df851da3ce
14 changed files with 15 additions and 47 deletions

View File

@ -77,9 +77,8 @@ DxeRuntimeDebugLibSerialPortConstructor (
return Status;
}
return SystemTable->BootServices->CreateEventEx (EVT_NOTIFY_SIGNAL,
return SystemTable->BootServices->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY, ExitBootServicesEvent, NULL,
&gEfiEventExitBootServicesGuid,
&mEfiExitBootServicesEvent);
}

View File

@ -41,9 +41,6 @@
PrintLib
SerialPortLib
[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES

View File

@ -47,7 +47,3 @@
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## CONSUMES
[Guids]
gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event

View File

@ -124,12 +124,11 @@ DxeRuntimePciExpressLibConstructor (
//
// Register SetVirtualAddressMap () notify function
//
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
Status = gBS->CreateEvent (
EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
TPL_NOTIFY,
DxeRuntimePciExpressLibVirtualNotify,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mDxeRuntimePciExpressLibVirtualNotifyEvent
);
ASSERT_EFI_ERROR (Status);

View File

@ -109,12 +109,11 @@ DxeRuntimePciSegmentLibConstructor (
//
// Register SetVirtualAddressMap () notify function
//
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
Status = gBS->CreateEvent (
EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
TPL_NOTIFY,
DxeRuntimePciSegmentLibVirtualNotify,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mDxeRuntimePciSegmentLibVirtualNotifyEvent
);
ASSERT_EFI_ERROR (Status);

View File

@ -45,6 +45,3 @@
MemoryAllocationLib
DxeServicesTableLib
UefiBootServicesTableLib
[Guids]
gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event

View File

@ -64,12 +64,11 @@ DxeDebugLibConstructor(
{
mDebugST = SystemTable;
SystemTable->BootServices->CreateEventEx (
EVT_NOTIFY_SIGNAL,
SystemTable->BootServices->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
ExitBootServicesCallback,
NULL,
&gEfiEventExitBootServicesGuid,
&mExitBootServicesEvent
);

View File

@ -46,9 +46,6 @@
PrintLib
DebugPrintErrorLevelLib
[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES

View File

@ -64,12 +64,11 @@ DxeDebugLibConstructor(
{
mDebugBS = SystemTable->BootServices;
mDebugBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
mDebugBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
ExitBootServicesCallback,
NULL,
&gEfiEventExitBootServicesGuid,
&mExitBootServicesEvent
);

View File

@ -46,9 +46,6 @@
PrintLib
DebugPrintErrorLevelLib
[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES
[Protocols]
gEfiDebugPortProtocolGuid ## CONSUMES

View File

@ -64,12 +64,11 @@ DxeDebugLibConstructor(
{
mDebugST = SystemTable;
SystemTable->BootServices->CreateEventEx (
EVT_NOTIFY_SIGNAL,
SystemTable->BootServices->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
ExitBootServicesCallback,
NULL,
&gEfiEventExitBootServicesGuid,
&mExitBootServicesEvent
);

View File

@ -44,9 +44,6 @@
PrintLib
DebugPrintErrorLevelLib
[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES

View File

@ -93,23 +93,21 @@ RuntimeDriverLibConstruct (
//
// Register SetVirtualAddressMap () notify function
//
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
Status = gBS->CreateEvent (
EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
TPL_NOTIFY,
RuntimeLibVirtualNotifyEvent,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mEfiVirtualNotifyEvent
);
ASSERT_EFI_ERROR (Status);
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
Status = gBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
RuntimeLibExitBootServicesEvent,
NULL,
&gEfiEventExitBootServicesGuid,
&mEfiExitBootServicesEvent
);

View File

@ -39,8 +39,3 @@
UefiBootServicesTableLib
UefiRuntimeServicesTableLib
DebugLib
[Guids]
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event