23 0xfab7e9e1, 0x39dd, 0x4f2b, { 0x84, 0x08, 0xe2, 0x0e, 0x90, 0x6c, 0xb6, 0xde }
25EFI_GUID mBmAutoCreateBootOptionGuid = {
26 0x8108ac4e, 0x9f11, 0x4d59, { 0x85, 0x0e, 0xe2, 0x1a, 0x52, 0x2c, 0x59, 0xb2 }
65 mBmRefreshLegacyBootOption = RefreshLegacyBootOption;
66 mBmLegacyBoot = LegacyBoot;
82 if ((BootOption->OptionalDataSize == sizeof (
EFI_GUID)) &&
108 CHAR16 OptionName[BM_OPTION_NAME_LEN];
110 UINTN BootOptionCount;
113 OptionNumber = LoadOptionNumberUnassigned;
118 if (OptionToFind->OptionNumber != LoadOptionNumberUnassigned) {
123 mBmLoadOptionName[OptionToFind->OptionType],
124 OptionToFind->OptionNumber
128 if (!EFI_ERROR (Status)) {
129 ASSERT (OptionToFind->OptionNumber == BootOption.OptionNumber);
130 if ((OptionToFind->Attributes == BootOption.Attributes) &&
131 (
StrCmp (OptionToFind->Description, BootOption.Description) == 0) &&
133 (OptionToFind->OptionalDataSize == BootOption.OptionalDataSize) &&
134 (
CompareMem (OptionToFind->OptionalData, BootOption.OptionalData, OptionToFind->OptionalDataSize) == 0)
137 OptionNumber = OptionToFind->OptionNumber;
147 if (OptionNumber == LoadOptionNumberUnassigned) {
151 if ((BootOptions ==
NULL) && (BootOptionCount > 0)) {
152 ASSERT (BootOptions !=
NULL);
153 return LoadOptionNumberUnassigned;
158 OptionNumber = BootOptions[Index].OptionNumber;
193 FvFileNode = FilePath;
194 Status =
gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &FvFileNode, &FvHandle);
195 if (!EFI_ERROR (Status)) {
211 gBS->HandleProtocol (
213 &gEfiLoadedImageProtocolGuid,
214 (VOID **)&LoadedImage
219 if (FullPath !=
NULL) {
226 gBS->LocateHandleBuffer (
228 &gEfiFirmwareVolume2ProtocolGuid,
233 for (Index = 0; Index < FvHandleCount; Index++) {
244 if (FullPath !=
NULL) {
249 if (FvHandles !=
NULL) {
276 Status =
gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &Node, &Handle);
277 if (!EFI_ERROR (Status)) {
312 UINT8 DeviceSubClass;
313 UINT8 DeviceProtocol;
324 Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc);
325 if (EFI_ERROR (Status)) {
329 if ((UsbClass->VendorId != 0xffff) &&
330 (UsbClass->VendorId != DevDesc.IdVendor))
335 if ((UsbClass->ProductId != 0xffff) &&
336 (UsbClass->ProductId != DevDesc.IdProduct))
341 DeviceClass = DevDesc.DeviceClass;
342 DeviceSubClass = DevDesc.DeviceSubClass;
343 DeviceProtocol = DevDesc.DeviceProtocol;
344 if (DeviceClass == 0) {
349 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc);
350 if (EFI_ERROR (Status)) {
354 DeviceClass = IfDesc.InterfaceClass;
355 DeviceSubClass = IfDesc.InterfaceSubClass;
356 DeviceProtocol = IfDesc.InterfaceProtocol;
362 if ((UsbClass->DeviceClass != 0xff) &&
363 (UsbClass->DeviceClass != DeviceClass))
368 if ((UsbClass->DeviceSubClass != 0xff) &&
369 (UsbClass->DeviceSubClass != DeviceSubClass))
374 if ((UsbClass->DeviceProtocol != 0xff) &&
375 (UsbClass->DeviceProtocol != DeviceProtocol))
408 CHAR16 *SerialNumberStr;
420 Status = UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc);
421 if (EFI_ERROR (Status)) {
425 if ((DevDesc.IdVendor != UsbWwid->VendorId) ||
426 (DevDesc.IdProduct != UsbWwid->ProductId))
434 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc);
435 if (EFI_ERROR (Status)) {
439 if (IfDesc.InterfaceNumber != UsbWwid->InterfaceNumber) {
446 if (DevDesc.StrSerialNumber == 0) {
455 Status = UsbIo->UsbGetSupportedLanguages (UsbIo, &LangIdTable, &TableSize);
456 if (EFI_ERROR (Status) || (TableSize == 0) || (LangIdTable ==
NULL)) {
463 CompareStr = (CHAR16 *)(
UINTN)(UsbWwid + 1);
465 if (CompareStr[CompareLen - 1] == L
'\0') {
472 for (Index = 0; Index < TableSize /
sizeof (UINT16); Index++) {
473 SerialNumberStr =
NULL;
474 Status = UsbIo->UsbGetStringDescriptor (
477 DevDesc.StrSerialNumber,
480 if (EFI_ERROR (Status) || (SerialNumberStr ==
NULL)) {
484 Length =
StrLen (SerialNumberStr);
485 if ((Length >= CompareLen) &&
486 (
CompareMem (SerialNumberStr + Length - CompareLen, CompareStr, CompareLen *
sizeof (CHAR16)) == 0))
527 ASSERT (UsbIoHandleCount !=
NULL);
532 Status =
gBS->LocateHandleBuffer (
534 &gEfiUsbIoProtocolGuid,
539 if (EFI_ERROR (Status)) {
540 *UsbIoHandleCount = 0;
544 for (Index = 0; Index < *UsbIoHandleCount; ) {
548 Status =
gBS->HandleProtocol (
550 &gEfiUsbIoProtocolGuid,
555 if (!EFI_ERROR (Status) && (UsbIoDevicePath !=
NULL)) {
559 if (
CompareMem (UsbIoDevicePath, DevicePath, ParentDevicePathSize) == 0) {
569 (*UsbIoHandleCount)--;
570 CopyMem (&UsbIoHandles[Index], &UsbIoHandles[Index + 1], (*UsbIoHandleCount - Index) *
sizeof (
EFI_HANDLE));
612 UINTN ParentDevicePathSize;
621 GetNext = (BOOLEAN)(FullPath ==
NULL);
622 ParentDevicePathSize = (
UINTN)ShortformNode - (
UINTN)FilePath;
624 Handles =
BmFindUsbDevice (FilePath, ParentDevicePathSize, &HandleCount);
626 for (Index = 0; Index < HandleCount; Index++) {
628 if (FilePath ==
NULL) {
637 if (NextFullPath ==
NULL) {
653 if (Handles !=
NULL) {
687 Status =
gBS->LocateHandleBuffer (
ByProtocol, &gEfiSimpleFileSystemProtocolGuid,
NULL, &HandleCount, &Handles);
688 if (EFI_ERROR (Status)) {
693 GetNext = (BOOLEAN)(FullPath ==
NULL);
699 for (MediaType = 0; MediaType < 3; MediaType++) {
700 for (Index = 0; Index < HandleCount; Index++) {
701 Status =
gBS->HandleProtocol (Handles[Index], &gEfiBlockIoProtocolGuid, (VOID *)&BlockIo);
702 if (EFI_ERROR (Status)) {
708 ((MediaType == 2) && (BlockIo ==
NULL))
722 if (NextFullPath !=
NULL) {
727 if (Handles !=
NULL) {
760 Status =
gBS->LocateHandleBuffer (
ByProtocol, &gEfiLoadFileProtocolGuid,
NULL, &HandleCount, &Handles);
761 if (EFI_ERROR (Status)) {
767 GetNext = (BOOLEAN)(FullPath ==
NULL);
768 for (Index = 0; Index < HandleCount; Index++) {
771 if (NextFullPath ==
NULL) {
783 if (RamDiskDevicePath !=
NULL) {
793 if (Handles !=
NULL) {
816 TempDevicePath = *CachedDevicePath;
821 if (*CachedDevicePath ==
NULL) {
826 TempDevicePath = *CachedDevicePath;
828 if (TempDevicePath !=
NULL) {
837 TempDevicePath = *CachedDevicePath;
877 UINTN BlockIoHandleCount;
885 UINTN CachedDevicePathSize;
890 BOOLEAN ConnectAllAttempted;
904 CachedDevicePath =
NULL;
905 Status =
gRT->SetVariable (
916 if (CachedDevicePath !=
NULL) {
917 TempNewDevicePath = CachedDevicePath;
932 if (!EFI_ERROR (Status)) {
947 if (FullPath !=
NULL) {
957 Status =
gRT->SetVariable (
978 }
while (TempNewDevicePath !=
NULL);
985 BlockIoBuffer =
NULL;
987 ConnectAllAttempted =
FALSE;
989 if (BlockIoBuffer !=
NULL) {
993 Status =
gBS->LocateHandleBuffer (
ByProtocol, &gEfiBlockIoProtocolGuid,
NULL, &BlockIoHandleCount, &BlockIoBuffer);
994 if (EFI_ERROR (Status)) {
995 BlockIoHandleCount = 0;
996 BlockIoBuffer =
NULL;
1002 for (Index = 0; Index < BlockIoHandleCount; Index++) {
1004 if (BlockIoDevicePath ==
NULL) {
1016 if (FullPath !=
NULL) {
1023 Status =
gRT->SetVariable (
1026 EFI_VARIABLE_BOOTSERVICE_ACCESS |
1041 if (MatchFound || ConnectAllAttempted) {
1046 ConnectAllAttempted =
TRUE;
1049 if (CachedDevicePath !=
NULL) {
1053 if (BlockIoBuffer !=
NULL) {
1086 UINTN NumberSimpleFileSystemHandles;
1090 GetNext = (BOOLEAN)(FullPath ==
NULL);
1094 TempDevicePath = DevicePath;
1095 Status =
gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &TempDevicePath, &Handle);
1096 if (!EFI_ERROR (Status)) {
1099 NextFullPath =
FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME);
1104 return NextFullPath;
1111 Status =
gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle);
1128 Status =
gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo);
1130 if (EFI_ERROR (Status)) {
1135 if (Buffer !=
NULL) {
1136 BlockIo->ReadBlocks (
1149 NextFullPath =
NULL;
1151 gBS->LocateHandleBuffer (
1153 &gEfiSimpleFileSystemProtocolGuid,
1155 &NumberSimpleFileSystemHandles,
1156 &SimpleFileSystemHandles
1158 for (Index = 0; Index < NumberSimpleFileSystemHandles; Index++) {
1167 if ((Size <= TempSize) && (
CompareMem (TempDevicePath, DevicePath, Size) == 0)) {
1168 NextFullPath =
FileDevicePath (SimpleFileSystemHandles[Index], EFI_REMOVABLE_MEDIA_FILE_NAME);
1174 NextFullPath =
NULL;
1179 if (SimpleFileSystemHandles !=
NULL) {
1180 FreePool (SimpleFileSystemHandles);
1183 return NextFullPath;
1251 Status =
gBS->LocateHandleBuffer (
1253 &gEfiBlockIoProtocolGuid,
1258 if (EFI_ERROR (Status)) {
1264 for (Index = 0; Index < HandleCount; Index++) {
1266 Status =
gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &Node, &Handle);
1267 if (!EFI_ERROR (Status) &&
1268 (Handle == LoadFileHandle) &&
1274 Handle = Handles[Index];
1279 if (Handles !=
NULL) {
1283 if (Index == HandleCount) {
1287 *RamDiskHandle = Handle;
1289 if (Handle !=
NULL) {
1318 Status =
gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &Node, &Handle);
1319 if (!EFI_ERROR (Status) &&
1329 ASSERT (RamDiskDevicePath !=
NULL);
1331 return RamDiskDevicePath;
1353 UINT64 StartingAddr;
1356 ASSERT (RamDiskDevicePath !=
NULL);
1358 *RamDiskSizeInPages = 0;
1363 Status =
gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &RamDiskDevicePath, &Handle);
1372 return (VOID *)(
UINTN)StartingAddr;
1390 VOID *RamDiskBuffer;
1391 UINTN RamDiskSizeInPages;
1393 ASSERT (RamDiskDevicePath !=
NULL);
1400 if (mRamDisk ==
NULL) {
1405 Status = mRamDisk->Unregister (RamDiskDevicePath);
1407 FreePages (RamDiskBuffer, RamDiskSizeInPages);
1431 Status =
gBS->OpenProtocol (
1433 &gEfiLoadFileProtocolGuid,
1437 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1443 Status = LoadFile->LoadFile (LoadFile, FilePath,
TRUE, &BufferSize, FileBuffer);
1444 if ((Status != EFI_WARN_FILE_SYSTEM) && (Status != EFI_BUFFER_TOO_SMALL)) {
1448 if (Status == EFI_BUFFER_TOO_SMALL) {
1459 if (FileBuffer ==
NULL) {
1462 CHAR16 *LoadFileText;
1466 if (LoadFilePath ==
NULL) {
1467 LoadFileText =
NULL;
1476 "%a:%a: failed to allocate reserved pages: "
1477 "BufferSize=%Lu LoadFile=\"%s\" FilePath=\"%s\"\n",
1485 if (FileText !=
NULL) {
1489 if (LoadFileText !=
NULL) {
1497 Status = LoadFile->LoadFile (LoadFile, FilePath,
TRUE, &BufferSize, FileBuffer);
1498 if (EFI_ERROR (Status)) {
1504 if (FullPath ==
NULL) {
1549 Status =
gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &Node, &Handle);
1562 Status =
gBS->LocateHandleBuffer (
1564 &gEfiLoadFileProtocolGuid,
1569 if (EFI_ERROR (Status)) {
1574 for (Index = 0; Index < HandleCount; Index++) {
1576 Handle = Handles[Index];
1581 if (Handles !=
NULL) {
1586 if (Handle ==
NULL) {
1643 ASSERT (FilePath !=
NULL);
1649 Status =
gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &Node, &Handle);
1650 if (EFI_ERROR (Status)) {
1651 Status =
gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &Node, &Handle);
1667 if (FullPath ==
NULL) {
1688 Status =
gBS->LocateDevicePath (&gEfiUsbIoProtocolGuid, &Node, &Handle);
1689 if (EFI_ERROR (Status)) {
1707 if (FilePath == Node) {
1725 if (FullPath !=
NULL) {
1740 Status =
gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &Node, &Handle);
1741 if (!EFI_ERROR (Status)) {
1768 Status =
gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &DevicePath, &FvHandle);
1769 if (!EFI_ERROR (Status)) {
1771 if (NameGuid !=
NULL) {
1795 IN UINT32 ErrorCode,
1806 (ErrorCode == EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR) ||
1807 (ErrorCode == EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED)
1810 ZeroMem (&ExtendedData,
sizeof (ExtendedData));
1815 (EFI_SOFTWARE_DXE_BS_DRIVER | ErrorCode),
1820 sizeof (ExtendedData) -
sizeof (ExtendedData.
DataHeader)
1855 UINTN OriginalOptionNumber;
1863 if (BootOption ==
NULL) {
1867 if ((BootOption->FilePath ==
NULL) || (BootOption->OptionType != LoadOptionTypeBoot)) {
1868 BootOption->Status = EFI_INVALID_PARAMETER;
1876 if (OptionNumber == LoadOptionNumberUnassigned) {
1878 if (!EFI_ERROR (Status)) {
1882 OptionNumber = Uint16;
1883 OriginalOptionNumber = BootOption->OptionNumber;
1884 BootOption->OptionNumber = OptionNumber;
1886 BootOption->OptionNumber = OriginalOptionNumber;
1889 if (EFI_ERROR (Status)) {
1890 DEBUG ((DEBUG_ERROR,
"[Bds] Failed to create Boot#### for a temporary boot - %r!\n", Status));
1891 BootOption->Status = Status;
1899 Uint16 = (UINT16)OptionNumber;
1902 &gEfiGlobalVariableGuid,
1903 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
1913 DEBUG ((DEBUG_INFO,
"[Bds] Booting Boot Manager Menu.\n"));
1934 (BOOLEAN)((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT)
1941 if (BootOption->Description ==
NULL) {
1942 DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"[Bds]Booting from unknown device path\n"));
1944 DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"[Bds]Booting %s\n", BootOption->Description));
1950 RamDiskDevicePath =
NULL;
1952 Status = EFI_NOT_FOUND;
1956 if (FileBuffer !=
NULL) {
1960 Status =
gBS->LoadImage (
1970 if (FileBuffer !=
NULL) {
1974 if (FilePath !=
NULL) {
1978 if (EFI_ERROR (Status)) {
1985 if (Status == EFI_SECURITY_VIOLATION) {
1986 gBS->UnloadImage (ImageHandle);
1992 if (RamDiskDevicePath !=
NULL) {
2001 BootOption->Status = Status;
2011 if (mBmLegacyBoot !=
NULL) {
2028 mBmLegacyBoot (BootOption);
2030 BootOption->Status = EFI_UNSUPPORTED;
2040 Status =
gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **)&ImageInfo);
2045 ImageInfo->
LoadOptions = BootOption->OptionalData;
2056 gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00,
NULL);
2067 Status =
gBS->StartImage (ImageHandle, &BootOption->ExitDataSize, &BootOption->ExitData);
2068 DEBUG ((DEBUG_INFO | DEBUG_LOAD,
"Image Return Status = %r\n", Status));
2069 BootOption->Status = Status;
2074 if (RamDiskDevicePath !=
NULL) {
2079 if (EFI_ERROR (Status)) {
2091 gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000,
NULL);
2097 Status =
gBS->LocateProtocol (&gEfiBootLogoProtocolGuid,
NULL, (VOID **)&BootLogo);
2098 if (!EFI_ERROR (Status) && (BootLogo !=
NULL)) {
2099 Status = BootLogo->SetBootLogo (BootLogo,
NULL, 0, 0, 0, 0);
2106 Status =
gRT->SetVariable (
2108 &gEfiGlobalVariableGuid,
2118 ASSERT (Status ==
EFI_SUCCESS || Status == EFI_NOT_FOUND);
2141 if ((BlockIoDevicePath ==
NULL) || (HardDriveDevicePath ==
NULL)) {
2162 if ((Node->
PartitionNumber == HardDriveDevicePath->PartitionNumber) &&
2163 (Node->
MBRType == HardDriveDevicePath->MBRType) &&
2164 (Node->
SignatureType == HardDriveDevicePath->SignatureType) &&
2196 UINTN *BootOptionCount
2206 CHAR16 *Description;
2208 ASSERT (BootOptionCount !=
NULL);
2210 *BootOptionCount = 0;
2216 gBS->LocateHandleBuffer (
2218 &gEfiBlockIoProtocolGuid,
2224 for (Removable = 0; Removable < 2; Removable++) {
2225 for (Index = 0; Index < HandleCount; Index++) {
2226 Status =
gBS->HandleProtocol (
2228 &gEfiBlockIoProtocolGuid,
2231 if (EFI_ERROR (Status)) {
2238 if (BlkIo->Media->LogicalPartition) {
2245 if (BlkIo->Media->RemovableMedia == ((Removable == 0) ?
FALSE :
TRUE)) {
2252 if ((BlkIo->Media->RemovableMedia ==
TRUE) &&
2253 (BlkIo->Media->MediaPresent ==
FALSE))
2264 ASSERT (BootOptions !=
NULL);
2267 &BootOptions[(*BootOptionCount)++],
2268 LoadOptionNumberUnassigned,
2282 if (HandleCount != 0) {
2289 gBS->LocateHandleBuffer (
2291 &gEfiSimpleFileSystemProtocolGuid,
2296 for (Index = 0; Index < HandleCount; Index++) {
2297 Status =
gBS->HandleProtocol (
2299 &gEfiBlockIoProtocolGuid,
2302 if (!EFI_ERROR (Status)) {
2315 ASSERT (BootOptions !=
NULL);
2318 &BootOptions[(*BootOptionCount)++],
2319 LoadOptionNumberUnassigned,
2331 if (HandleCount != 0) {
2338 gBS->LocateHandleBuffer (
2340 &gEfiLoadFileProtocolGuid,
2345 for (Index = 0; Index < HandleCount; Index++) {
2359 ASSERT (BootOptions !=
NULL);
2362 &BootOptions[(*BootOptionCount)++],
2363 LoadOptionNumberUnassigned,
2375 if (HandleCount != 0) {
2394 UINTN NvBootOptionCount;
2396 UINTN BootOptionCount;
2398 UINTN UpdatedBootOptionCount;
2405 if (mBmRefreshLegacyBootOption !=
NULL) {
2406 mBmRefreshLegacyBootOption ();
2414 for (Index = 0; Index < BootOptionCount; Index++) {
2416 BootOptions[Index].OptionalDataSize =
sizeof (
EFI_GUID);
2422 Status =
gBS->LocateProtocol (
2423 &gEdkiiPlatformBootManagerProtocolGuid,
2425 (VOID **)&PlatformBootManager
2427 if (!EFI_ERROR (Status)) {
2432 Status = PlatformBootManager->RefreshAllBootOptions (
2435 &UpdatedBootOptions,
2436 &UpdatedBootOptionCount
2438 if (!EFI_ERROR (Status)) {
2440 BootOptions = UpdatedBootOptions;
2441 BootOptionCount = UpdatedBootOptionCount;
2450 for (Index = 0; Index < NvBootOptionCount; Index++) {
2473 for (Index = 0; Index < BootOptionCount; Index++) {
2507 CHAR16 *Description;
2508 UINTN DescriptionLength;
2519 gBS->LocateHandleBuffer (
2521 &gEfiLoadFileProtocolGuid,
2526 for (Index = 0; Index < HandleCount; Index++) {
2534 if (HandleCount != 0) {
2538 if (DevicePath ==
NULL) {
2545 if (EFI_ERROR (Status)) {
2546 DEBUG ((DEBUG_WARN,
"[Bds]BootManagerMenu FFS section can not be found, skip its boot option registration\n"));
2547 return EFI_NOT_FOUND;
2550 ASSERT (DevicePath !=
NULL);
2556 EFI_SECTION_USER_INTERFACE,
2558 (VOID **)&Description,
2561 if (EFI_ERROR (Status)) {
2568 LoadOptionNumberUnassigned,
2570 LOAD_OPTION_CATEGORY_APP | LOAD_OPTION_ACTIVE | LOAD_OPTION_HIDDEN,
2571 (Description !=
NULL) ? Description : L
"Boot Manager Menu",
2578 if (Description !=
NULL) {
2584 UINTN BootOptionCount;
2613 UINTN BootOptionCount;
2619 for (Index = 0; Index < BootOptionCount; Index++) {
2623 BootOptions[Index].OptionNumber,
2624 BootOptions[Index].OptionType,
2625 BootOptions[Index].Attributes,
2626 BootOptions[Index].Description,
2627 BootOptions[Index].FilePath,
2628 BootOptions[Index].OptionalData,
2629 BootOptions[Index].OptionalDataSize
2641 if (Index == BootOptionCount) {
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
UINT64 EFIAPI ReadUnaligned64(IN CONST UINT64 *Buffer)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID * BmGetRamDiskMemoryInfo(IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath, OUT UINTN *RamDiskSizeInPages)
EFI_DEVICE_PATH_PROTOCOL * BmExpandNetworkFileSystem(IN EFI_HANDLE LoadFileHandle, OUT EFI_HANDLE *RamDiskHandle)
EFI_DEVICE_PATH_PROTOCOL * BmExpandFileDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
VOID EFIAPI EfiBootManagerBoot(IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
EFI_HANDLE * BmFindUsbDevice(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINTN ParentDevicePathSize, OUT UINTN *UsbIoHandleCount)
VOID *EFIAPI EfiBootManagerGetLoadOptionBuffer(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT UINTN *FileSize)
BOOLEAN BmIsBootManagerMenuFilePath(EFI_DEVICE_PATH_PROTOCOL *DevicePath)
VOID EFIAPI BmEndOfBdsPerfCode(IN EFI_EVENT Event, IN VOID *Context)
EFI_DEVICE_PATH_PROTOCOL * BmExpandUriDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
EFI_STATUS BmRegisterBootManagerMenu(OUT EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
EFI_DEVICE_PATH_PROTOCOL * BmExpandPartitionDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI EfiBootManagerGetNextLoadOptionDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
VOID EFIAPI EfiBootManagerRefreshAllBootOption(VOID)
BOOLEAN BmMatchUsbClass(IN EFI_USB_IO_PROTOCOL *UsbIo, IN USB_CLASS_DEVICE_PATH *UsbClass)
EFI_DEVICE_PATH_PROTOCOL * BmExpandUsbDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath, IN EFI_DEVICE_PATH_PROTOCOL *ShortformNode)
EFI_DEVICE_PATH_PROTOCOL * BmGetNextLoadOptionDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFiles(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
VOID BmReportLoadFailure(IN UINT32 ErrorCode, IN EFI_STATUS FailureStatus)
VOID EFIAPI EfiBootManagerRegisterLegacyBootSupport(EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION RefreshLegacyBootOption, EFI_BOOT_MANAGER_LEGACY_BOOT LegacyBoot)
EFI_BOOT_MANAGER_LOAD_OPTION * BmEnumerateBootOptions(UINTN *BootOptionCount)
UINTN BmFindBootOptionInVariable(IN EFI_BOOT_MANAGER_LOAD_OPTION *OptionToFind)
EFI_DEVICE_PATH_PROTOCOL * BmGetRamDiskDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
EFI_GUID mBmHardDriveBootVariableGuid
VOID BmDestroyRamDisk(IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath)
BOOLEAN BmMatchUsbWwid(IN EFI_USB_IO_PROTOCOL *UsbIo, IN USB_WWID_DEVICE_PATH *UsbWwid)
EFI_DEVICE_PATH_PROTOCOL * BmAdjustFvFilePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
EFI_STATUS EFIAPI EfiBootManagerGetBootManagerMenu(EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
BOOLEAN BmIsAutoCreateBootOption(EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
VOID BmCachePartitionDevicePath(IN OUT EFI_DEVICE_PATH_PROTOCOL **CachedDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL * BmExpandMediaDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_DEVICE_PATH_PROTOCOL *FullPath)
BOOLEAN BmMatchPartitionDevicePathNode(IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath, IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath)
EFI_DEVICE_PATH_PROTOCOL * BmExpandLoadFile(IN EFI_HANDLE LoadFileHandle, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
BOOLEAN BmMatchHttpBootDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *Left, IN EFI_DEVICE_PATH_PROTOCOL *Right)
BOOLEAN BmIsFvFilePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
VOID BmMakeBootOptionDescriptionUnique(EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions, UINTN BootOptionCount)
CHAR16 * BmGetBootDescription(IN EFI_HANDLE Handle)
EFI_STATUS BmConnectUsbShortFormDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
VOID BmRepairAllControllers(UINTN ReconnectRepairCount)
VOID EFIAPI BmStopHotkeyService(IN EFI_EVENT Event, IN VOID *Context)
VOID * BmGetNextLoadOptionBuffer(IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE Type, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT UINTN *FileSize)
EFI_STATUS BmGetFreeOptionNumber(IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType, OUT UINT16 *FreeOptionNumber)
VOID BmSetMemoryTypeInformationVariable(IN BOOLEAN Boot)
EFI_STATUS BmSetVariableAndReportStatusCodeOnError(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_DEVICE_PATH_PROTOCOL * BmDelPartMatchInstance(IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single)
BOOLEAN BmMatchDevicePaths(IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single)
#define MEDIA_FILEPATH_DP
#define HARDWARE_DEVICE_PATH
#define MEDIA_RAM_DISK_DP
#define MEDIA_PIWG_FW_FILE_DP
#define MEDIA_HARDDRIVE_DP
#define MESSAGING_DEVICE_PATH
UINT8 EFIAPI DevicePathType(IN CONST VOID *Node)
UINTN EFIAPI DevicePathNodeLength(IN CONST VOID *Node)
UINT8 EFIAPI DevicePathSubType(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathNode(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI FileDevicePath(IN EFI_HANDLE Device OPTIONAL, IN CONST CHAR16 *FileName)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
BOOLEAN EFIAPI IsDevicePathValid(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINTN MaxSize)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DevicePathFromHandle(IN EFI_HANDLE Handle)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathInstance(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI GetNextDevicePathInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT UINTN *Size)
CHAR16 *EFIAPI ConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
UINTN EFIAPI GetDevicePathSize(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DuplicateDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
BOOLEAN EFIAPI IsDevicePathEndType(IN CONST VOID *Node)
VOID EFIAPI SetDevicePathEndNode(OUT VOID *Node)
BOOLEAN EFIAPI ReportErrorCodeEnabled(VOID)
EFI_STATUS EFIAPI GetFileDevicePathFromAnyFv(IN CONST EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, OUT EFI_DEVICE_PATH_PROTOCOL **FvFileDevicePath)
EFI_STATUS EFIAPI GetSectionFromAnyFv(IN CONST EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, OUT VOID **Buffer, OUT UINTN *Size)
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages)
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateReservedPages(IN UINTN Pages)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG_CODE_BEGIN()
#define DEBUG(Expression)
#define DEBUG_CODE(Expression)
#define REPORT_STATUS_CODE_EX(Type, Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, ExtendedDataSize)
#define REPORT_STATUS_CODE(Type, Value)
#define PcdGet32(TokenName)
#define PcdGetPtr(TokenName)
#define EFI_PROGRESS_CODE
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_GUID gEfiRamDiskProtocolGuid
#define EFI_SIZE_TO_PAGES(Size)
EFI_STATUS EFIAPI EfiBootManagerLoadOptionToVariable(IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption)
EFI_STATUS EFIAPI EfiBootManagerFreeLoadOption(IN EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption)
EFI_BOOT_MANAGER_LOAD_OPTION *EFIAPI EfiBootManagerGetLoadOptions(OUT UINTN *LoadOptionCount, IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType)
VOID(EFIAPI * EFI_BOOT_MANAGER_LEGACY_BOOT)(IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption)
EFI_STATUS EFIAPI EfiBootManagerAddLoadOptionVariable(IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *Option, IN UINTN Position)
EFI_STATUS EFIAPI EfiBootManagerFreeLoadOptions(IN EFI_BOOT_MANAGER_LOAD_OPTION *LoadOptions, IN UINTN LoadOptionCount)
EFI_STATUS EFIAPI EfiBootManagerVariableToLoadOption(IN CHAR16 *VariableName, IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *LoadOption)
VOID(EFIAPI * EFI_BOOT_MANAGER_REFRESH_LEGACY_BOOT_OPTION)(VOID)
EFI_STATUS EFIAPI EfiBootManagerConnectDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect, OUT EFI_HANDLE *MatchingHandle OPTIONAL)
INTN EFIAPI EfiBootManagerFindLoadOption(IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key, IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array, IN UINTN Count)
EFI_STATUS EFIAPI EfiBootManagerDeleteLoadOptionVariable(IN UINTN OptionNumber, IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE OptionType)
VOID EFIAPI EfiBootManagerConnectAll(VOID)
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)
EFI_STATUS EFIAPI EfiCreateEventLegacyBootEx(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *LegacyBootEvent)
EFI_STATUS EFIAPI GetVariable2(IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT VOID **Value, OUT UINTN *Size OPTIONAL)
VOID EFIAPI EfiSignalEventReadyToBoot(VOID)
EFI_GUID *EFIAPI EfiGetNameGuidFromFwVolDevicePathNode(IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode)
#define EFI_VARIABLE_NON_VOLATILE
EFI_BLOCK_IO_MEDIA * Media
VOID * LoadOptions
A pointer to the image's binary load options.
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.
UINT32 LoadOptionsSize
The size in bytes of LoadOptions.
EFI_STATUS_CODE_DATA DataHeader