TianoCore EDK2 master
|
#include <IndustryStandard/Pci22.h>
#include <Library/BootLogoLib.h>
#include <Library/CapsuleLib.h>
#include <Library/DevicePathLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiBootManagerLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/BootManagerPolicy.h>
#include <Protocol/DevicePath.h>
#include <Protocol/EsrtManagement.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/NonDiscoverableDevice.h>
#include <Protocol/PciIo.h>
#include <Protocol/PciRootBridgeIo.h>
#include <Protocol/PlatformBootManager.h>
#include <Guid/BootDiscoveryPolicy.h>
#include <Guid/EventGroup.h>
#include <Guid/NonDiscoverableDevice.h>
#include <Guid/TtyTerm.h>
#include <Guid/SerialPortLibVendor.h>
#include "PlatformBm.h"
Go to the source code of this file.
Data Structures | |
struct | PLATFORM_SERIAL_CONSOLE |
struct | PLATFORM_USB_KEYBOARD |
Macros | |
#define | DP_NODE_LEN(Type) { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 8) } |
#define | VERSION_STRING_PREFIX L"Tianocore/EDK2 firmware version " |
Typedefs | |
typedef BOOLEAN(EFIAPI * | FILTER_FUNCTION) (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText) |
typedef VOID(EFIAPI * | CALLBACK_FUNCTION) (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText) |
Variables | |
STATIC PLATFORM_SERIAL_CONSOLE | mSerialConsole |
STATIC PLATFORM_USB_KEYBOARD | mUsbKeyboard |
Implementation for PlatformBootManagerLib library class interfaces.
Copyright (C) 2015-2016, Red Hat, Inc. Copyright (c) 2014 - 2023, Arm Ltd. All rights reserved.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2016, Linaro Ltd. All rights reserved.
Copyright (c) 2021, Semihalf All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PlatformBm.c.
#define DP_NODE_LEN | ( | Type | ) | { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 8) } |
Definition at line 40 of file PlatformBm.c.
#define VERSION_STRING_PREFIX L"Tianocore/EDK2 firmware version " |
Definition at line 869 of file PlatformBm.c.
typedef VOID(EFIAPI * CALLBACK_FUNCTION) (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText) |
Process a handle.
[in] | Handle | The handle to process. |
[in] | ReportText | A caller-allocated string passed in for reporting purposes. It must never be NULL. |
Definition at line 152 of file PlatformBm.c.
typedef BOOLEAN(EFIAPI * FILTER_FUNCTION) (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText) |
Check if the handle satisfies a particular condition.
[in] | Handle | The handle to check. |
[in] | ReportText | A caller-allocated string passed in for reporting purposes. It must never be NULL. |
TRUE | The condition is satisfied. |
FALSE | Otherwise. This includes the case when the condition could not be fully evaluated due to an error. |
Definition at line 138 of file PlatformBm.c.
STATIC VOID EFIAPI AddOutput | ( | IN EFI_HANDLE | Handle, |
IN CONST CHAR16 * | ReportText | ||
) |
This CALLBACK_FUNCTION retrieves the EFI_DEVICE_PATH_PROTOCOL from the handle, and adds it to ConOut and ErrOut.
Definition at line 346 of file PlatformBm.c.
STATIC EFI_STATUS BootDiscoveryPolicyHandler | ( | VOID | ) |
This functions checks the value of BootDiscoverPolicy variable and connect devices of class specified by that variable. Then it refreshes Boot order for newly discovered boot device.
EFI_SUCCESS | Devices connected successfully or connection not required. |
others | Return values from GetVariable(), LocateProtocol() and ConnectDeviceClass(). |
Definition at line 883 of file PlatformBm.c.
STATIC VOID EFIAPI Connect | ( | IN EFI_HANDLE | Handle, |
IN CONST CHAR16 * | ReportText | ||
) |
This CALLBACK_FUNCTION attempts to connect a handle non-recursively, asking the matching driver to produce all first-level child handles.
Definition at line 317 of file PlatformBm.c.
STATIC VOID FilterAndProcess | ( | IN EFI_GUID * | ProtocolGuid, |
IN FILTER_FUNCTION Filter | OPTIONAL, | ||
IN CALLBACK_FUNCTION | Process | ||
) |
Locate all handles that carry the specified protocol, filter them with a callback function, and pass each handle that passes the filter to another callback.
[in] | ProtocolGuid | The protocol to look for. |
[in] | Filter | The filter function to pass each handle to. If this parameter is NULL, then all handles are processed. |
[in] | Process | The callback function to pass each handle to that clears the filter. |
Definition at line 173 of file PlatformBm.c.
STATIC VOID GetPlatformOptions | ( | VOID | ) |
Definition at line 533 of file PlatformBm.c.
STATIC VOID HandleCapsules | ( | VOID | ) |
Definition at line 808 of file PlatformBm.c.
STATIC BOOLEAN EFIAPI IsPciDisplay | ( | IN EFI_HANDLE | Handle, |
IN CONST CHAR16 * | ReportText | ||
) |
This FILTER_FUNCTION checks if a handle corresponds to a PCI display device.
Definition at line 240 of file PlatformBm.c.
STATIC BOOLEAN EFIAPI IsUsbHost | ( | IN EFI_HANDLE | Handle, |
IN CONST CHAR16 * | ReportText | ||
) |
This FILTER_FUNCTION checks if a handle corresponds to a non-discoverable USB host controller.
Definition at line 283 of file PlatformBm.c.
Boot a Fv Boot Option.
This function is useful for booting the UEFI Shell as it is loaded as a non active boot option.
[in] | FileGuid | The File GUID. |
[in] | Description | String describing the Boot Option. |
Definition at line 484 of file PlatformBm.c.
VOID EFIAPI PlatformBootManagerAfterConsole | ( | VOID | ) |
Do the platform specific action after the console is ready Possible things that can be done in PlatformBootManagerAfterConsole:
Console post action: Dynamically switch output mode from 100x31 to 80x25 for certain scenario Signal console ready platform customized event Run diagnostics like memory testing Connect certain devices Dispatch additional option roms Special boot: e.g.: USB boot, enter UI
Definition at line 995 of file PlatformBm.c.
VOID EFIAPI PlatformBootManagerBeforeConsole | ( | VOID | ) |
Do the platform init, can be customized by OEM/IBV Possible things that can be done in PlatformBootManagerBeforeConsole:
Update console variable: 1. include hot-plug devices;
- Clear ConIn and add SOL for AMT Register new Driver#### or Boot#### Register new Key####: e.g.: F12 Signal ReadyToLock event Authentication action: 1. connect Auth devices;
Identify auto logon user.
Definition at line 714 of file PlatformBm.c.
VOID EFIAPI PlatformBootManagerUnableToBoot | ( | VOID | ) |
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.
Definition at line 1111 of file PlatformBm.c.
VOID EFIAPI PlatformBootManagerWaitCallback | ( | UINT16 | TimeoutRemain | ) |
This function is called each second during the boot manager waits the timeout.
TimeoutRemain | The remaining timeout. |
Definition at line 1075 of file PlatformBm.c.
STATIC VOID PlatformRegisterFvBootOption | ( | CONST EFI_GUID * | FileGuid, |
CHAR16 * | Description, | ||
UINT32 | Attributes, | ||
EFI_INPUT_KEY * | Key | ||
) |
Definition at line 400 of file PlatformBm.c.
STATIC VOID PlatformRegisterOptionsAndKeys | ( | VOID | ) |
Definition at line 650 of file PlatformBm.c.
STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole |
Definition at line 51 of file PlatformBm.c.
STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard |
Definition at line 101 of file PlatformBm.c.