TianoCore EDK2 master
Loading...
Searching...
No Matches
PlatformBm.c File Reference

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)
 

Functions

STATIC VOID FilterAndProcess (IN EFI_GUID *ProtocolGuid, IN FILTER_FUNCTION Filter OPTIONAL, IN CALLBACK_FUNCTION Process)
 
STATIC BOOLEAN EFIAPI IsPciDisplay (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText)
 
STATIC BOOLEAN EFIAPI IsUsbHost (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText)
 
STATIC VOID EFIAPI Connect (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText)
 
STATIC VOID EFIAPI AddOutput (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText)
 
STATIC VOID PlatformRegisterFvBootOption (CONST EFI_GUID *FileGuid, CHAR16 *Description, UINT32 Attributes, EFI_INPUT_KEY *Key)
 
STATIC VOID PlatformBootFvBootOption (IN CONST EFI_GUID *FileGuid, IN CHAR16 *Description)
 
STATIC VOID GetPlatformOptions (VOID)
 
STATIC VOID PlatformRegisterOptionsAndKeys (VOID)
 
VOID EFIAPI PlatformBootManagerBeforeConsole (VOID)
 
STATIC VOID HandleCapsules (VOID)
 
STATIC EFI_STATUS BootDiscoveryPolicyHandler (VOID)
 
VOID EFIAPI PlatformBootManagerAfterConsole (VOID)
 
VOID EFIAPI PlatformBootManagerWaitCallback (UINT16 TimeoutRemain)
 
VOID EFIAPI PlatformBootManagerUnableToBoot (VOID)
 

Variables

STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole
 
STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard
 

Detailed Description

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.

Macro Definition Documentation

◆ DP_NODE_LEN

#define DP_NODE_LEN (   Type)    { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 8) }

Definition at line 40 of file PlatformBm.c.

◆ VERSION_STRING_PREFIX

#define VERSION_STRING_PREFIX   L"Tianocore/EDK2 firmware version "

Definition at line 869 of file PlatformBm.c.

Typedef Documentation

◆ CALLBACK_FUNCTION

typedef VOID(EFIAPI * CALLBACK_FUNCTION) (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText)

Process a handle.

Parameters
[in]HandleThe handle to process.
[in]ReportTextA caller-allocated string passed in for reporting purposes. It must never be NULL.

Definition at line 152 of file PlatformBm.c.

◆ FILTER_FUNCTION

typedef BOOLEAN(EFIAPI * FILTER_FUNCTION) (IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText)

Check if the handle satisfies a particular condition.

Parameters
[in]HandleThe handle to check.
[in]ReportTextA caller-allocated string passed in for reporting purposes. It must never be NULL.
Return values
TRUEThe condition is satisfied.
FALSEOtherwise. This includes the case when the condition could not be fully evaluated due to an error.

Definition at line 138 of file PlatformBm.c.

Function Documentation

◆ AddOutput()

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.

◆ BootDiscoveryPolicyHandler()

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.

Return values
EFI_SUCCESSDevices connected successfully or connection not required.
othersReturn values from GetVariable(), LocateProtocol() and ConnectDeviceClass().

Definition at line 883 of file PlatformBm.c.

◆ Connect()

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.

◆ FilterAndProcess()

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.

Parameters
[in]ProtocolGuidThe protocol to look for.
[in]FilterThe filter function to pass each handle to. If this parameter is NULL, then all handles are processed.
[in]ProcessThe callback function to pass each handle to that clears the filter.

Definition at line 173 of file PlatformBm.c.

◆ GetPlatformOptions()

STATIC VOID GetPlatformOptions ( VOID  )

Definition at line 533 of file PlatformBm.c.

◆ HandleCapsules()

STATIC VOID HandleCapsules ( VOID  )

Definition at line 808 of file PlatformBm.c.

◆ IsPciDisplay()

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.

◆ IsUsbHost()

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.

◆ PlatformBootFvBootOption()

STATIC VOID PlatformBootFvBootOption ( IN CONST EFI_GUID FileGuid,
IN CHAR16 *  Description 
)

Boot a Fv Boot Option.

This function is useful for booting the UEFI Shell as it is loaded as a non active boot option.

Parameters
[in]FileGuidThe File GUID.
[in]DescriptionString describing the Boot Option.

Definition at line 484 of file PlatformBm.c.

◆ PlatformBootManagerAfterConsole()

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.

◆ PlatformBootManagerBeforeConsole()

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;

  1. 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.

◆ PlatformBootManagerUnableToBoot()

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.

◆ PlatformBootManagerWaitCallback()

VOID EFIAPI PlatformBootManagerWaitCallback ( UINT16  TimeoutRemain)

This function is called each second during the boot manager waits the timeout.

Parameters
TimeoutRemainThe remaining timeout.

Definition at line 1075 of file PlatformBm.c.

◆ PlatformRegisterFvBootOption()

STATIC VOID PlatformRegisterFvBootOption ( CONST EFI_GUID FileGuid,
CHAR16 *  Description,
UINT32  Attributes,
EFI_INPUT_KEY Key 
)

Definition at line 400 of file PlatformBm.c.

◆ PlatformRegisterOptionsAndKeys()

STATIC VOID PlatformRegisterOptionsAndKeys ( VOID  )

Definition at line 650 of file PlatformBm.c.

Variable Documentation

◆ mSerialConsole

Definition at line 51 of file PlatformBm.c.

◆ mUsbKeyboard

Initial value:
= {
{
{
},
0xFFFF,
0xFFFF,
3,
1,
1
},
{
END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
}
}
#define MSG_USB_CLASS_DP
Definition: DevicePath.h:434
#define MESSAGING_DEVICE_PATH
Definition: DevicePath.h:321

Definition at line 101 of file PlatformBm.c.