summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/PlatformBootManagerLib
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-10-02 20:00:44 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-10-06 21:50:16 +0100
commit13ca0abb01d90eb039abf7ef978bd803e2347cef (patch)
tree327fc4515c3c63390a9649974cc77dc4e2402228 /ArmPkg/Library/PlatformBootManagerLib
parent08e94eee947bd3ff4a6645e303dd86853cb6d8ba (diff)
downloadedk2-13ca0abb01d90eb039abf7ef978bd803e2347cef.tar.gz
edk2-13ca0abb01d90eb039abf7ef978bd803e2347cef.tar.bz2
edk2-13ca0abb01d90eb039abf7ef978bd803e2347cef.zip
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>
Diffstat (limited to 'ArmPkg/Library/PlatformBootManagerLib')
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c23
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf1
2 files changed, 22 insertions, 2 deletions
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 <Library/UefiBootManagerLib.h>
#include <Library/UefiLib.h>
#include <Protocol/DevicePath.h>
+#include <Protocol/EsrtManagement.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/PciIo.h>
@@ -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