]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 2 Oct 2017 19:00:44 +0000 (20:00 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 6 Oct 2017 20:50:16 +0000 (21:50 +0100)
The ESRT management protocol needs to be invoked at the appropriate times
to get the ESRT config table to be published when the ReadyToBoot event
is signalled. So add this handling to the default ArmPkg implementation
of PlatformBootManagerLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf

index a3b2d7925f72c66ca8f2f0d4af3b2e7250804ba3..e95069516216fba3fa24bfa7d16e0f976211f5b7 100644 (file)
@@ -25,6 +25,7 @@
 #include <Library/UefiBootManagerLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Protocol/DevicePath.h>\r
+#include <Protocol/EsrtManagement.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/LoadedImage.h>\r
 #include <Protocol/PciIo.h>\r
@@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole (
   VOID\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
+  EFI_STATUS                    Status;\r
+  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;\r
 \r
   if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {\r
     DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));\r
     Status = ProcessCapsules ();\r
     DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));\r
+  } else {\r
+    if (EsrtManagement != NULL) {\r
+      EsrtManagement->SyncEsrtFmp ();\r
+    }\r
+  }\r
+\r
+  Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL,\r
+                  (VOID **)&EsrtManagement);\r
+  if (EFI_ERROR (Status)) {\r
+    EsrtManagement = NULL;\r
   }\r
 \r
   //\r
@@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole (
   VOID\r
   )\r
 {\r
-  EFI_STATUS      Status;\r
+  ESRT_MANAGEMENT_PROTOCOL      *EsrtManagement;\r
+  EFI_STATUS                    Status;\r
 \r
   //\r
   // Show the splash screen.\r
@@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole (
   //\r
   EfiBootManagerConnectAll ();\r
 \r
+  Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL,\r
+                  (VOID **)&EsrtManagement);\r
+  if (!EFI_ERROR (Status)) {\r
+    EsrtManagement->SyncEsrtFmp ();\r
+  }\r
+\r
   if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {\r
     DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n"));\r
     Status = ProcessCapsules ();\r
index 58c4d6d2c7d61f0fda17e88388c9bb260c01ee8a..fce7349ff867e913b263d45babe6b7947ad8242a 100644 (file)
@@ -82,3 +82,4 @@
   gEfiLoadedImageProtocolGuid\r
   gEfiPciRootBridgeIoProtocolGuid\r
   gEfiSimpleFileSystemProtocolGuid\r
+  gEsrtManagementProtocolGuid\r