]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg: signal EndOxDxe event in PlatformBsdInit
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 25 Jun 2015 14:49:06 +0000 (14:49 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Thu, 25 Jun 2015 14:49:06 +0000 (14:49 +0000)
Currently, the ArmVirtPkg platforms built with the Intel BDS fail
to signal the end-of-DXE event 'gEfiEndOfDxeEventGroupGuid' when
entering the BDS phase, which results in some loss of functionality,
i.e., variable reclaim in the VariableDxe drivers, and the splitting
of the memory regions that is part of the recently added UEFI 2.5
properties table feature.

As discussed on the edk2-devel mailing list here:

http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16088/focus=16109

it is up to the platform BDS to signal that event, since there may be
platform specific ordering constraints with respect to the signalling
of the event that are difficult to honor at the generic level.

So add the SignalEvent () call to PlatformBdsInit () of ArmVirtPkg's
PlatformBdsLib implementation for the Intel BDS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17713 6f19259b-4bc3-4df7-8a09-765794883524

ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf

index 499cce5dcde68f72fec16ff0bb3d4a389bbfe281..13830cbe3665820bc88963c010f507681133869f 100644 (file)
@@ -24,6 +24,7 @@
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/PciIo.h>\r
 #include <Protocol/PciRootBridgeIo.h>\r
+#include <Guid/EventGroup.h>\r
 \r
 #include "IntelBdsPlatform.h"\r
 \r
@@ -118,6 +119,23 @@ STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
   }\r
 };\r
 \r
+/**\r
+  An empty function to pass error checking of CreateEventEx ().\r
+\r
+  @param  Event                 Event whose notification function is being invoked.\r
+  @param  Context               Pointer to the notification function's context,\r
+                                which is implementation-dependent.\r
+\r
+**/\r
+STATIC\r
+VOID\r
+EFIAPI\r
+EmptyCallbackFunction (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  )\r
+{\r
+}\r
 \r
 //\r
 // BDS Platform Functions\r
@@ -133,6 +151,24 @@ PlatformBdsInit (
   VOID\r
   )\r
 {\r
+  EFI_EVENT           EndOfDxeEvent;\r
+  EFI_STATUS          Status;\r
+\r
+  //\r
+  // Signal EndOfDxe PI Event\r
+  //\r
+  Status = gBS->CreateEventEx (\r
+                  EVT_NOTIFY_SIGNAL,\r
+                  TPL_CALLBACK,\r
+                  EmptyCallbackFunction,\r
+                  NULL,\r
+                  &gEfiEndOfDxeEventGroupGuid,\r
+                  &EndOfDxeEvent\r
+                  );\r
+  if (!EFI_ERROR (Status)) {\r
+    gBS->SignalEvent (EndOfDxeEvent);\r
+    gBS->CloseEvent (EndOfDxeEvent);\r
+  }\r
 }\r
 \r
 \r
index d8f892642c2e4f725b240df53b608aee74143028..d9982167e81d0e397dd5b7bb1b6384c565123f23 100644 (file)
@@ -65,6 +65,7 @@
   gEfiFileInfoGuid\r
   gEfiFileSystemInfoGuid\r
   gEfiFileSystemVolumeLabelInfoIdGuid\r
+  gEfiEndOfDxeEventGroupGuid\r
 \r
 [Protocols]\r
   gEfiDevicePathProtocolGuid\r