]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: signal EndOfDxe event in PlatformBsdInit
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 4 Sep 2015 06:11:42 +0000 (06:11 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Fri, 4 Sep 2015 06:11:42 +0000 (06:11 +0000)
Like the ArmVirtPkg platforms up until SVN r17713, the ArmPlatformPkg
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 ArmPlatformPkg'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>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18394 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.h
ArmPlatformPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf

index 98d5b277a63600413d03272f553e175713ccde0c..e27e6d66df9159d80969c2c234f41a6fb8e9c143 100644 (file)
@@ -31,6 +31,24 @@ PlatformIntelBdsConstructor (
   return EFI_SUCCESS;\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
 //\r
@@ -45,6 +63,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
 STATIC\r
index 7122d58be7d73d6456224e548ba58d798eb87619..da428288fb9f815e3c98324d10e961037f7ab57b 100644 (file)
@@ -30,5 +30,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PlatformBdsLib.h>\r
 \r
 #include <Guid/GlobalVariable.h>\r
+#include <Guid/EventGroup.h>\r
 \r
 #endif // _INTEL_BDS_PLATFORM_H\r
index a18c5ea71f70c96be705dc4885885c036e493237..39df113288d2f6302c9d38b609df0328682e22cf 100644 (file)
@@ -53,6 +53,7 @@
 \r
 [Guids]\r
   gArmGlobalVariableGuid\r
+  gEfiEndOfDxeEventGroupGuid\r
 \r
 [Pcd]\r
   gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths\r