]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
ArmPkg/PlatformBootManagerLib: fix bug in ESRT invocation
[mirror_edk2.git] / ArmPkg / Library / PlatformBootManagerLib / PlatformBm.c
index a3b2d7925f72c66ca8f2f0d4af3b2e7250804ba3..95e739c66c2931c63f295dc336c6bd32824d12b8 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,19 @@ 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
+    Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL,\r
+                    (VOID **)&EsrtManagement);\r
+    if (!EFI_ERROR (Status)) {\r
+      EsrtManagement->SyncEsrtFmp ();\r
+    }\r
   }\r
 \r
   //\r
@@ -524,7 +532,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 +547,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