X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CorebootPayloadPkg%2FLibrary%2FPlatformBootManagerLib%2FPlatformBootManager.c;h=368e89d58616a6aa4d367ac1a2f3f0357397550f;hp=1546e4879a37c5bdabb4f49c7c0f4ace59491e1c;hb=ad3af920399aaf997efa93f1dcd3f9e914af555d;hpb=f94623aacc35bd1dd32a5d4ecb6b00121adf3847 diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c index 1546e4879a..368e89d586 100644 --- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c +++ b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c @@ -2,7 +2,7 @@ This file include all platform action which can be customized by IBV/OEM. -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -16,16 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "PlatformBootManager.h" #include "PlatformConsole.h" -VOID -EFIAPI -InternalBdsEmptyCallbackFuntion ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - return; -} - VOID InstallReadyToLock ( VOID @@ -34,24 +24,13 @@ InstallReadyToLock ( EFI_STATUS Status; EFI_HANDLE Handle; EFI_SMM_ACCESS2_PROTOCOL *SmmAccess; - EFI_EVENT EndOfDxeEvent; DEBUG((DEBUG_INFO,"InstallReadyToLock entering......\n")); // // Inform the SMM infrastructure that we're entering BDS and may run 3rd party code hereafter // Since PI1.2.1, we need signal EndOfDxe as ExitPmAuth // - Status = gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - InternalBdsEmptyCallbackFuntion, - NULL, - &gEfiEndOfDxeEventGroupGuid, - &EndOfDxeEvent - ); - ASSERT_EFI_ERROR (Status); - gBS->SignalEvent (EndOfDxeEvent); - gBS->CloseEvent (EndOfDxeEvent); + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); DEBUG((DEBUG_INFO,"All EndOfDxe callbacks have returned successfully\n")); // @@ -181,6 +160,7 @@ PlatformBootManagerBeforeConsole ( { EFI_INPUT_KEY Enter; EFI_INPUT_KEY F2; + EFI_INPUT_KEY Down; EFI_BOOT_MANAGER_LOAD_OPTION BootOption; PlatformConsoleInit (); @@ -200,11 +180,24 @@ PlatformBootManagerBeforeConsole ( EfiBootManagerGetBootManagerMenu (&BootOption); EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumber, 0, &F2, NULL); + // + // Also add Down key to Boot Manager Menu since some serial terminals don't support F2 key. + // + Down.ScanCode = SCAN_DOWN; + Down.UnicodeChar = CHAR_NULL; + EfiBootManagerGetBootManagerMenu (&BootOption); + EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumber, 0, &Down, NULL); + // // Install ready to lock. // This needs to be done before option rom dispatched. // InstallReadyToLock (); + + // + // Dispatch deferred images after EndOfDxe event and ReadyToLock installation. + // + EfiBootManagerDispatchDeferredImages (); } /** @@ -239,8 +232,8 @@ PlatformBootManagerAfterConsole ( Print ( L"\n" - L"F2 to enter Boot Manager Menu.\n" - L"ENTER to boot directly.\n" + L"F2 or Down to enter Boot Manager Menu.\n" + L"ENTER to boot directly.\n" L"\n" ); @@ -259,3 +252,20 @@ PlatformBootManagerWaitCallback ( { return; } + +/** + The function is called when no boot option could be launched, + including platform recovery options and options pointing to applications + built into firmware volumes. + + If this function returns, BDS attempts to enter an infinite loop. +**/ +VOID +EFIAPI +PlatformBootManagerUnableToBoot ( + VOID + ) +{ + return; +} +