]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Do not use CreateEventEx unless required
authorVitaly Cheptsov via Groups.Io <vit9696=protonmail.com@groups.io>
Tue, 7 Jan 2020 10:50:32 +0000 (18:50 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 10 Jan 2020 03:25:59 +0000 (03:25 +0000)
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>
14 files changed:
MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf
MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c
MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c
MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLibSegmentInfo.inf
MdePkg/Library/UefiDebugLibConOut/DebugLibConstructor.c
MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c
MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf
MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c
MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf

index 862c6bff09fe6ccdc860ffd109e66fc6ce8456b0..cc79843b1cdad088d20422af25ef4ab737a4a744 100644 (file)
@@ -77,9 +77,8 @@ DxeRuntimeDebugLibSerialPortConstructor (
     return Status;\r
   }\r
 \r
-  return SystemTable->BootServices->CreateEventEx (EVT_NOTIFY_SIGNAL,\r
+  return SystemTable->BootServices->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
                                       TPL_NOTIFY, ExitBootServicesEvent, NULL,\r
-                                      &gEfiEventExitBootServicesGuid,\r
                                       &mEfiExitBootServicesEvent);\r
 }\r
 \r
index 655c1c14c17ea7832f28c01aa7f6ec4912db34ee..31d169ad7c074fa9786e716024ab0594d4d4bc98 100644 (file)
@@ -41,9 +41,6 @@
   PrintLib\r
   SerialPortLib\r
 \r
-[Guids]\r
-  gEfiEventExitBootServicesGuid                         ## CONSUMES ## Event\r
-\r
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue     ## SOMETIMES_CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask         ## CONSUMES\r
index 45bfe9dc6fca64d97eb5e6292ba5353c3e597c09..8d2ba1d18735e53446ec73a3f87003e5bd73e066 100644 (file)
@@ -47,7 +47,3 @@
 \r
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress  ## CONSUMES\r
-\r
-[Guids]\r
-  gEfiEventVirtualAddressChangeGuid         ## CONSUMES ## Event\r
-\r
index 6e784763be73c6cc8d366be21774b32662c12003..7e5852e641db21debdadb039477ef0a3e6d97903 100644 (file)
@@ -124,12 +124,11 @@ DxeRuntimePciExpressLibConstructor (
   //\r
   // Register SetVirtualAddressMap () notify function\r
   //\r
-  Status = gBS->CreateEventEx (\r
-                  EVT_NOTIFY_SIGNAL,\r
+  Status = gBS->CreateEvent (\r
+                  EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
                   TPL_NOTIFY,\r
                   DxeRuntimePciExpressLibVirtualNotify,\r
                   NULL,\r
-                  &gEfiEventVirtualAddressChangeGuid,\r
                   &mDxeRuntimePciExpressLibVirtualNotifyEvent\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
index 2f503ecffe057430c88d0a9f7e548ffbdd1dc7aa..b0dbdec0cf85590e2e6c6af96a0e505ce8dbca55 100644 (file)
@@ -109,12 +109,11 @@ DxeRuntimePciSegmentLibConstructor (
   //\r
   // Register SetVirtualAddressMap () notify function\r
   //\r
-  Status = gBS->CreateEventEx (\r
-                  EVT_NOTIFY_SIGNAL,\r
+  Status = gBS->CreateEvent (\r
+                  EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
                   TPL_NOTIFY,\r
                   DxeRuntimePciSegmentLibVirtualNotify,\r
                   NULL,\r
-                  &gEfiEventVirtualAddressChangeGuid,\r
                   &mDxeRuntimePciSegmentLibVirtualNotifyEvent\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
index f6445f4abb0bd6320232b5b1e7f2f8a4811b0879..ae9f11b697dfc486532d5dcde88bca78776c66d9 100644 (file)
@@ -45,6 +45,3 @@
   MemoryAllocationLib\r
   DxeServicesTableLib\r
   UefiBootServicesTableLib\r
-\r
-[Guids]\r
-  gEfiEventVirtualAddressChangeGuid         ## CONSUMES ## Event\r
index ed73f92818743454d702b836e6704ba646223aeb..b4ac17cf55aa2ea21f3800dad82bef422b984cf3 100644 (file)
@@ -64,12 +64,11 @@ DxeDebugLibConstructor(
 {\r
   mDebugST = SystemTable;\r
 \r
-  SystemTable->BootServices->CreateEventEx (\r
-                                EVT_NOTIFY_SIGNAL,\r
+  SystemTable->BootServices->CreateEvent (\r
+                                EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
                                 TPL_NOTIFY,\r
                                 ExitBootServicesCallback,\r
                                 NULL,\r
-                                &gEfiEventExitBootServicesGuid,\r
                                 &mExitBootServicesEvent\r
                                 );\r
 \r
index b577d52ac66ba1c61e59a83f4417d1ad5547125d..53bbc8ce3f6570f76938195bd2e6b506546e14f0 100644 (file)
@@ -46,9 +46,6 @@
   PrintLib\r
   DebugPrintErrorLevelLib\r
 \r
-[Guids]\r
-  gEfiEventExitBootServicesGuid                 ## CONSUMES\r
-\r
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue        ## SOMETIMES_CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask            ## CONSUMES\r
index 6ea0912f2b3a1b143483dd5861cadee77f303da7..96fc1c422fec6b38eb1e1a61eca3bda55e39ddb3 100644 (file)
@@ -64,12 +64,11 @@ DxeDebugLibConstructor(
 {\r
   mDebugBS = SystemTable->BootServices;\r
 \r
-  mDebugBS->CreateEventEx (\r
-              EVT_NOTIFY_SIGNAL,\r
+  mDebugBS->CreateEvent (\r
+              EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
               TPL_NOTIFY,\r
               ExitBootServicesCallback,\r
               NULL,\r
-              &gEfiEventExitBootServicesGuid,\r
               &mExitBootServicesEvent\r
               );\r
 \r
index ff09a12ce40ddbce80dd3d8c7e7e562a4a190f12..e12a1025c6cc0a23d463b083cee6acb0f5c350ae 100644 (file)
@@ -46,9 +46,6 @@
   PrintLib\r
   DebugPrintErrorLevelLib\r
 \r
-[Guids]\r
-  gEfiEventExitBootServicesGuid                 ## CONSUMES\r
-\r
 [Protocols]\r
   gEfiDebugPortProtocolGuid                     ## CONSUMES\r
 \r
index ed73f92818743454d702b836e6704ba646223aeb..b4ac17cf55aa2ea21f3800dad82bef422b984cf3 100644 (file)
@@ -64,12 +64,11 @@ DxeDebugLibConstructor(
 {\r
   mDebugST = SystemTable;\r
 \r
-  SystemTable->BootServices->CreateEventEx (\r
-                                EVT_NOTIFY_SIGNAL,\r
+  SystemTable->BootServices->CreateEvent (\r
+                                EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
                                 TPL_NOTIFY,\r
                                 ExitBootServicesCallback,\r
                                 NULL,\r
-                                &gEfiEventExitBootServicesGuid,\r
                                 &mExitBootServicesEvent\r
                                 );\r
 \r
index 11f7594626ed6baec6e58df87c20a6c218f31b6c..5ecb971a0ac57468612369ba847bfc824692be69 100644 (file)
@@ -44,9 +44,6 @@
   PrintLib\r
   DebugPrintErrorLevelLib\r
 \r
-[Guids]\r
-  gEfiEventExitBootServicesGuid                 ## CONSUMES\r
-\r
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue   ## SOMETIMES_CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask       ## CONSUMES\r
index 933e0099ceed1e07ca9263707b0c9f1d876302fa..a2eadafac862635aefa7f5a6548637c56a47eeb1 100644 (file)
@@ -93,23 +93,21 @@ RuntimeDriverLibConstruct (
   //\r
   // Register SetVirtualAddressMap () notify function\r
   //\r
-  Status = gBS->CreateEventEx (\r
-                  EVT_NOTIFY_SIGNAL,\r
+  Status = gBS->CreateEvent (\r
+                  EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
                   TPL_NOTIFY,\r
                   RuntimeLibVirtualNotifyEvent,\r
                   NULL,\r
-                  &gEfiEventVirtualAddressChangeGuid,\r
                   &mEfiVirtualNotifyEvent\r
                   );\r
 \r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  Status = gBS->CreateEventEx (\r
-                  EVT_NOTIFY_SIGNAL,\r
+  Status = gBS->CreateEvent (\r
+                  EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
                   TPL_NOTIFY,\r
                   RuntimeLibExitBootServicesEvent,\r
                   NULL,\r
-                  &gEfiEventExitBootServicesGuid,\r
                   &mEfiExitBootServicesEvent\r
                   );\r
 \r
index 5527f9f02f7e0b47612e76140ceda3ae368909c8..cc4ee151100dea92a6b1045456706c564d7b7811 100644 (file)
@@ -39,8 +39,3 @@
   UefiBootServicesTableLib\r
   UefiRuntimeServicesTableLib\r
   DebugLib\r
-\r
-[Guids]\r
-  gEfiEventExitBootServicesGuid             ## CONSUMES ## Event\r
-  gEfiEventVirtualAddressChangeGuid         ## CONSUMES ## Event\r
-\r