From 13ca0abb01d90eb039abf7ef978bd803e2347cef Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Mon, 2 Oct 2017 20:00:44 +0100 Subject: ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times 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 Reviewed-by: Leif Lindholm --- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 23 ++++++++++++++++++++-- .../PlatformBootManagerLib.inf | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index a3b2d7925f..e950695162 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole ( VOID ) { - EFI_STATUS Status; + EFI_STATUS Status; + ESRT_MANAGEMENT_PROTOCOL *EsrtManagement; if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n")); Status = ProcessCapsules (); DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status)); + } else { + if (EsrtManagement != NULL) { + EsrtManagement->SyncEsrtFmp (); + } + } + + Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL, + (VOID **)&EsrtManagement); + if (EFI_ERROR (Status)) { + EsrtManagement = NULL; } // @@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole ( VOID ) { - EFI_STATUS Status; + ESRT_MANAGEMENT_PROTOCOL *EsrtManagement; + EFI_STATUS Status; // // Show the splash screen. @@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole ( // EfiBootManagerConnectAll (); + Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL, + (VOID **)&EsrtManagement); + if (!EFI_ERROR (Status)) { + EsrtManagement->SyncEsrtFmp (); + } + if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n")); Status = ProcessCapsules (); diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 58c4d6d2c7..fce7349ff8 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -82,3 +82,4 @@ gEfiLoadedImageProtocolGuid gEfiPciRootBridgeIoProtocolGuid gEfiSimpleFileSystemProtocolGuid + gEsrtManagementProtocolGuid -- cgit v1.2.3