TianoCore EDK2 master
Loading...
Searching...
No Matches
BmBoot.c File Reference
#include "InternalBm.h"

Go to the source code of this file.

Functions

VOID EFIAPI BmEndOfBdsPerfCode (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI EfiBootManagerRegisterLegacyBootSupport (EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION RefreshLegacyBootOption, EFI_BOOT_MANAGER_LEGACY_BOOT LegacyBoot)
 
BOOLEAN BmIsAutoCreateBootOption (EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
 
UINTN BmFindBootOptionInVariable (IN EFI_BOOT_MANAGER_LOAD_OPTION *OptionToFind)
 
EFI_DEVICE_PATH_PROTOCOLBmAdjustFvFilePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
BOOLEAN BmIsFvFilePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
BOOLEAN BmMatchUsbClass (IN EFI_USB_IO_PROTOCOL *UsbIo, IN USB_CLASS_DEVICE_PATH *UsbClass)
 
BOOLEAN BmMatchUsbWwid (IN EFI_USB_IO_PROTOCOL *UsbIo, IN USB_WWID_DEVICE_PATH *UsbWwid)
 
EFI_HANDLEBmFindUsbDevice (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINTN ParentDevicePathSize, OUT UINTN *UsbIoHandleCount)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandUsbDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath, IN EFI_DEVICE_PATH_PROTOCOL *ShortformNode)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandFileDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandUriDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
 
VOID BmCachePartitionDevicePath (IN OUT EFI_DEVICE_PATH_PROTOCOL **CachedDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandPartitionDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandMediaDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
 
BOOLEAN BmMatchHttpBootDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *Left, IN EFI_DEVICE_PATH_PROTOCOL *Right)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandNetworkFileSystem (IN EFI_HANDLE LoadFileHandle, OUT EFI_HANDLE *RamDiskHandle)
 
EFI_DEVICE_PATH_PROTOCOLBmGetRamDiskDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
VOID * BmGetRamDiskMemoryInfo (IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath, OUT UINTN *RamDiskSizeInPages)
 
VOID BmDestroyRamDisk (IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandLoadFile (IN EFI_HANDLE LoadFileHandle, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
EFI_DEVICE_PATH_PROTOCOLBmExpandLoadFiles (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
VOID *EFIAPI EfiBootManagerGetLoadOptionBuffer (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT UINTN *FileSize)
 
EFI_DEVICE_PATH_PROTOCOLBmGetNextLoadOptionDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
 
BOOLEAN BmIsBootManagerMenuFilePath (EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
VOID BmReportLoadFailure (IN UINT32 ErrorCode, IN EFI_STATUS FailureStatus)
 
VOID EFIAPI EfiBootManagerBoot (IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
 
BOOLEAN BmMatchPartitionDevicePathNode (IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath, IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath)
 
EFI_BOOT_MANAGER_LOAD_OPTIONBmEnumerateBootOptions (UINTN *BootOptionCount)
 
VOID EFIAPI EfiBootManagerRefreshAllBootOption (VOID)
 
EFI_STATUS BmRegisterBootManagerMenu (OUT EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
 
EFI_STATUS EFIAPI EfiBootManagerGetBootManagerMenu (EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
 
EFI_DEVICE_PATH_PROTOCOL *EFIAPI EfiBootManagerGetNextLoadOptionDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
 

Variables

EFI_RAM_DISK_PROTOCOLmRamDisk = NULL
 
EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION mBmRefreshLegacyBootOption = NULL
 
EFI_BOOT_MANAGER_LEGACY_BOOT mBmLegacyBoot = NULL
 
EFI_GUID mBmHardDriveBootVariableGuid
 
EFI_GUID mBmAutoCreateBootOptionGuid
 

Detailed Description

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.

Function Documentation

◆ BmAdjustFvFilePath()

EFI_DEVICE_PATH_PROTOCOL * BmAdjustFvFilePath ( IN EFI_DEVICE_PATH_PROTOCOL FilePath)

Return the correct FV file path. FV address may change across reboot. This routine promises the FV file device path is right.

Parameters
FilePathThe Memory Mapped Device Path to get the file buffer.
Returns
The updated FV Device Path pointint to the file.

Definition at line 176 of file BmBoot.c.

◆ BmCachePartitionDevicePath()

VOID BmCachePartitionDevicePath ( IN OUT EFI_DEVICE_PATH_PROTOCOL **  CachedDevicePath,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath 
)

Save the partition DevicePath to the CachedDevicePath as the first instance.

Parameters
CachedDevicePathThe device path cache.
DevicePathThe partition device path to be cached.

Definition at line 807 of file BmBoot.c.

◆ BmDestroyRamDisk()

VOID BmDestroyRamDisk ( IN EFI_DEVICE_PATH_PROTOCOL RamDiskDevicePath)

Destroy the RAM Disk.

The destroy operation includes to call RamDisk.Unregister to unregister the RAM DISK from RAM DISK driver, free the memory allocated for the RAM Disk.

Parameters
RamDiskDevicePathRAM Disk device path.

Definition at line 1385 of file BmBoot.c.

◆ BmEndOfBdsPerfCode()

VOID EFIAPI BmEndOfBdsPerfCode ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

End Perf entry of BDS

Parameters
EventThe triggered event.
ContextContext for this event.

Definition at line 39 of file BmBoot.c.

◆ BmEnumerateBootOptions()

EFI_BOOT_MANAGER_LOAD_OPTION * BmEnumerateBootOptions ( UINTN BootOptionCount)

Emuerate 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
Parameters
BootOptionCountReturn the boot option count which has been found.
Return values
Pointerto the boot option array.

Definition at line 2195 of file BmBoot.c.

◆ BmExpandFileDevicePath()

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.

Parameters
FilePathThe device path pointing to a load option. It could be a short-form device path.
FullPathThe full path returned by the routine in last call. Set to NULL in first call.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 672 of file BmBoot.c.

◆ BmExpandLoadFile()

EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFile ( IN EFI_HANDLE  LoadFileHandle,
IN EFI_DEVICE_PATH_PROTOCOL FilePath 
)

Get the file buffer from the specified Load File instance.

Parameters
LoadFileHandleThe specified Load File instance.
FilePathThe file path which will pass to LoadFile().
Returns
The full device path pointing to the load option buffer.

Definition at line 1419 of file BmBoot.c.

◆ BmExpandLoadFiles()

EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFiles ( IN EFI_DEVICE_PATH_PROTOCOL FilePath)

Return the full device path pointing to the load option.

FilePath may:

  1. Exactly matches to a LoadFile instance.
  2. Cannot match to any LoadFile instance. Wide match is required. In either case, the routine may return:
  1. A copy of FilePath when FilePath matches to a LoadFile instance and the LoadFile returns a load option buffer.
  2. A new device path with IP and URI information updated when wide match happens.
  3. A new device path pointing to a load option in RAM disk. In either case, only one full device path is returned for a specified FilePath.
Parameters
FilePathThe media device path pointing to a LoadFile instance.
Returns
The load option buffer.

Definition at line 1534 of file BmBoot.c.

◆ BmExpandMediaDevicePath()

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.

Parameters
DevicePathThe media device path pointing to a BlockIo or SimpleFileSystem instance.
FullPathThe full path returned by the routine in last call. Set to NULL in first call.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 1072 of file BmBoot.c.

◆ BmExpandNetworkFileSystem()

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.

Parameters
LoadFileHandleThe handle of LoadFile instance.
RamDiskHandleReturn the RAM Disk handle.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 1239 of file BmBoot.c.

◆ BmExpandPartitionDevicePath()

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.

Parameters
FilePathThe device path pointing to a load option. It could be a short-form device path.
Returns
The full device path pointing to the load option.

Definition at line 872 of file BmBoot.c.

◆ BmExpandUriDevicePath()

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.

Parameters
FilePathThe device path pointing to a load option. It could be a short-form device path.
FullPathThe full path returned by the routine in last call. Set to NULL in first call.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 746 of file BmBoot.c.

◆ BmExpandUsbDevicePath()

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.

Parameters
FilePathThe device path pointing to a load option. It could be a short-form device path.
FullPathThe full path returned by the routine in last call. Set to NULL in first call.
ShortformNodePointer to the USB short-form device path node in the FilePath buffer.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 606 of file BmBoot.c.

◆ BmFindBootOptionInVariable()

UINTN BmFindBootOptionInVariable ( IN EFI_BOOT_MANAGER_LOAD_OPTION OptionToFind)

Find the boot option in the NV storage and return the option number.

Parameters
OptionToFindBoot option to be checked.
Returns
The option number of the found boot option.

Definition at line 101 of file BmBoot.c.

◆ BmFindUsbDevice()

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.

Parameters
DevicePathThe device path that contains USB Class or USB WWID device path.
ParentDevicePathSizeThe length of the device path before the USB Class or USB WWID device path.
UsbIoHandleCountA pointer to the count of the returned USB IO handles.
Return values
NULLThe matched USB IO handles cannot be found.
otherThe matched USB IO handles.

Definition at line 514 of file BmBoot.c.

◆ BmGetNextLoadOptionDevicePath()

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.

Parameters
FilePathThe device path pointing to a load option. It could be a short-form device path.
FullPathThe full path returned by the routine in last call. Set to NULL in first call.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 1634 of file BmBoot.c.

◆ BmGetRamDiskDevicePath()

EFI_DEVICE_PATH_PROTOCOL * BmGetRamDiskDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL FilePath)

Return the RAM Disk device path created by LoadFile.

Parameters
FilePathThe source file path.
Returns
Callee-to-free RAM Disk device path

Definition at line 1308 of file BmBoot.c.

◆ BmGetRamDiskMemoryInfo()

VOID * BmGetRamDiskMemoryInfo ( IN EFI_DEVICE_PATH_PROTOCOL RamDiskDevicePath,
OUT UINTN RamDiskSizeInPages 
)

Return the buffer and buffer size occupied by the RAM Disk.

Parameters
RamDiskDevicePathRAM Disk device path.
RamDiskSizeInPagesReturn RAM Disk size in pages.
Return values
RAMDisk buffer.

Definition at line 1346 of file BmBoot.c.

◆ BmIsAutoCreateBootOption()

BOOLEAN BmIsAutoCreateBootOption ( EFI_BOOT_MANAGER_LOAD_OPTION BootOption)

Return TRUE when the boot option is auto-created instead of manually added.

Parameters
BootOptionPointer to the boot option to check.
Return values
TRUEThe boot option is auto-created.
FALSEThe boot option is manually added.

Definition at line 78 of file BmBoot.c.

◆ BmIsBootManagerMenuFilePath()

BOOLEAN BmIsBootManagerMenuFilePath ( EFI_DEVICE_PATH_PROTOCOL DevicePath)

Check if it's a Device Path pointing to BootManagerMenu.

Parameters
DevicePathInput device path.
Return values
TRUEThe device path is BootManagerMenu File Device Path.
FALSEThe device path is NOT BootManagerMenu File Device Path.

Definition at line 1760 of file BmBoot.c.

◆ BmIsFvFilePath()

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.

Parameters
DevicePathInput device path.
Return values
TRUEThe device path is a FV File Device Path.
FALSEThe device path is NOT a FV File Device Path.

Definition at line 267 of file BmBoot.c.

◆ BmMatchHttpBootDevicePath()

BOOLEAN BmMatchHttpBootDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL Left,
IN EFI_DEVICE_PATH_PROTOCOL Right 
)

Check whether Left and Right are the same without matching the specific device path data in IP device path and URI device path node.

Return values
TRUELeft and Right are the same.
FALSELeft and Right are the different.

Definition at line 1194 of file BmBoot.c.

◆ BmMatchPartitionDevicePathNode()

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

Parameters
BlockIoDevicePathMulti device path instances which need to check
HardDriveDevicePathA device path which starts with a hard drive media device path.
Return values
TRUEThere is a matched device path instance.
FALSEThere is no matched device path instance.

Definition at line 2134 of file BmBoot.c.

◆ BmMatchUsbClass()

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.

Parameters
UsbIoUSB I/O protocol associated with the USB device.
UsbClassThe USB Class device path to match.
Return values
TRUEThe USB device match the USB Class device path.
FALSEThe USB device does not match the USB Class device path.

Definition at line 303 of file BmBoot.c.

◆ BmMatchUsbWwid()

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.

Parameters
UsbIoUSB I/O protocol associated with the USB device.
UsbWwidThe USB WWID device path to match.
Return values
TRUEThe USB device match the USB WWID device path.
FALSEThe USB device does not match the USB WWID device path.

Definition at line 395 of file BmBoot.c.

◆ BmRegisterBootManagerMenu()

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.

Parameters
BootOptionReturn the boot option of the Boot Manager Menu
Return values
EFI_SUCCESSSuccessfully register the Boot Manager Menu.
EFI_NOT_FOUNDThe Boot Manager Menu cannot be found.
othersReturn status of gRT->SetVariable (). BootOption still points to the Boot Manager Menu even the Status is not EFI_SUCCESS and EFI_NOT_FOUND.

Definition at line 2502 of file BmBoot.c.

◆ BmReportLoadFailure()

VOID BmReportLoadFailure ( IN UINT32  ErrorCode,
IN EFI_STATUS  FailureStatus 
)

Report status code with EFI_RETURN_STATUS_EXTENDED_DATA about LoadImage() or StartImage() failure.

Parameters
[in]ErrorCodeAn 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]FailureStatusThe failure status returned by the boot service that should be reported.

Definition at line 1794 of file BmBoot.c.

◆ EfiBootManagerBoot()

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)

Parameters
BootOptionBoot 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

Definition at line 1846 of file BmBoot.c.

◆ EfiBootManagerGetBootManagerMenu()

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.

Parameters
BootOptionReturn the Boot Manager Menu.
Return values
EFI_SUCCESSThe Boot Manager Menu is successfully returned.
EFI_NOT_FOUNDThe Boot Manager Menu cannot be found.
othersReturn status of gRT->SetVariable (). BootOption still points to the Boot Manager Menu even the Status is not EFI_SUCCESS and EFI_NOT_FOUND.

Definition at line 2608 of file BmBoot.c.

◆ EfiBootManagerGetLoadOptionBuffer()

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.

Parameters
FilePathThe device path pointing to a load option. It could be a short-form device path.
FullPathReturn the full device path of the load option after short-form device path expanding. Caller is responsible to free it.
FileSizeReturn the load option size.
Returns
The load option buffer. Caller is responsible to free the memory.

Definition at line 1607 of file BmBoot.c.

◆ EfiBootManagerGetNextLoadOptionDevicePath()

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.

Parameters
FilePathThe device path pointing to a load option. It could be a short-form device path.
FullPathThe full path returned by the routine in last call. Set to NULL in first call.
Returns
The next possible full path pointing to the load option. Caller is responsible to free the memory.

Definition at line 2664 of file BmBoot.c.

◆ EfiBootManagerRefreshAllBootOption()

VOID EFIAPI EfiBootManagerRefreshAllBootOption ( VOID  )

The function enumerates all boot options, creates them and registers them in the BootOrder variable.

Definition at line 2388 of file BmBoot.c.

◆ EfiBootManagerRegisterLegacyBootSupport()

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.

Parameters
RefreshLegacyBootOptionThe function pointer to create all the legacy boot options.
LegacyBootThe function pointer to boot the legacy boot option.

Definition at line 60 of file BmBoot.c.

Variable Documentation

◆ mBmAutoCreateBootOptionGuid

EFI_GUID mBmAutoCreateBootOptionGuid
Initial value:
= {
0x8108ac4e, 0x9f11, 0x4d59, { 0x85, 0x0e, 0xe2, 0x1a, 0x52, 0x2c, 0x59, 0xb2 }
}

Definition at line 25 of file BmBoot.c.

◆ mBmHardDriveBootVariableGuid

EFI_GUID mBmHardDriveBootVariableGuid
Initial value:
= {
0xfab7e9e1, 0x39dd, 0x4f2b, { 0x84, 0x08, 0xe2, 0x0e, 0x90, 0x6c, 0xb6, 0xde }
}

This GUID is used for an EFI Variable that stores the front device pathes for a partial device path that starts with the HD node.

Definition at line 22 of file BmBoot.c.

◆ mBmLegacyBoot

Definition at line 16 of file BmBoot.c.

◆ mBmRefreshLegacyBootOption

EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION mBmRefreshLegacyBootOption = NULL

Definition at line 15 of file BmBoot.c.

◆ mRamDisk

Definition at line 13 of file BmBoot.c.