29#define TRANSLATION_OUTPUT_SIZE 0x100
35#define BRIDGE_TRANSLATION_OUTPUT_SIZE 0x40
40#define REQUIRED_PCI_OFW_NODES 2
41#define REQUIRED_MMIO_OFW_NODES 1
42#define EXAMINED_OFW_NODES 6
54 return ((
'0' <= Chr && Chr <=
'9') ||
55 (
'A' <= Chr && Chr <=
'Z') ||
56 (
'a' <= Chr && Chr <=
'z')
66 return (Chr ==
',' || Chr ==
'.' || Chr ==
'_' ||
67 Chr ==
'+' || Chr ==
'-'
77 return (32 <= Chr && Chr <= 126 &&
78 Chr !=
'/' && Chr !=
'@' && Chr !=
':');
117 while (Pos < Substring.Len && Substring.Ptr[Pos] == *Chr) {
122 return (BOOLEAN)(Pos == Substring.Len && *Chr ==
'\0');
176 RETURN_STATUS Status;
182 for (Pos = 0; Pos < UnitAddress.Len; ++Pos) {
186 Chr = UnitAddress.Ptr[Pos];
187 Val = (
'a' <= Chr && Chr <=
'f') ? (Chr -
'a' + 10) :
188 (
'A' <= Chr && Chr <=
'F') ? (Chr -
'A' + 10) :
189 (
'0' <= Chr && Chr <=
'9') ? (Chr -
'0') :
193 if (EntryVal > 0xFFFFFFFFFFFFFFFull) {
197 EntryVal =
LShiftU64 (EntryVal, 4) | Val;
198 }
else if (Chr ==
',') {
199 if (PrevChr ==
',') {
203 if (Entry < *NumResults) {
204 Result[Entry] = EntryVal;
216 if (PrevChr ==
',') {
220 if (Entry < *NumResults) {
221 Result[Entry] = EntryVal;
276 if (BootOrder->Produced == BootOrder->Allocated) {
280 ASSERT (BootOrder->Allocated > 0);
281 AllocatedNew = BootOrder->Allocated * 2;
283 BootOrder->Allocated * sizeof (*BootOrder->Data),
284 AllocatedNew * sizeof (*DataNew),
287 if (DataNew ==
NULL) {
291 BootOrder->Allocated = AllocatedNew;
292 BootOrder->Data = DataNew;
295 BootOrder->Data[BootOrder->Produced++] =
296 (UINT16)ActiveOption->BootOption->OptionNumber;
297 ActiveOption->Appended =
TRUE;
338 *ActiveOption =
NULL;
345 for (ScanMode = 0; ScanMode < 2; ++ScanMode) {
347 for (Index = 0; Index < BootOptionCount; Index++) {
348 if ((BootOptions[Index].Attributes & LOAD_OPTION_ACTIVE) != 0) {
350 (*ActiveOption)[*Count].BootOption = &BootOptions[Index];
351 (*ActiveOption)[*Count].Appended =
FALSE;
363 *ActiveOption =
AllocatePool (*Count *
sizeof **ActiveOption);
364 if (*ActiveOption ==
NULL) {
435 BOOLEAN AcceptSlash =
FALSE;
455 OfwNode->DriverName.Ptr = *Ptr;
456 OfwNode->DriverName.Len = 0;
457 while (OfwNode->DriverName.Len < 32 &&
458 (
IsAlnum (**Ptr) || IsDriverNamePunct (**Ptr))
462 ++OfwNode->DriverName.Len;
465 if ((OfwNode->DriverName.Len == 0) || (OfwNode->DriverName.Len == 32)) {
493 OfwNode->UnitAddress.Ptr = *Ptr;
494 OfwNode->UnitAddress.Len = 0;
495 while (IsPrintNotDelim (**Ptr) || (AcceptSlash && **Ptr ==
'/')) {
497 ++OfwNode->UnitAddress.Len;
500 if (OfwNode->UnitAddress.Len == 0) {
507 OfwNode->DeviceArguments.Len = 0;
510 OfwNode->DeviceArguments.Ptr = *Ptr;
512 while (IsPrintNotDelim (**Ptr)) {
514 ++OfwNode->DeviceArguments.Len;
517 if (OfwNode->DeviceArguments.Len == 0) {
521 OfwNode->DeviceArguments.Ptr =
NULL;
545 "%a: DriverName=\"%.*a\" UnitAddress=\"%.*a\" DeviceArguments=\"%.*a\"\n",
547 OfwNode->DriverName.Len,
548 OfwNode->DriverName.Ptr,
549 OfwNode->UnitAddress.Len,
550 OfwNode->UnitAddress.Ptr,
551 OfwNode->DeviceArguments.Len,
552 OfwNode->DeviceArguments.Ptr ==
NULL ?
"" : OfwNode->DeviceArguments.Ptr
604 OUT CHAR16 *Translated,
610 UINTN FirstNonBridge;
639 OfwNode[0].UnitAddress.Ptr,
640 OfwNode[0].UnitAddress.Len,
645 UINT64 PciRootSerial;
650 PciRootSerialSubString.Ptr = Comma + 1;
651 PciRootSerialSubString.Len = OfwNode[0].UnitAddress.Len -
652 (PciRootSerialSubString.Ptr -
653 OfwNode[0].UnitAddress.Ptr);
657 PciRootSerialSubString,
696 UINT64 BridgeDevFun[2];
697 UINTN BridgesFreeBytes;
699 if (!
SubstringEq (OfwNode[FirstNonBridge].DriverName,
"pci-bridge")) {
704 NumEntries =
sizeof BridgeDevFun /
sizeof BridgeDevFun[0];
706 OfwNode[FirstNonBridge].UnitAddress,
714 BridgesFreeBytes =
sizeof Bridges - BridgesLen *
sizeof Bridges[0];
716 Bridges + BridgesLen,
722 BridgesLen += Written;
733 }
while (FirstNonBridge < NumNodes);
735 if (FirstNonBridge == NumNodes) {
745 OfwNode[FirstNonBridge].UnitAddress,
754 if ((NumNodes >= FirstNonBridge + 3) &&
755 SubstringEq (OfwNode[FirstNonBridge + 0].DriverName,
"ide") &&
756 SubstringEq (OfwNode[FirstNonBridge + 1].DriverName,
"drive") &&
757 SubstringEq (OfwNode[FirstNonBridge + 2].DriverName,
"disk")
781 OfwNode[FirstNonBridge + 1].UnitAddress,
787 OfwNode[FirstNonBridge + 2].UnitAddress,
799 *TranslatedSize *
sizeof (*Translated),
800 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/Ata(%a,%a,0x0)",
805 Secondary ?
"Secondary" :
"Primary",
806 Slave ?
"Slave" :
"Master"
808 }
else if ((NumNodes >= FirstNonBridge + 3) &&
809 SubstringEq (OfwNode[FirstNonBridge + 0].DriverName,
"pci8086,2922") &&
810 SubstringEq (OfwNode[FirstNonBridge + 1].DriverName,
"drive") &&
811 SubstringEq (OfwNode[FirstNonBridge + 2].DriverName,
"disk")
838 OfwNode[FirstNonBridge + 1].UnitAddress,
849 *TranslatedSize *
sizeof (*Translated),
850 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/Sata(0x%Lx,0xFFFF,0x0)",
857 }
else if ((NumNodes >= FirstNonBridge + 3) &&
858 SubstringEq (OfwNode[FirstNonBridge + 0].DriverName,
"isa") &&
859 SubstringEq (OfwNode[FirstNonBridge + 1].DriverName,
"fdc") &&
860 SubstringEq (OfwNode[FirstNonBridge + 2].DriverName,
"floppy")
883 OfwNode[FirstNonBridge + 2].UnitAddress,
895 *TranslatedSize *
sizeof (*Translated),
896 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/Floppy(0x%Lx)",
903 }
else if ((NumNodes >= FirstNonBridge + 2) &&
904 SubstringEq (OfwNode[FirstNonBridge + 0].DriverName,
"scsi") &&
905 SubstringEq (OfwNode[FirstNonBridge + 1].DriverName,
"disk")
925 *TranslatedSize *
sizeof (*Translated),
926 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)",
932 }
else if ((NumNodes >= FirstNonBridge + 3) &&
933 SubstringEq (OfwNode[FirstNonBridge + 0].DriverName,
"scsi") &&
934 SubstringEq (OfwNode[FirstNonBridge + 1].DriverName,
"channel") &&
935 SubstringEq (OfwNode[FirstNonBridge + 2].DriverName,
"disk")
961 OfwNode[FirstNonBridge + 2].UnitAddress,
972 *TranslatedSize *
sizeof (*Translated),
973 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/Scsi(0x%Lx,0x%Lx)",
981 }
else if ((NumNodes >= FirstNonBridge + 2) &&
982 SubstringEq (OfwNode[FirstNonBridge + 0].DriverName,
"pci8086,5845") &&
983 SubstringEq (OfwNode[FirstNonBridge + 1].DriverName,
"namespace")
1005 UINT64 Namespace[2];
1006 UINTN RequiredEntries;
1010 NumEntries = RequiredEntries;
1012 OfwNode[FirstNonBridge + 1].UnitAddress,
1016 (NumEntries != RequiredEntries) ||
1017 (Namespace[0] == 0) ||
1018 (Namespace[0] >= MAX_UINT32)
1024 Eui64 = (UINT8 *)&Namespace[1];
1027 *TranslatedSize *
sizeof (*Translated),
1028 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/"
1029 "NVMe(0x%Lx,%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x)",
1044 }
else if ((NumNodes >= FirstNonBridge + 2) &&
1045 SubstringEq (OfwNode[FirstNonBridge + 0].DriverName,
"usb") &&
1046 SubstringEq (OfwNode[FirstNonBridge + 1].DriverName,
"storage"))
1066 RETURN_STATUS ParseStatus;
1067 UINT64 OneBasedXhciPort;
1071 OfwNode[FirstNonBridge + 1].UnitAddress,
1075 if (
RETURN_ERROR (ParseStatus) || (OneBasedXhciPort == 0)) {
1081 *TranslatedSize *
sizeof (*Translated),
1082 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/USB(0x%Lx,0x0)",
1087 OneBasedXhciPort - 1
1105 *TranslatedSize *
sizeof (*Translated),
1106 "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)",
1119 if (Written + 1 < *TranslatedSize) {
1120 *TranslatedSize = Written;
1173 OUT CHAR16 *Translated,
1178 CHAR16 VenHwString[60 + 1];
1185 if ((NumNodes < REQUIRED_MMIO_OFW_NODES) ||
1186 !
SubstringEq (OfwNode[0].DriverName,
"virtio-mmio")
1194 OfwNode[0].UnitAddress,
1195 &VirtioMmioBase.Uint64,
1206 "VenHw(%g,%02X%02X%02X%02X%02X%02X%02X%02X)",
1207 &gVirtioMmioTransportGuid,
1208 VirtioMmioBase.Raw[0],
1209 VirtioMmioBase.Raw[1],
1210 VirtioMmioBase.Raw[2],
1211 VirtioMmioBase.Raw[3],
1212 VirtioMmioBase.Raw[4],
1213 VirtioMmioBase.Raw[5],
1214 VirtioMmioBase.Raw[6],
1215 VirtioMmioBase.Raw[7]
1218 if ((NumNodes >= 2) &&
1235 *TranslatedSize *
sizeof (*Translated),
1239 }
else if ((NumNodes >= 3) &&
1257 UINT64 TargetLun[2];
1262 OfwNode[2].UnitAddress,
1273 *TranslatedSize *
sizeof (*Translated),
1274 "%s/Scsi(0x%Lx,0x%Lx)",
1279 }
else if ((NumNodes >= 2) &&
1280 SubstringEq (OfwNode[1].DriverName,
"ethernet-phy"))
1296 *TranslatedSize *
sizeof (*Translated),
1309 if (Written + 1 < *TranslatedSize) {
1310 *TranslatedSize = Written;
1364 OUT CHAR16 *Translated,
1368 RETURN_STATUS Status;
1460 OUT CHAR16 *Translated,
1465 RETURN_STATUS Status;
1476 Status =
ParseOfwNode (Ptr, &Node[NumNodes], &IsFinal);
1480 DEBUG ((DEBUG_VERBOSE,
"%a: no more nodes\n", __func__));
1488 (NumNodes < EXAMINED_OFW_NODES) ? &Node[NumNodes] : &Skip,
1499 DEBUG ((DEBUG_VERBOSE,
"%a: parse error\n", __func__));
1508 NumNodes < EXAMINED_OFW_NODES ? NumNodes : EXAMINED_OFW_NODES,
1515 DEBUG ((DEBUG_VERBOSE,
"%a: success: \"%s\"\n", __func__, Translated));
1519 DEBUG ((DEBUG_VERBOSE,
"%a: buffer too small\n", __func__));
1523 DEBUG ((DEBUG_VERBOSE,
"%a: unsupported\n", __func__));
1529 "%a: logic error / system state mismatch\n",
1575 RETURN_STATUS Status;
1576 FIRMWARE_CONFIG_ITEM FwCfgItem;
1581 CONST CHAR8 *FwCfgPtr;
1583 UINTN TranslatedSize;
1591 if (FwCfgSize == 0) {
1596 if (FwCfg ==
NULL) {
1602 if (FwCfg[FwCfgSize - 1] !=
'\0') {
1607 DEBUG ((DEBUG_VERBOSE,
"%a: FwCfg:\n", __func__));
1608 DEBUG ((DEBUG_VERBOSE,
"%a\n", FwCfg));
1609 DEBUG ((DEBUG_VERBOSE,
"%a: FwCfg: <end>\n", __func__));
1613 if (EFI_ERROR (EfiStatus)) {
1614 Status = (RETURN_STATUS)EfiStatus;
1618 ExtraPciRoots =
NULL;
1640 ASSERT (Translated[TranslatedSize] == L
'\0');
1642 if (DevicePath ==
NULL) {
1644 goto FreeExtraPciRoots;
1655 if (EFI_ERROR (EfiStatus)) {
1656 Status = (RETURN_STATUS)EfiStatus;
1657 goto FreeExtraPciRoots;
1667 if (EFI_ERROR (EfiStatus) && (EfiStatus != EFI_NOT_FOUND)) {
1668 Status = (RETURN_STATUS)EfiStatus;
1669 goto FreeExtraPciRoots;
1688 "%a: %Lu OpenFirmware device path(s) connected\n",
1690 (UINT64)NumConnected
1696 if (ExtraPciRoots !=
NULL) {
1720 RETURN_STATUS Status;
1721 FIRMWARE_CONFIG_ITEM FwCfgItem;
1726 CONST CHAR8 *FwCfgPtr;
1727 UINTN TranslatedSize;
1729 UINTN VariableIndex = 0;
1730 CHAR16 VariableName[20];
1737 if (FwCfgSize == 0) {
1742 if (FwCfg ==
NULL) {
1748 if (FwCfg[FwCfgSize - 1] !=
'\0') {
1753 DEBUG ((DEBUG_VERBOSE,
"%a: FwCfg:\n", __func__));
1754 DEBUG ((DEBUG_VERBOSE,
"%a\n", FwCfg));
1755 DEBUG ((DEBUG_VERBOSE,
"%a: FwCfg: <end>\n", __func__));
1759 if (EFI_ERROR (EfiStatus)) {
1760 Status = (RETURN_STATUS)EfiStatus;
1764 ExtraPciRoots =
NULL;
1779 Status == EFI_UNSUPPORTED)
1787 ASSERT (Translated[TranslatedSize] == L
'\0');
1789 if (DevicePath ==
NULL) {
1791 goto FreeExtraPciRoots;
1796 sizeof (VariableName),
1797 L
"VMMBootOrder%04x",
1800 DEBUG ((DEBUG_INFO,
"%a: %s = %s\n", __func__, VariableName, Translated));
1804 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
1824 if (ExtraPciRoots !=
NULL) {
1868 CHAR16 *AbsConverted;
1877 if (Converted ==
NULL) {
1908 for ( Node = DevicePath
1933 if (FileBuffer ==
NULL) {
1940 if (AbsConverted ==
NULL) {
1946 "%a: expanded relative device path \"%s\" for prefix matching\n",
1951 Converted = AbsConverted;
1957 Result = (BOOLEAN)(
StrnCmp (Converted, Translated, TranslatedLength) == 0);
1960 "%a: against \"%s\": %a\n",
1963 Result ?
"match" :
"no match"
2004 RETURN_STATUS Status;
2010 if (!ActiveOption[Idx].Appended) {
2014 Current = ActiveOption[Idx].BootOption;
2015 FirstNode = Current->FilePath;
2016 if (FirstNode !=
NULL) {
2018 STATIC CHAR16 ConvFallBack[] = L
"<unable to convert>";
2022 if (Converted ==
NULL) {
2023 Converted = ConvFallBack;
2040 if (((Acpi->
HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) &&
2041 (EISA_ID_TO_NUM (Acpi->
HID) == 0x0a03))
2070 "%a: keeping \"%s\"\n",
2078 "%a: dropping \"%s\"\n",
2084 if (Converted != ConvFallBack) {
2116 for (Idx = 0; Idx < ActiveCount; ++Idx) {
2117 if (!ActiveOption[Idx].Appended) {
2118 CHAR16 VariableName[9];
2122 sizeof VariableName,
2124 ActiveOption[Idx].BootOption->OptionNumber
2133 &gEfiGlobalVariableGuid,
2176 RETURN_STATUS Status;
2177 FIRMWARE_CONFIG_ITEM FwCfgItem;
2180 CONST CHAR8 *FwCfgPtr;
2188 UINTN TranslatedSize;
2191 UINTN BootOptionCount;
2198 if (FwCfgSize == 0) {
2203 if (FwCfg ==
NULL) {
2209 if (FwCfg[FwCfgSize - 1] !=
'\0') {
2211 goto ErrorFreeFwCfg;
2214 DEBUG ((DEBUG_VERBOSE,
"%a: FwCfg:\n", __func__));
2215 DEBUG ((DEBUG_VERBOSE,
"%a\n", FwCfg));
2216 DEBUG ((DEBUG_VERBOSE,
"%a: FwCfg: <end>\n", __func__));
2219 BootOrder.Produced = 0;
2220 BootOrder.Allocated = 1;
2222 BootOrder.Allocated * sizeof (*BootOrder.Data)
2224 if (BootOrder.Data ==
NULL) {
2226 goto ErrorFreeFwCfg;
2233 if (BootOptions ==
NULL) {
2235 goto ErrorFreeBootOrder;
2245 goto ErrorFreeBootOptions;
2250 if (EFI_ERROR (Status)) {
2251 goto ErrorFreeActiveOption;
2254 ExtraPciRoots =
NULL;
2278 for (Idx = 0; Idx < ActiveCount; ++Idx) {
2279 if (!ActiveOption[Idx].Appended &&
2283 ActiveOption[Idx].BootOption->FilePath
2292 goto ErrorFreeExtraPciRoots;
2315 goto ErrorFreeExtraPciRoots;
2322 Status =
gRT->SetVariable (
2324 &gEfiGlobalVariableGuid,
2326 EFI_VARIABLE_BOOTSERVICE_ACCESS |
2327 EFI_VARIABLE_RUNTIME_ACCESS,
2328 BootOrder.Produced * sizeof (*BootOrder.Data),
2331 if (EFI_ERROR (Status)) {
2334 "%a: setting BootOrder: %r\n",
2338 goto ErrorFreeExtraPciRoots;
2341 DEBUG ((DEBUG_INFO,
"%a: setting BootOrder: success\n", __func__));
2345ErrorFreeExtraPciRoots:
2346 if (ExtraPciRoots !=
NULL) {
2350ErrorFreeActiveOption:
2353ErrorFreeBootOptions:
2377 FIRMWARE_CONFIG_ITEM BootMenuWaitItem;
2378 UINTN BootMenuWaitSize;
2379 UINT16 Timeout =
PcdGet16 (PcdPlatformBootTimeOut);
2391 return PcdGet16 (PcdPlatformBootTimeOut);
2396 "etc/boot-menu-wait",
2401 (BootMenuWaitSize !=
sizeof (UINT16)))
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ScanMem8(IN CONST VOID *Buffer, IN UINTN Length, IN UINT8 Value)
#define MEDIA_FILEPATH_DP
#define HARDWARE_DEVICE_PATH
#define MEDIA_HARDDRIVE_DP
#define MESSAGING_DEVICE_PATH
UINT8 EFIAPI DevicePathType(IN CONST VOID *Node)
UINT8 EFIAPI DevicePathSubType(IN CONST VOID *Node)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
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 ConvertTextToDevicePath(IN CONST CHAR16 *TextDevicePath)
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
UINTN EFIAPI UnicodeSPrintAsciiFormat(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
#define RETURN_BUFFER_TOO_SMALL
#define RETURN_PROTOCOL_ERROR
#define RETURN_ERROR(StatusCode)
#define RETURN_UNSUPPORTED
#define RETURN_OUT_OF_RESOURCES
#define ARRAY_SIZE(Array)
#define RETURN_INVALID_PARAMETER
#define DEBUG(Expression)
#define PcdGet16(TokenName)
#define FeaturePcdGet(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
#define REQUIRED_PCI_OFW_NODES
#define TRANSLATION_OUTPUT_SIZE
RETURN_STATUS EFIAPI SetBootOrderFromQemu(VOID)
STATIC RETURN_STATUS TranslateOfwNodes(IN CONST OFW_NODE *OfwNode, IN UINTN NumNodes, IN CONST EXTRA_ROOT_BUS_MAP *ExtraPciRoots, OUT CHAR16 *Translated, IN OUT UINTN *TranslatedSize)
STATIC RETURN_STATUS ParseUnitAddressHexList(IN SUBSTRING UnitAddress, OUT UINT64 *Result, IN OUT UINTN *NumResults)
STATIC BOOLEAN Match(IN CONST CHAR16 *Translated, IN UINTN TranslatedLength, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
STATIC RETURN_STATUS BootOrderAppend(IN OUT BOOT_ORDER *BootOrder, IN OUT ACTIVE_OPTION *ActiveOption)
STATIC VOID PruneBootVariables(IN CONST ACTIVE_OPTION *ActiveOption, IN UINTN ActiveCount)
STATIC RETURN_STATUS TranslatePciOfwNodes(IN CONST OFW_NODE *OfwNode, IN UINTN NumNodes, IN CONST EXTRA_ROOT_BUS_MAP *ExtraPciRoots, OUT CHAR16 *Translated, IN OUT UINTN *TranslatedSize)
STATIC RETURN_STATUS ParseOfwNode(IN OUT CONST CHAR8 **Ptr, OUT OFW_NODE *OfwNode, OUT BOOLEAN *IsFinal)
#define BRIDGE_TRANSLATION_OUTPUT_SIZE
STATIC RETURN_STATUS TranslateOfwPath(IN OUT CONST CHAR8 **Ptr, IN CONST EXTRA_ROOT_BUS_MAP *ExtraPciRoots, OUT CHAR16 *Translated, IN OUT UINTN *TranslatedSize)
STATIC RETURN_STATUS TranslateMmioOfwNodes(IN CONST OFW_NODE *OfwNode, IN UINTN NumNodes, OUT CHAR16 *Translated, IN OUT UINTN *TranslatedSize)
STATIC BOOLEAN SubstringEq(IN SUBSTRING Substring, IN CONST CHAR8 *String)
STATIC RETURN_STATUS CollectActiveOptions(IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions, IN UINTN BootOptionCount, OUT ACTIVE_OPTION **ActiveOption, OUT UINTN *Count)
VOID EFIAPI StoreQemuBootOrder(VOID)
RETURN_STATUS EFIAPI ConnectDevicesFromQemu(VOID)
UINT16 EFIAPI GetFrontPageTimeoutFromQemu(VOID)
STATIC BOOLEAN IsAlnum(IN CHAR8 Chr)
STATIC RETURN_STATUS BootOrderComplete(IN OUT BOOT_ORDER *BootOrder, IN OUT ACTIVE_OPTION *ActiveOption, IN UINTN ActiveCount)
UINT16 EFIAPI QemuFwCfgRead16(VOID)
RETURN_STATUS EFIAPI QemuFwCfgFindFile(IN CONST CHAR8 *Name, OUT FIRMWARE_CONFIG_ITEM *Item, OUT UINTN *Size)
VOID EFIAPI QemuFwCfgReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
VOID EFIAPI QemuFwCfgSelectItem(IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem)
BOOLEAN EFIAPI QemuFwCfgIsAvailable(VOID)
VOID EFIAPI Exit(IN EFI_STATUS Status)
VOID *EFIAPI EfiBootManagerGetLoadOptionBuffer(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT UINTN *FileSize)
EFI_BOOT_MANAGER_LOAD_OPTION *EFIAPI EfiBootManagerGetLoadOptions(OUT UINTN *LoadOptionCount, IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType)
EFI_STATUS EFIAPI EfiBootManagerFreeLoadOptions(IN EFI_BOOT_MANAGER_LOAD_OPTION *LoadOptions, IN UINTN LoadOptionCount)
EFI_STATUS EFIAPI EfiBootManagerConnectDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect, OUT EFI_HANDLE *MatchingHandle OPTIONAL)
#define EFI_VARIABLE_NON_VOLATILE