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 <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Ard Biesheuvel 2017-10-02 20:00:44 +01:00
parent 08e94eee94
commit 13ca0abb01
2 changed files with 22 additions and 2 deletions

View File

@ -25,6 +25,7 @@
#include <Library/UefiBootManagerLib.h> #include <Library/UefiBootManagerLib.h>
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
#include <Protocol/DevicePath.h> #include <Protocol/DevicePath.h>
#include <Protocol/EsrtManagement.h>
#include <Protocol/GraphicsOutput.h> #include <Protocol/GraphicsOutput.h>
#include <Protocol/LoadedImage.h> #include <Protocol/LoadedImage.h>
#include <Protocol/PciIo.h> #include <Protocol/PciIo.h>
@ -450,11 +451,22 @@ PlatformBootManagerBeforeConsole (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
ESRT_MANAGEMENT_PROTOCOL *EsrtManagement;
if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n")); DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));
Status = ProcessCapsules (); Status = ProcessCapsules ();
DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status)); 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,6 +536,7 @@ PlatformBootManagerAfterConsole (
VOID VOID
) )
{ {
ESRT_MANAGEMENT_PROTOCOL *EsrtManagement;
EFI_STATUS Status; EFI_STATUS Status;
// //
@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole (
// //
EfiBootManagerConnectAll (); EfiBootManagerConnectAll ();
Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL,
(VOID **)&EsrtManagement);
if (!EFI_ERROR (Status)) {
EsrtManagement->SyncEsrtFmp ();
}
if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {
DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n")); DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n"));
Status = ProcessCapsules (); Status = ProcessCapsules ();

View File

@ -82,3 +82,4 @@
gEfiLoadedImageProtocolGuid gEfiLoadedImageProtocolGuid
gEfiPciRootBridgeIoProtocolGuid gEfiPciRootBridgeIoProtocolGuid
gEfiSimpleFileSystemProtocolGuid gEfiSimpleFileSystemProtocolGuid
gEsrtManagementProtocolGuid