TianoCore EDK2 master
|
#include "InternalBm.h"
Go to the source code of this file.
Library functions which relates with booting.
Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file BmBoot.c.
EFI_DEVICE_PATH_PROTOCOL * BmAdjustFvFilePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath | ) |
VOID BmCachePartitionDevicePath | ( | IN OUT EFI_DEVICE_PATH_PROTOCOL ** | CachedDevicePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ||
) |
VOID BmDestroyRamDisk | ( | IN EFI_DEVICE_PATH_PROTOCOL * | RamDiskDevicePath | ) |
EFI_BOOT_MANAGER_LOAD_OPTION * BmEnumerateBootOptions | ( | UINTN * | BootOptionCount | ) |
Emuerate all possible bootable medias in the following order:
BootOptionCount | Return the boot option count which has been found. |
Pointer | to the boot option array. |
EFI_DEVICE_PATH_PROTOCOL * BmExpandFileDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | FullPath | ||
) |
Expand File-path device path node to be full device path in platform.
FilePath | The device path pointing to a load option. It could be a short-form device path. |
FullPath | The full path returned by the routine in last call. Set to NULL in first call. |
EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFile | ( | IN EFI_HANDLE | LoadFileHandle, |
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath | ||
) |
EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFiles | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath | ) |
Return the full device path pointing to the load option.
FilePath may:
FilePath | The media device path pointing to a LoadFile instance. |
EFI_DEVICE_PATH_PROTOCOL * BmExpandMediaDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | FullPath | ||
) |
Expand the media device path which points to a BlockIo or SimpleFileSystem instance by appending EFI_REMOVABLE_MEDIA_FILE_NAME.
DevicePath | The media device path pointing to a BlockIo or SimpleFileSystem instance. |
FullPath | The full path returned by the routine in last call. Set to NULL in first call. |
EFI_DEVICE_PATH_PROTOCOL * BmExpandNetworkFileSystem | ( | IN EFI_HANDLE | LoadFileHandle, |
OUT EFI_HANDLE * | RamDiskHandle | ||
) |
Get the file buffer from the file system produced by Load File instance.
LoadFileHandle | The handle of LoadFile instance. |
RamDiskHandle | Return the RAM Disk handle. |
EFI_DEVICE_PATH_PROTOCOL * BmExpandPartitionDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath | ) |
Expand a device path that starts with a hard drive media device path node to be a full device path that includes the full hardware path to the device. We need to do this so it can be booted. As an optimization the front match (the part point to the partition node. E.g. ACPI() /PCI()/ATA()/Partition() ) is saved in a variable so a connect all is not required on every boot. All successful history device path which point to partition node (the front part) will be saved.
FilePath | The device path pointing to a load option. It could be a short-form device path. |
EFI_DEVICE_PATH_PROTOCOL * BmExpandUriDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | FullPath | ||
) |
Expand URI device path node to be full device path in platform.
FilePath | The device path pointing to a load option. It could be a short-form device path. |
FullPath | The full path returned by the routine in last call. Set to NULL in first call. |
EFI_DEVICE_PATH_PROTOCOL * BmExpandUsbDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | FullPath, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | ShortformNode | ||
) |
Expand USB Class or USB WWID device path node to be full device path of a USB device in platform.
This function support following 4 cases: 1) Boot Option device path starts with a USB Class or USB WWID device path, and there is no Media FilePath device path in the end. In this case, it will follow Removable Media Boot Behavior. 2) Boot Option device path starts with a USB Class or USB WWID device path, and ended with Media FilePath device path. 3) Boot Option device path starts with a full device path to a USB Host Controller, contains a USB Class or USB WWID device path node, while not ended with Media FilePath device path. In this case, it will follow Removable Media Boot Behavior. 4) Boot Option device path starts with a full device path to a USB Host Controller, contains a USB Class or USB WWID device path node, and ended with Media FilePath device path.
FilePath | The device path pointing to a load option. It could be a short-form device path. |
FullPath | The full path returned by the routine in last call. Set to NULL in first call. |
ShortformNode | Pointer to the USB short-form device path node in the FilePath buffer. |
UINTN BmFindBootOptionInVariable | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | OptionToFind | ) |
EFI_HANDLE * BmFindUsbDevice | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
IN UINTN | ParentDevicePathSize, | ||
OUT UINTN * | UsbIoHandleCount | ||
) |
Find a USB device which match the specified short-form device path start with USB Class or USB WWID device path. If ParentDevicePath is NULL, this function will search in all USB devices of the platform. If ParentDevicePath is not NULL, this function will only search in its child devices.
DevicePath | The device path that contains USB Class or USB WWID device path. |
ParentDevicePathSize | The length of the device path before the USB Class or USB WWID device path. |
UsbIoHandleCount | A pointer to the count of the returned USB IO handles. |
NULL | The matched USB IO handles cannot be found. |
other | The matched USB IO handles. |
EFI_DEVICE_PATH_PROTOCOL * BmGetNextLoadOptionDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | FullPath | ||
) |
Get the next possible full path pointing to the load option. The routine doesn't guarantee the returned full path points to an existing file, and it also doesn't guarantee the existing file is a valid load option. BmGetNextLoadOptionBuffer() guarantees.
FilePath | The device path pointing to a load option. It could be a short-form device path. |
FullPath | The full path returned by the routine in last call. Set to NULL in first call. |
EFI_DEVICE_PATH_PROTOCOL * BmGetRamDiskDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath | ) |
VOID * BmGetRamDiskMemoryInfo | ( | IN EFI_DEVICE_PATH_PROTOCOL * | RamDiskDevicePath, |
OUT UINTN * | RamDiskSizeInPages | ||
) |
BOOLEAN BmIsAutoCreateBootOption | ( | EFI_BOOT_MANAGER_LOAD_OPTION * | BootOption | ) |
BOOLEAN BmIsBootManagerMenuFilePath | ( | EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
BOOLEAN BmIsFvFilePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
Check if it's a Device Path pointing to FV file.
The function doesn't garentee the device path points to existing FV file.
DevicePath | Input device path. |
TRUE | The device path is a FV File Device Path. |
FALSE | The device path is NOT a FV File Device Path. |
BOOLEAN BmMatchHttpBootDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | Left, |
IN EFI_DEVICE_PATH_PROTOCOL * | Right | ||
) |
BOOLEAN BmMatchPartitionDevicePathNode | ( | IN EFI_DEVICE_PATH_PROTOCOL * | BlockIoDevicePath, |
IN HARDDRIVE_DEVICE_PATH * | HardDriveDevicePath | ||
) |
Check whether there is a instance in BlockIoDevicePath, which contain multi device path instances, has the same partition node with HardDriveDevicePath device path
BlockIoDevicePath | Multi device path instances which need to check |
HardDriveDevicePath | A device path which starts with a hard drive media device path. |
TRUE | There is a matched device path instance. |
FALSE | There is no matched device path instance. |
BOOLEAN BmMatchUsbClass | ( | IN EFI_USB_IO_PROTOCOL * | UsbIo, |
IN USB_CLASS_DEVICE_PATH * | UsbClass | ||
) |
Check whether a USB device match the specified USB Class device path. This function follows "Load Option Processing" behavior in UEFI specification.
UsbIo | USB I/O protocol associated with the USB device. |
UsbClass | The USB Class device path to match. |
TRUE | The USB device match the USB Class device path. |
FALSE | The USB device does not match the USB Class device path. |
BOOLEAN BmMatchUsbWwid | ( | IN EFI_USB_IO_PROTOCOL * | UsbIo, |
IN USB_WWID_DEVICE_PATH * | UsbWwid | ||
) |
Check whether a USB device match the specified USB WWID device path. This function follows "Load Option Processing" behavior in UEFI specification.
UsbIo | USB I/O protocol associated with the USB device. |
UsbWwid | The USB WWID device path to match. |
TRUE | The USB device match the USB WWID device path. |
FALSE | The USB device does not match the USB WWID device path. |
EFI_STATUS BmRegisterBootManagerMenu | ( | OUT EFI_BOOT_MANAGER_LOAD_OPTION * | BootOption | ) |
This function is called to get or create the boot option for the Boot Manager Menu.
The Boot Manager Menu is shown after successfully booting a boot option. This function will first try to search the BootManagerMenuFile is in the same FV as the module links to this library. If fails, it will search in all FVs.
BootOption | Return the boot option of the Boot Manager Menu |
EFI_SUCCESS | Successfully register the Boot Manager Menu. |
EFI_NOT_FOUND | The Boot Manager Menu cannot be found. |
others | Return status of gRT->SetVariable (). BootOption still points to the Boot Manager Menu even the Status is not EFI_SUCCESS and EFI_NOT_FOUND. |
VOID BmReportLoadFailure | ( | IN UINT32 | ErrorCode, |
IN EFI_STATUS | FailureStatus | ||
) |
Report status code with EFI_RETURN_STATUS_EXTENDED_DATA about LoadImage() or StartImage() failure.
[in] | ErrorCode | An Error Code in the Software Class, DXE Boot Service Driver Subclass. ErrorCode will be used to compose the Value parameter for status code reporting. Must be one of EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR and EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED. |
[in] | FailureStatus | The failure status returned by the boot service that should be reported. |
VOID EFIAPI EfiBootManagerBoot | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | BootOption | ) |
Attempt to boot the EFI boot option. This routine sets L"BootCurent" and also 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 via the registered gLegacyBoot function. 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\BOOTIA32.EFI, \EFI\BOOTX64.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 A BBS device path was found with no valid callback registered via EfiBootManagerInitialize(). EFI_NOT_FOUND The BootOption was not found on the system !EFI_SUCCESS BootOption failed with this error status |
EFI_STATUS EFIAPI EfiBootManagerGetBootManagerMenu | ( | EFI_BOOT_MANAGER_LOAD_OPTION * | BootOption | ) |
Return the boot option corresponding to the Boot Manager Menu. It may automatically create one if the boot option hasn't been created yet.
BootOption | Return the Boot Manager Menu. |
EFI_SUCCESS | The Boot Manager Menu is successfully returned. |
EFI_NOT_FOUND | The Boot Manager Menu cannot be found. |
others | Return status of gRT->SetVariable (). BootOption still points to the Boot Manager Menu even the Status is not EFI_SUCCESS and EFI_NOT_FOUND. |
VOID *EFIAPI EfiBootManagerGetLoadOptionBuffer | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, |
OUT EFI_DEVICE_PATH_PROTOCOL ** | FullPath, | ||
OUT UINTN * | FileSize | ||
) |
Get the load option by its device path.
FilePath | The device path pointing to a load option. It could be a short-form device path. |
FullPath | Return the full device path of the load option after short-form device path expanding. Caller is responsible to free it. |
FileSize | Return the load option size. |
EFI_DEVICE_PATH_PROTOCOL *EFIAPI EfiBootManagerGetNextLoadOptionDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, |
IN EFI_DEVICE_PATH_PROTOCOL * | FullPath | ||
) |
Get the next possible full path pointing to the load option. The routine doesn't guarantee the returned full path points to an existing file, and it also doesn't guarantee the existing file is a valid load option. BmGetNextLoadOptionBuffer() guarantees.
FilePath | The device path pointing to a load option. It could be a short-form device path. |
FullPath | The full path returned by the routine in last call. Set to NULL in first call. |
VOID EFIAPI EfiBootManagerRefreshAllBootOption | ( | VOID | ) |
VOID EFIAPI EfiBootManagerRegisterLegacyBootSupport | ( | EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION | RefreshLegacyBootOption, |
EFI_BOOT_MANAGER_LEGACY_BOOT | LegacyBoot | ||
) |
EFI_GUID mBmAutoCreateBootOptionGuid |
EFI_GUID mBmHardDriveBootVariableGuid |
EFI_BOOT_MANAGER_LEGACY_BOOT mBmLegacyBoot = NULL |
EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION mBmRefreshLegacyBootOption = NULL |
EFI_RAM_DISK_PROTOCOL* mRamDisk = NULL |