Copyright (c) 2011 - 2015, 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 http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EFI_BOOT_MANAGER_ALT_PRESSED 0x00000004 |
#define EFI_BOOT_MANAGER_CONTROL_PRESSED 0x00000002 |
#define EFI_BOOT_MANAGER_LOGO_PRESSED 0x00000008 |
#define EFI_BOOT_MANAGER_MENU_KEY_PRESSED 0x00000010 |
#define EFI_BOOT_MANAGER_SHIFT_PRESSED 0x00000001 |
#define EFI_BOOT_MANAGER_SYS_REQ_PRESSED 0x00000020 |
typedef CHAR16* EFIAPI* EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER(IN EFI_HANDLE Handle, IN CONST CHAR16 *DefaultDescription) |
Return the platform provided boot option description for the controller.
Handle | Controller handle. | |
DefaultDescription | Default boot description provided by core. |
enum CONSOLE_TYPE |
EFI_STATUS EFIAPI EfiBootManagerAddKeyOptionVariable | ( | OUT EFI_BOOT_MANAGER_KEY_OPTION * | AddedOption, | |
IN UINT16 | BootOptionNumber, | |||
IN UINT32 | Modifier, | |||
... | ||||
) |
Add the key option. It adds the key option variable and the key option takes affect immediately.
AddedOption | Return the added key option. | |
BootOptionNumber | The boot option number for the key option. | |
Modifier | Key shift state. | |
... | Parameter list of pointer of EFI_INPUT_KEY. |
EFI_SUCCESS | The key option is added. | |
EFI_ALREADY_STARTED | The hot key is already used by certain key option. |
EFI_STATUS EFIAPI EfiBootManagerAddLoadOptionVariable | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | Option, | |
IN UINTN | Position | |||
) |
This function will update the Boot####/Driver####/SysPrep#### and the BootOrder/DriverOrder/SysPrepOrder to add a new load option.
Option | Pointer to load option to add. | |
Position | Position of the new load option to put in the BootOrder/DriverOrder/SysPrepOrder. |
EFI_SUCCESS | The load option has been successfully added. | |
Others | Error status returned by RT->SetVariable. |
VOID EFIAPI EfiBootManagerBoot | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | BootOption | ) |
Attempt to boot the EFI boot option. This routine sets L"BootCurent" and signals the EFI ready to boot event. If the device path for the option starts with a BBS device path a legacy boot is attempted. Short form device paths are also supported via this rountine. A device path starting with MEDIA_HARDDRIVE_DP, MSG_USB_WWID_DP, MSG_USB_CLASS_DP gets expaned out to find the first device that matches. If the BootOption Device Path fails the removable media boot algorithm is attempted (.EFI, .EFI,... only one file type is tried per processor type)
BootOption | Boot Option to try and boot. On return, BootOption->Status contains the boot status: EFI_SUCCESS BootOption was booted EFI_UNSUPPORTED BootOption isn't supported. EFI_NOT_FOUND The BootOption was not found on the system Others BootOption failed with this error status |
VOID EFIAPI EfiBootManagerConnectAll | ( | VOID | ) |
This function will connect all the system driver to controller first, and then special connect the default console, this make sure all the system controller available and the platform default console connected.
EFI_STATUS EFIAPI EfiBootManagerConnectAllDefaultConsoles | ( | VOID | ) |
This function will connect all the console devices base on the console device variable ConIn, ConOut and ErrOut.
EFI_DEVICE_ERROR | All the consoles were not connected due to an error. | |
EFI_SUCCESS | Success connect any one instance of the console device path base on the variable ConVarName. |
EFI_STATUS EFIAPI EfiBootManagerConnectConsoleVariable | ( | IN CONSOLE_TYPE | ConsoleType | ) |
Connect the console device base on the variable ConVarName, if device path of the ConVarName is multi-instance device path, if anyone of the instances is connected success, then this function will return success.
ConsoleType | ConIn, ConOut or ErrOut. |
EFI_NOT_FOUND | There is not any console devices connected success | |
EFI_SUCCESS | Success connect any one instance of the console device path base on the variable ConVarName. |
EFI_STATUS EFIAPI EfiBootManagerConnectDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathToConnect, | |
OUT EFI_HANDLE * | MatchingHandle | |||
) |
This function will create all handles associate with every device path node. If the handle associate with one device path node can not be created successfully, then still give chance to do the dispatch, which load the missing drivers if possible.
DevicePathToConnect | The device path which will be connected, it can be a multi-instance device path | |
MatchingHandle | Return the controller handle closest to the DevicePathToConnect |
EFI_SUCCESS | All handles associate with every device path node have been created. | |
EFI_OUT_OF_RESOURCES | There is no resource to create new handles. | |
EFI_NOT_FOUND | Create the handle associate with one device path node failed. | |
EFI_SECURITY_VIOLATION | The user has no permission to start UEFI device drivers on the DevicePath. |
EFI_STATUS EFIAPI EfiBootManagerConnectVideoController | ( | EFI_HANDLE | VideoController | ) |
Connect the platform active active video controller.
VideoController | PCI handle of video controller. |
EFI_NOT_FOUND | There is no active video controller. | |
EFI_SUCCESS | The video controller is connected. |
EFI_STATUS EFIAPI EfiBootManagerDeleteKeyOptionVariable | ( | IN EFI_BOOT_MANAGER_KEY_OPTION * | DeletedOption, | |
IN UINT32 | Modifier, | |||
... | ||||
) |
Delete the Key Option variable and unregister the hot key
DeletedOption | Return the deleted key options. | |
Modifier | Key shift state. | |
... | Parameter list of pointer of EFI_INPUT_KEY. |
EFI_SUCCESS | The key option is deleted. | |
EFI_NOT_FOUND | The key option cannot be found. |
EFI_STATUS EFIAPI EfiBootManagerDeleteLoadOptionVariable | ( | IN UINTN | OptionNumber, | |
IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE | OptionType | |||
) |
Delete the load option according to the OptionNumber and OptionType.
Only the BootOrder/DriverOrder is updated to remove the reference of the OptionNumber.
OptionNumber | Option number of the load option. | |
OptionType | Type of the load option. |
EFI_NOT_FOUND | The load option cannot be found. | |
EFI_SUCCESS | The load option was deleted. |
VOID EFIAPI EfiBootManagerDisconnectAll | ( | VOID | ) |
This function will disconnect all current system handles.
gBS->DisconnectController() is invoked for each handle exists in system handle buffer. If handle is a bus type handle, all childrens also are disconnected recursively by gBS->DisconnectController().
EFI_STATUS EFIAPI EfiBootManagerFreeDriverHealthInfo | ( | EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO * | DriverHealthInfo, | |
UINTN | Count | |||
) |
Free the Driver Health information array.
DriverHealthInfo | Pointer to array of the Driver Health information. | |
Count | Count of the array. |
EFI_SUCCESS | The array is freed. | |
EFI_INVALID_PARAMETER | The array is NULL. |
EFI_STATUS EFIAPI EfiBootManagerFreeLoadOption | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | LoadOption | ) |
Free a load option created by EfiBootManagerInitializeLoadOption() or EfiBootManagerVariableToLoadOption().
LoadOption | Pointer to the load option to free. CONCERN: Check Boot#### instead of BootOrder, optimize, spec clarify |
EFI_INVALID_PARAMETER LoadOption is NULL.
EFI_STATUS EFIAPI EfiBootManagerFreeLoadOptions | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | LoadOptions, | |
IN UINTN | LoadOptionCount | |||
) |
Free an array of load options returned from EfiBootManagerGetLoadOptions().
LoadOptions | Pointer to the array of load options to free. | |
LoadOptionCount | Number of array entries in LoadOptions. |
EFI_INVALID_PARAMETER LoadOptions is NULL.
EFI_STATUS EFIAPI EfiBootManagerGetBootManagerMenu | ( | EFI_BOOT_MANAGER_LOAD_OPTION * | BootOption | ) |
Return the Boot Manager Menu.
BootOption | Return the Boot Manager Menu. |
EFI_SUCCESS | The Boot Manager Menu is successfully returned. | |
EFI_NOT_FOUND | The Boot Manager Menu is not found. |
EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO* EFIAPI EfiBootManagerGetDriverHealthInfo | ( | UINTN * | Count | ) |
Return all the Driver Health information.
When the cumulative health status of all the controllers managed by the driver who produces the EFI_DRIVER_HEALTH_PROTOCOL is healthy, only one EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO entry is created for such EFI_DRIVER_HEALTH_PROTOCOL instance. Otherwise, every controller creates one EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO entry. Additionally every child controller creates one EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO entry if the driver is a bus driver.
Count | Return the count of the Driver Health information. |
NULL | No Driver Health information is returned. | |
!NULL | Pointer to the Driver Health information array. |
EFI_DEVICE_PATH_PROTOCOL* EFIAPI EfiBootManagerGetGopDevicePath | ( | IN EFI_HANDLE | VideoController | ) |
Query all the children of VideoController and return the device paths of all the children that support GraphicsOutput protocol.
VideoController | PCI handle of video controller. |
EFI_BOOT_MANAGER_LOAD_OPTION* EFIAPI EfiBootManagerGetLoadOptions | ( | OUT UINTN * | LoadOptionCount, | |
IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE | LoadOptionType | |||
) |
Returns an array of load options based on the EFI variable L"BootOrder"/L"DriverOrder" and the L"Boot####"/L"Driver####" variables impled by it. #### is the hex value of the UINT16 in each BootOrder/DriverOrder entry.
LoadOptionCount | Returns number of entries in the array. | |
LoadOptionType | The type of the load option. |
NULL | No load options exist. | |
!NULL | Array of load option entries. |
VOID EFIAPI EfiBootManagerHotkeyBoot | ( | VOID | ) |
Try to boot the boot option triggered by hot key.
EFI_STATUS EFIAPI EfiBootManagerInitializeLoadOption | ( | IN OUT EFI_BOOT_MANAGER_LOAD_OPTION * | Option, | |
IN UINTN | OptionNumber, | |||
IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE | OptionType, | |||
IN UINT32 | Attributes, | |||
IN CHAR16 * | Description, | |||
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, | |||
IN UINT8 * | OptionalData, | |||
IN UINT32 | OptionalDataSize | |||
) |
Initialize a load option.
Option | Pointer to the load option to be initialized. | |
OptionNumber | Option number of the load option. | |
OptionType | Type of the load option. | |
Attributes | Attributes of the load option. | |
Description | Description of the load option. | |
FilePath | Device path of the load option. | |
OptionalData | Optional data of the load option. | |
OptionalDataSize | Size of the optional data of the load option. |
EFI_SUCCESS | The load option was initialized successfully. | |
EFI_INVALID_PARAMETER | Option, Description or FilePath is NULL. |
EFI_STATUS EFIAPI EfiBootManagerLoadOptionToVariable | ( | IN CONST EFI_BOOT_MANAGER_LOAD_OPTION * | LoadOption | ) |
Create the Boot#### or Driver#### variable from the load option.
LoadOption | Pointer to the load option. |
EFI_SUCCESS | The variable was created. | |
Others | Error status returned by RT->SetVariable. |
EFI_STATUS EFIAPI EfiBootManagerProcessLoadOption | ( | EFI_BOOT_MANAGER_LOAD_OPTION * | LoadOption | ) |
Process (load and execute) the load option.
LoadOption | Pointer to the load option. |
EFI_INVALID_PARAMETER | The load option type is invalid, or the load option file path doesn't point to a valid file. | |
EFI_UNSUPPORTED | The load option type is of LoadOptionTypeBoot. | |
EFI_SUCCESS | The load option is inactive, or successfully loaded and executed. |
VOID EFIAPI EfiBootManagerRefreshAllBootOption | ( | VOID | ) |
The function creates boot options for all possible bootable medias in the following order: 1. Removable BlockIo - The boot option only points to the removable media device, like USB key, DVD, Floppy etc. 2. Fixed BlockIo - The boot option only points to a Fixed blockIo device, like HardDisk. 3. Non-BlockIo SimpleFileSystem - The boot option points to a device supporting SimpleFileSystem Protocol, but not supporting BlockIo protocol. 4. LoadFile - The boot option points to the media supporting LoadFile protocol. Reference: UEFI Spec chapter 3.3 Boot Option Variables Default Boot Behavior
The function won't delete the boot option not added by itself.
EFI_STATUS EFIAPI EfiBootManagerRegisterBootDescriptionHandler | ( | IN EFI_BOOT_MANAGER_BOOT_DESCRIPTION_HANDLER | Handler | ) |
Register the platform provided boot description handler.
Handler | The platform provided boot description handler |
EFI_SUCCESS | The handler was registered successfully. | |
EFI_ALREADY_STARTED | The handler was already registered. | |
EFI_OUT_OF_RESOURCES | There is not enough resource to perform the registration. |
EFI_STATUS EFIAPI EfiBootManagerRegisterContinueKeyOption | ( | IN UINT32 | Modifier, | |
... | ||||
) |
Register the key option to exit the waiting of the Boot Manager timeout. Platform should ensure that the continue key option isn't conflict with other boot key options.
Modifier | Key shift state. | |
... | Parameter list of pointer of EFI_INPUT_KEY. |
EFI_SUCCESS | Successfully register the continue key option. | |
EFI_ALREADY_STARTED | The continue key option is already registered. |
VOID EFIAPI EfiBootManagerRegisterLegacyBootSupport | ( | EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION | RefreshLegacyBootOption, | |
EFI_BOOT_MANAGER_LEGACY_BOOT | LegacyBoot | |||
) |
The function registers the legacy boot support capabilities.
RefreshLegacyBootOption | The function pointer to create all the legacy boot options. | |
LegacyBoot | The function pointer to boot the legacy boot option. |
VOID EFIAPI EfiBootManagerSortLoadOptionVariable | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE | OptionType, | |
IN SORT_COMPARE | CompareFunction | |||
) |
Sort the load options. The DriverOrder/BootOrder variables will be re-created to reflect the new order.
OptionType | The type of the load option. | |
CompareFunction | The comparator function pointer. |
EFI_STATUS EFIAPI EfiBootManagerStartHotkeyService | ( | IN EFI_EVENT * | HotkeyTriggered | ) |
Start the hot key service so that the key press can trigger the boot option.
HotkeyTriggered | Return the waitable event and it will be signaled when a valid hot key is pressed. |
EFI_SUCCESS | The hot key service is started. |
EFI_STATUS EFIAPI EfiBootManagerUpdateConsoleVariable | ( | IN CONSOLE_TYPE | ConsoleType, | |
IN EFI_DEVICE_PATH_PROTOCOL * | CustomizedConDevicePath, | |||
IN EFI_DEVICE_PATH_PROTOCOL * | ExclusiveDevicePath | |||
) |
This function updates the console variable based on ConVarName. It can add or remove one specific console device path from the variable
ConsoleType | ConIn, ConOut, ErrOut, ConInDev, ConOutDev or ErrOutDev. | |
CustomizedConDevicePath | The console device path to be added to the console variable. Cannot be multi-instance. | |
ExclusiveDevicePath | The console device path to be removed from the console variable. Cannot be multi-instance. |
EFI_UNSUPPORTED | The added device path is the same as a removed one. | |
EFI_SUCCESS | Successfully added or removed the device path from the console variable. |
EFI_STATUS EFIAPI EfiBootManagerVariableToLoadOption | ( | IN CHAR16 * | VariableName, | |
IN OUT EFI_BOOT_MANAGER_LOAD_OPTION * | LoadOption | |||
) |
Initialize the load option from the VariableName.
VariableName | EFI Variable name which could be Boot#### or Driver#### | |
LoadOption | Pointer to the load option to be initialized |
EFI_SUCCESS | The option was created | |
EFI_INVALID_PARAMETER | VariableName or LoadOption is NULL. | |
EFI_NOT_FOUND | The variable specified by VariableName cannot be found. |
typedef VOID | ( | EFIAPI * | EBC_DEBUGGER_DEBUG | ) |
The function enumerates all the legacy boot options, creates them and registers them in the BootOrder variable.
The function boots a legacy boot option.
The prototype is called back when an IP packet is received.
[in] | Status | The result of the receive request. |
[in] | IcmpErr | Valid when Status is EFI_ICMP_ERROR. |
[in] | NetSession | The IP session for the received packet. |
[in] | Pkt | The packet received. |
[in] | Context | The data provided by the user for the received packet when the callback is registered in IP_IO_OPEN_DATA::RcvdContext. |
[in] | Status | Result of the IP packet being sent. |
[in] | Context | The data provided by user for the received packet when the callback is registered in IP_IO_OPEN_DATA::SndContext. |
[in] | Sender | A Union type to specify a pointer of EFI_IP4_PROTOCOL or EFI_IP6_PROTOCOL. |
[in] | NotifyData | The Context data specified when calling IpIoSend() |
Register Exit handler function. When more than one handler function is registered, the latter one will override the previous one. When NULL handler is specified, the previous Exit handler will be unregistered.
[in] | Handler | Pointer to handler function. |
This prototype is used by both receive and sending when calling UdpIoRecvDatagram() or UdpIoSendDatagram(). When receiving, Netbuf is allocated by the UDP access point and released by the user. When sending, the user allocates the the NetBuf, which is then provided to the callback as a reference.
[in] | Packet | The packet received or sent. |
[in] | EndPoint | The UDP address pair corresponds to the UDP IO. |
[in] | IoStatus | The packet receiving or sending status. |
[in] | Context | The user-defined data when calling UdpIoRecvDatagram() or UdpIoSendDatagram(). |
[in] | This | A pointer to the EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL structure. |
[in] | VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | No support for it. | |
EFI_SUCCESS | Debug one or more instructions. |