+++ /dev/null
-/** @file\r
- This file defines the Univeral Payload Platform BootManager Protocol.\r
-\r
- Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
- SPDX-License-Identifier: BSD-2-Clause-Patent\r
-**/\r
-\r
-#ifndef __PLATFORM_BOOT_MANAGER_OVERRIDE_H__\r
-#define __PLATFORM_BOOT_MANAGER_OVERRIDE_H__\r
-\r
-/**\r
- Do the platform specific action before the console is connected.\r
-\r
- Such as:\r
- Update console variable;\r
- Register new Driver#### or Boot####;\r
- Signal ReadyToLock event.\r
-\r
- This function will override the default behavior in PlatformBootManagerLib\r
-**/\r
-typedef\r
-VOID\r
-(EFIAPI *UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_BEFORE_CONSOLE)(\r
- VOID\r
- );\r
-\r
-/**\r
- Do the platform specific action after the console is connected.\r
-\r
- Such as:\r
- Dynamically switch output mode;\r
- Signal console ready platform customized event;\r
- Run diagnostics like memory testing;\r
- Connect certain devices;\r
- Dispatch aditional option roms.\r
-\r
- This function will override the default behavior in PlatformBootManagerLib\r
-**/\r
-typedef\r
-VOID\r
-(EFIAPI *UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_AFTER_CONSOLE)(\r
- VOID\r
- );\r
-\r
-/**\r
- This function is called each second during the boot manager waits the timeout.\r
- This function will override the default behavior in PlatformBootManagerLib\r
-\r
- @param TimeoutRemain The remaining timeout.\r
-**/\r
-typedef\r
-VOID\r
-(EFIAPI *UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_WAIT_CALLBACK)(\r
- UINT16 TimeoutRemain\r
- );\r
-\r
-/**\r
- The function is called when no boot option could be launched,\r
- including platform recovery options and options pointing to applications\r
- built into firmware volumes.\r
-\r
- If this function returns, BDS attempts to enter an infinite loop.\r
- This function will override the default behavior in PlatformBootManagerLib\r
-**/\r
-typedef\r
-VOID\r
-(EFIAPI *UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_UNABLE_TO_BOOT)(\r
- VOID\r
- );\r
-\r
-///\r
-/// Provides an interface to override the default behavior in PlatformBootManagerLib,\r
-/// so platform can provide its own platform specific logic through this protocol\r
-///\r
-typedef struct {\r
- UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_BEFORE_CONSOLE BeforeConsole;\r
- UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_AFTER_CONSOLE AfterConsole;\r
- UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_WAIT_CALLBACK WaitCallback;\r
- UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_UNABLE_TO_BOOT UnableToBoot;\r
-} UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCOL;\r
-\r
-extern GUID gUniversalPayloadPlatformBootManagerOverrideProtocolGuid;\r
-\r
-#endif\r
\r
#include "PlatformBootManager.h"\r
#include "PlatformConsole.h"\r
-#include <Protocol/PlatformBootManagerOverride.h>\r
#include <Guid/BootManagerMenu.h>\r
#include <Library/HobLib.h>\r
\r
-UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCOL *mUniversalPayloadPlatformBootManagerOverrideInstance = NULL;\r
-\r
/**\r
Signal EndOfDxe event and install SMM Ready to lock protocol.\r
\r
EFI_INPUT_KEY CustomKey;\r
EFI_INPUT_KEY Down;\r
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;\r
- EFI_STATUS Status;\r
-\r
- Status = gBS->LocateProtocol (&gUniversalPayloadPlatformBootManagerOverrideProtocolGuid, NULL, (VOID **)&mUniversalPayloadPlatformBootManagerOverrideInstance);\r
- if (EFI_ERROR (Status)) {\r
- mUniversalPayloadPlatformBootManagerOverrideInstance = NULL;\r
- }\r
-\r
- if (mUniversalPayloadPlatformBootManagerOverrideInstance != NULL) {\r
- mUniversalPayloadPlatformBootManagerOverrideInstance->BeforeConsole ();\r
- return;\r
- }\r
\r
//\r
// Register ENTER as CONTINUE key\r
EDKII_PLATFORM_LOGO_PROTOCOL *PlatformLogo;\r
EFI_STATUS Status;\r
\r
- if (mUniversalPayloadPlatformBootManagerOverrideInstance != NULL) {\r
- mUniversalPayloadPlatformBootManagerOverrideInstance->AfterConsole ();\r
- return;\r
- }\r
-\r
Black.Blue = Black.Green = Black.Red = Black.Reserved = 0;\r
White.Blue = White.Green = White.Red = White.Reserved = 0xFF;\r
\r
UINT16 TimeoutRemain\r
)\r
{\r
- if (mUniversalPayloadPlatformBootManagerOverrideInstance != NULL) {\r
- mUniversalPayloadPlatformBootManagerOverrideInstance->WaitCallback (TimeoutRemain);\r
- }\r
-\r
return;\r
}\r
\r
VOID\r
)\r
{\r
- if (mUniversalPayloadPlatformBootManagerOverrideInstance != NULL) {\r
- mUniversalPayloadPlatformBootManagerOverrideInstance->UnableToBoot ();\r
- }\r
-\r
return;\r
}\r
\r
#\r
gPlatformGOPPolicyGuid = { 0xec2e931b, 0x3281, 0x48a5, { 0x81, 0x07, 0xdf, 0x8a, 0x8b, 0xed, 0x3c, 0x5d } }\r
\r
- gUniversalPayloadPlatformBootManagerOverrideProtocolGuid = { 0xdb3fc2df, 0x7376, 0x4a8d, { 0x82, 0xab, 0x91, 0x54, 0xa1, 0x36, 0xa6, 0x5a } }\r
-\r
################################################################################\r
#\r
# PCD Declarations section - list of all PCDs Declared by this Package\r