35 Status =
gBS->OpenProtocol (
37 &gEfiPciHostBridgeResourceAllocationProtocolGuid,
38 (VOID **)&PciResAlloc,
41 EFI_OPEN_PROTOCOL_GET_PROTOCOL
44 if (EFI_ERROR (Status)) {
53 if (EFI_ERROR (Status)) {
62 if (EFI_ERROR (Status)) {
71 if (EFI_ERROR (Status)) {
80 if (EFI_ERROR (Status)) {
89 if (EFI_ERROR (Status)) {
97 if (EFI_ERROR (Status)) {
126 UINT8 StartBusNumber;
127 UINT8 PaddedBusRange;
140 RootBridgeHandle = RootBridgeDev->Handle;
145 RootBridgeDev->DevicePath
151 Status = PciResAlloc->StartBusEnumeration (
154 (VOID **)&Configuration
157 if (EFI_ERROR (Status)) {
161 if ((Configuration ==
NULL) || (Configuration->Desc == ACPI_END_TAG_DESCRIPTOR)) {
162 return EFI_INVALID_PARAMETER;
165 RootBridgeDev->BusNumberRanges = Configuration;
170 for (Configuration1 = Configuration; Configuration1->Desc != ACPI_END_TAG_DESCRIPTOR; Configuration1++) {
171 Configuration2 = Configuration1;
172 for (Configuration3 = Configuration1 + 1; Configuration3->Desc != ACPI_END_TAG_DESCRIPTOR; Configuration3++) {
173 if (Configuration2->AddrRangeMin > Configuration3->AddrRangeMin) {
174 Configuration2 = Configuration3;
182 if (Configuration2 != Configuration1) {
183 AddrRangeMin = Configuration1->AddrRangeMin;
184 Configuration1->AddrRangeMin = Configuration2->AddrRangeMin;
185 Configuration2->AddrRangeMin = AddrRangeMin;
187 AddrLen = Configuration1->AddrLen;
188 Configuration1->AddrLen = Configuration2->AddrLen;
189 Configuration2->AddrLen = AddrLen;
196 StartBusNumber = (UINT8)(Configuration->AddrRangeMin);
201 SubBusNumber = StartBusNumber;
221 if (EFI_ERROR (Status)) {
230 if (EFI_ERROR (Status)) {
238 while (Configuration->AddrRangeMin + Configuration->AddrLen - 1 < SubBusNumber) {
242 AddrLen = Configuration->AddrLen;
243 Configuration->AddrLen = SubBusNumber - Configuration->AddrRangeMin + 1;
249 Desc = Configuration->Desc;
250 Configuration->Desc = ACPI_END_TAG_DESCRIPTOR;
255 Status = PciResAlloc->SetBusNumbers (
258 RootBridgeDev->BusNumberRanges
264 Configuration->Desc = Desc;
265 (Configuration - 1)->AddrLen = AddrLen;
292 CurrentLink = Bridge->ChildList.ForwardLink;
293 while (CurrentLink !=
NULL && CurrentLink != &Bridge->ChildList) {
294 Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
302 if ((Temp->RomSize != 0) && (Temp->RomSize <= MaxLength)) {
309 CurrentLink = CurrentLink->ForwardLink;
327 IN UINT8 StartBusNumber,
328 OUT UINT8 *SubBusNumber
341 PciRootBridgeIo = Bridge->PciRootBridgeIo;
346 *SubBusNumber = StartBusNumber;
351 for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {
352 for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {
364 if (EFI_ERROR (Status) && (Func == 0)) {
371 if (!EFI_ERROR (Status) &&
378 if (EFI_ERROR (Status)) {
382 SecondBus = *SubBusNumber;
384 Register = (UINT16)((SecondBus << 8) | (UINT16)StartBusNumber);
386 Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x18);
388 Status = PciRootBridgeIo->Pci.
Write (
399 Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x1A);
400 Status = PciRootBridgeIo->Pci.
Write (
412 Status = PciRootBridgeIo->Pci.
Write (
426 if (EFI_ERROR (Status)) {
427 return EFI_DEVICE_ERROR;
434 Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x1A);
436 Status = PciRootBridgeIo->Pci.
Write (
479 RootBridgeHandle = RootBridgeDev->Handle;
484 Status = PciResAlloc->GetAllocAttributes (
490 if (EFI_ERROR (Status)) {
499 RootBridgeDev->Decodes |= EFI_BRIDGE_PMEM_MEM_COMBINE_SUPPORTED;
503 RootBridgeDev->Decodes |= EFI_BRIDGE_MEM64_DECODE_SUPPORTED;
504 RootBridgeDev->Decodes |= EFI_BRIDGE_PMEM64_DECODE_SUPPORTED;
507 RootBridgeDev->Decodes |= EFI_BRIDGE_MEM32_DECODE_SUPPORTED;
508 RootBridgeDev->Decodes |= EFI_BRIDGE_PMEM32_DECODE_SUPPORTED;
509 RootBridgeDev->Decodes |= EFI_BRIDGE_IO16_DECODE_SUPPORTED;
529 UINT32 MaxOptionRomSize;
530 UINT32 TempOptionRomSize;
532 MaxOptionRomSize = 0;
537 CurrentLink = Bridge->ChildList.ForwardLink;
538 while (CurrentLink !=
NULL && CurrentLink != &Bridge->ChildList) {
539 Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
550 if (Temp->RomSize > TempOptionRomSize) {
551 TempOptionRomSize = Temp->RomSize;
557 TempOptionRomSize = Temp->RomSize;
563 if (TempOptionRomSize > MaxOptionRomSize) {
564 MaxOptionRomSize = TempOptionRomSize;
567 CurrentLink = CurrentLink->ForwardLink;
570 return MaxOptionRomSize;
592 RootBridgeHandle =
NULL;
594 while (PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle) ==
EFI_SUCCESS) {
600 if (RootBridgeDev ==
NULL) {
601 return EFI_NOT_FOUND;
608 if (EFI_ERROR (Status)) {
630 OUT UINT64 *IoResStatus,
631 OUT UINT64 *Mem32ResStatus,
632 OUT UINT64 *PMem32ResStatus,
633 OUT UINT64 *Mem64ResStatus,
634 OUT UINT64 *PMem64ResStatus
641 Temp = (UINT8 *)AcpiConfig;
643 while (*Temp == ACPI_ADDRESS_SPACE_DESCRIPTOR) {
645 ResStatus = ACPIAddressDesc->AddrTranslationOffset;
647 switch (ACPIAddressDesc->ResType) {
649 if (ACPIAddressDesc->AddrSpaceGranularity == 32) {
650 if (ACPIAddressDesc->SpecificFlag == 0x06) {
654 *PMem32ResStatus = ResStatus;
659 *Mem32ResStatus = ResStatus;
663 if (ACPIAddressDesc->AddrSpaceGranularity == 64) {
664 if (ACPIAddressDesc->SpecificFlag == 0x06) {
668 *PMem64ResStatus = ResStatus;
673 *Mem64ResStatus = ResStatus;
683 *IoResStatus = ResStatus;
716 (PciDevice->ResourcePaddingDescriptors !=
NULL))
718 FreePool (PciDevice->ResourcePaddingDescriptors);
719 PciDevice->ResourcePaddingDescriptors =
NULL;
735 while (Bridge->Parent !=
NULL) {
736 Bridge = Bridge->Parent;
750 Bridge = PciDevice->Parent;
751 CurrentLink = Bridge->ChildList.ForwardLink;
752 while (CurrentLink !=
NULL && CurrentLink != &Bridge->ChildList) {
753 Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
754 if (Temp == PciDevice) {
760 CurrentLink = CurrentLink->ForwardLink;
782 Temp = PciResNode->PciDev;
801 if ((Temp->Parent !=
NULL) && (Temp->BusNumber == 0)) {
830 if (PciResNode2 ==
NULL) {
834 if ( (
IS_PCI_BRIDGE (&(PciResNode2->PciDev->Pci)) || (PciResNode2->PciDev->Parent ==
NULL)) \
835 && (PciResNode2->ResourceUsage != PciResUsagePadding))
840 if (PciResNode1 ==
NULL) {
844 if ((PciResNode1->Length) > (PciResNode2->Length)) {
871 CurrentLink = ResPool->ChildList.ForwardLink;
872 while (CurrentLink !=
NULL && CurrentLink != &ResPool->ChildList) {
873 Temp = RESOURCE_NODE_FROM_LINK (CurrentLink);
876 CurrentLink = CurrentLink->ForwardLink;
881 && (Temp->ResourceUsage != PciResUsagePadding))
889 CurrentLink = CurrentLink->ForwardLink;
920 IN UINT64 IoResStatus,
921 IN UINT64 Mem32ResStatus,
922 IN UINT64 PMem32ResStatus,
923 IN UINT64 Mem64ResStatus,
924 IN UINT64 PMem64ResStatus
927 BOOLEAN AllocationAjusted;
932 UINTN RemovedPciDevNum;
940 RemovedPciDevNum = 0;
943 ResPool[1] = Mem32Pool;
944 ResPool[2] = PMem32Pool;
945 ResPool[3] = Mem64Pool;
946 ResPool[4] = PMem64Pool;
948 ResStatus[0] = IoResStatus;
949 ResStatus[1] = Mem32ResStatus;
950 ResStatus[2] = PMem32ResStatus;
951 ResStatus[3] = Mem64ResStatus;
952 ResStatus[4] = PMem64ResStatus;
954 AllocationAjusted =
FALSE;
956 for (ResType = 0; ResType < 5; ResType++) {
972 if (PciResNode ==
NULL) {
979 for (DevIndex = 0; DevIndex < RemovedPciDevNum; DevIndex++) {
980 if (PciResNode->PciDev == RemovedPciDev[DevIndex]) {
985 if (DevIndex != RemovedPciDevNum) {
996 "PciBus: [%02x|%02x|%02x] was rejected due to resource confliction.\n",
997 PciResNode->PciDev->BusNumber,
998 PciResNode->PciDev->DeviceNumber,
999 PciResNode->PciDev->FunctionNumber
1008 ZeroMem (&AllocFailExtendedData,
sizeof (AllocFailExtendedData));
1010 AllocFailExtendedData.DevicePath = (UINT8 *)PciResNode->PciDev->DevicePath;
1011 AllocFailExtendedData.Bar = PciResNode->Bar;
1015 EFI_IO_BUS_PCI | EFI_IOB_EC_RESOURCE_CONFLICT,
1016 (VOID *)&AllocFailExtendedData,
1017 sizeof (AllocFailExtendedData)
1023 RemovedPciDev[RemovedPciDevNum++] = PciResNode->PciDev;
1024 AllocationAjusted =
TRUE;
1032 if (AllocationAjusted) {
1068 UINT8 *Configuration;
1117 if (NumConfig != 0) {
1123 if (Configuration ==
NULL) {
1124 return EFI_OUT_OF_RESOURCES;
1132 if ((Aperture & 0x01) != 0) {
1133 Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
1138 Ptr->ResType = ACPI_ADDRESS_SPACE_TYPE_IO;
1142 Ptr->SpecificFlag = 1;
1143 Ptr->AddrLen = IoNode->Length;
1144 Ptr->AddrRangeMax = IoNode->Alignment;
1152 if ((Aperture & 0x02) != 0) {
1153 Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
1158 Ptr->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
1162 Ptr->SpecificFlag = 0;
1166 Ptr->AddrSpaceGranularity = 32;
1167 Ptr->AddrLen = Mem32Node->Length;
1168 Ptr->AddrRangeMax = Mem32Node->Alignment;
1176 if ((Aperture & 0x04) != 0) {
1177 Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
1182 Ptr->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
1186 Ptr->SpecificFlag = 0x6;
1190 Ptr->AddrSpaceGranularity = 32;
1191 Ptr->AddrLen = PMem32Node->Length;
1192 Ptr->AddrRangeMax = PMem32Node->Alignment;
1200 if ((Aperture & 0x08) != 0) {
1201 Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
1206 Ptr->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
1210 Ptr->SpecificFlag = 0;
1214 Ptr->AddrSpaceGranularity = 64;
1215 Ptr->AddrLen = Mem64Node->Length;
1216 Ptr->AddrRangeMax = Mem64Node->Alignment;
1224 if ((Aperture & 0x10) != 0) {
1225 Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;
1230 Ptr->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
1234 Ptr->SpecificFlag = 0x06;
1238 Ptr->AddrSpaceGranularity = 64;
1239 Ptr->AddrLen = PMem64Node->Length;
1240 Ptr->AddrRangeMax = PMem64Node->Alignment;
1250 PtrEnd->Desc = ACPI_END_TAG_DESCRIPTOR;
1251 PtrEnd->Checksum = 0;
1257 if (Configuration ==
NULL) {
1258 return EFI_OUT_OF_RESOURCES;
1262 PtrEnd->Desc = ACPI_END_TAG_DESCRIPTOR;
1263 PtrEnd->Checksum = 0;
1266 *Config = Configuration;
1286 OUT UINT64 *Mem32Base,
1287 OUT UINT64 *PMem32Base,
1288 OUT UINT64 *Mem64Base,
1289 OUT UINT64 *PMem64Base
1296 ASSERT (Config !=
NULL);
1298 *IoBase = 0xFFFFFFFFFFFFFFFFULL;
1299 *Mem32Base = 0xFFFFFFFFFFFFFFFFULL;
1300 *PMem32Base = 0xFFFFFFFFFFFFFFFFULL;
1301 *Mem64Base = 0xFFFFFFFFFFFFFFFFULL;
1302 *PMem64Base = 0xFFFFFFFFFFFFFFFFULL;
1304 Temp = (UINT8 *)Config;
1306 while (*Temp == ACPI_ADDRESS_SPACE_DESCRIPTOR) {
1308 ResStatus = Ptr->AddrTranslationOffset;
1311 switch (Ptr->ResType) {
1320 if (Ptr->AddrSpaceGranularity == 32) {
1321 if ((Ptr->SpecificFlag & 0x06) != 0) {
1322 *PMem32Base = Ptr->AddrRangeMin;
1324 *Mem32Base = Ptr->AddrRangeMin;
1328 if (Ptr->AddrSpaceGranularity == 64) {
1329 if ((Ptr->SpecificFlag & 0x06) != 0) {
1330 *PMem64Base = Ptr->AddrRangeMin;
1332 *Mem64Base = Ptr->AddrRangeMin;
1343 *IoBase = Ptr->AddrRangeMin;
1378 UINT8 StartBusNumber;
1384 PciIo = &(BridgeDev->PciIo);
1385 Status = PciIo->Pci.
Read (PciIo, EfiPciIoWidthUint8, 0x19, 1, &StartBusNumber);
1387 if (EFI_ERROR (Status)) {
1397 if (EFI_ERROR (Status)) {
1403 if (EFI_ERROR (Status)) {
1409 if (EFI_ERROR (Status)) {
1415 if (EFI_ERROR (Status)) {
1451 Bridge->BridgeIoAlignment,
1514 if (EFI_ERROR (Status)) {
1564 gBS->FreePool (IoBridge);
1565 gBS->FreePool (Mem32Bridge);
1566 gBS->FreePool (PMem32Bridge);
1567 gBS->FreePool (PMem64Bridge);
1568 gBS->FreePool (Mem64Bridge);
1591 OUT UINT64 *Mem32Base,
1592 OUT UINT64 *PMem32Base,
1593 OUT UINT64 *Mem64Base,
1594 OUT UINT64 *PMem64Base
1597 if (!Bridge->Allocated) {
1598 return EFI_OUT_OF_RESOURCES;
1602 *Mem32Base = gAllOne;
1603 *PMem32Base = gAllOne;
1604 *Mem64Base = gAllOne;
1605 *PMem64Base = gAllOne;
1608 if (Bridge->PciBar[PPB_IO_RANGE].Length > 0) {
1609 *IoBase = Bridge->PciBar[PPB_IO_RANGE].BaseAddress;
1612 if (Bridge->PciBar[PPB_MEM32_RANGE].Length > 0) {
1613 *Mem32Base = Bridge->PciBar[PPB_MEM32_RANGE].BaseAddress;
1616 if (Bridge->PciBar[PPB_PMEM32_RANGE].Length > 0) {
1617 *PMem32Base = Bridge->PciBar[PPB_PMEM32_RANGE].BaseAddress;
1620 if (Bridge->PciBar[PPB_PMEM64_RANGE].Length > 0) {
1621 *PMem64Base = Bridge->PciBar[PPB_PMEM64_RANGE].BaseAddress;
1623 *PMem64Base = gAllOne;
1628 if (Bridge->PciBar[P2C_IO_1].Length > 0) {
1629 *IoBase = Bridge->PciBar[P2C_IO_1].BaseAddress;
1631 if (Bridge->PciBar[P2C_IO_2].Length > 0) {
1632 *IoBase = Bridge->PciBar[P2C_IO_2].BaseAddress;
1636 if (Bridge->PciBar[P2C_MEM_1].Length > 0) {
1637 if (Bridge->PciBar[P2C_MEM_1].BarType == PciBarTypePMem32) {
1638 *PMem32Base = Bridge->PciBar[P2C_MEM_1].BaseAddress;
1641 if (Bridge->PciBar[P2C_MEM_1].BarType == PciBarTypeMem32) {
1642 *Mem32Base = Bridge->PciBar[P2C_MEM_1].BaseAddress;
1646 if (Bridge->PciBar[P2C_MEM_2].Length > 0) {
1647 if (Bridge->PciBar[P2C_MEM_2].BarType == PciBarTypePMem32) {
1648 *PMem32Base = Bridge->PciBar[P2C_MEM_2].BaseAddress;
1651 if (Bridge->PciBar[P2C_MEM_2].BarType == PciBarTypeMem32) {
1652 *Mem32Base = Bridge->PciBar[P2C_MEM_2].BaseAddress;
1735 HostBridgeHandle =
NULL;
1736 RootBridgeHandle =
NULL;
1737 if (gPciPlatformProtocol !=
NULL) {
1741 PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle);
1746 Status =
gBS->HandleProtocol (
1748 &gEfiPciRootBridgeIoProtocolGuid,
1749 (VOID **)&PciRootBridgeIo
1752 if (EFI_ERROR (Status)) {
1753 return EFI_NOT_FOUND;
1756 HostBridgeHandle = PciRootBridgeIo->ParentHandle;
1762 gPciPlatformProtocol,
1767 }
else if (gPciOverrideProtocol !=
NULL) {
1771 PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle);
1776 Status =
gBS->HandleProtocol (
1778 &gEfiPciRootBridgeIoProtocolGuid,
1779 (VOID **)&PciRootBridgeIo
1782 if (EFI_ERROR (Status)) {
1783 return EFI_NOT_FOUND;
1786 HostBridgeHandle = PciRootBridgeIo->ParentHandle;
1792 gPciOverrideProtocol,
1799 Status = PciResAlloc->NotifyPhase (
1804 if (gPciPlatformProtocol !=
NULL) {
1809 gPciPlatformProtocol,
1814 }
else if (gPciOverrideProtocol !=
NULL) {
1819 gPciOverrideProtocol,
1871 HostBridgeHandle = Bridge->PciRootBridgeIo->ParentHandle;
1876 Status =
gBS->OpenProtocol (
1878 &gEfiPciHostBridgeResourceAllocationProtocolGuid,
1879 (VOID **)&PciResAlloc,
1882 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1885 if (EFI_ERROR (Status)) {
1886 return EFI_UNSUPPORTED;
1892 while (Bridge->Parent !=
NULL) {
1893 Bridge = Bridge->Parent;
1896 RootBridgeHandle = Bridge->Handle;
1898 RootBridgePciAddress.Register = 0;
1899 RootBridgePciAddress.Function = Func;
1900 RootBridgePciAddress.Device = Device;
1901 RootBridgePciAddress.Bus = Bus;
1902 RootBridgePciAddress.ExtendedRegister = 0;
1904 if (gPciPlatformProtocol !=
NULL) {
1909 gPciPlatformProtocol,
1912 RootBridgePciAddress,
1916 }
else if (gPciOverrideProtocol !=
NULL) {
1921 gPciOverrideProtocol,
1924 RootBridgePciAddress,
1933 RootBridgePciAddress,
1937 if (gPciPlatformProtocol !=
NULL) {
1942 gPciPlatformProtocol,
1945 RootBridgePciAddress,
1949 }
else if (gPciOverrideProtocol !=
NULL) {
1954 gPciOverrideProtocol,
1957 RootBridgePciAddress,
1996 IN OUT UINT8 *NumberOfChildren,
2010 if ((Controller ==
NULL) || (NumberOfChildren ==
NULL)) {
2011 return EFI_INVALID_PARAMETER;
2015 return EFI_INVALID_PARAMETER;
2019 if (ChildHandleBuffer ==
NULL) {
2020 return EFI_INVALID_PARAMETER;
2023 if (ChildHandleBuffer ==
NULL) {
2024 return EFI_INVALID_PARAMETER;
2028 Status =
gBS->OpenProtocol (
2030 &gEfiPciIoProtocolGuid,
2034 EFI_OPEN_PROTOCOL_GET_PROTOCOL
2037 if (EFI_ERROR (Status)) {
2038 return EFI_NOT_FOUND;
2041 Bridge = PCI_IO_DEVICE_FROM_PCI_IO_THIS (PciIo);
2047 while (Temp->Parent !=
NULL) {
2048 Temp = Temp->Parent;
2051 RootBridgeHandle = Temp->Handle;
2059 (EFI_IO_BUS_PCI | EFI_IOB_PC_HOTPLUG),
2063 if (NumberOfChildren !=
NULL) {
2064 *NumberOfChildren = 0;
2070 if (EFI_ERROR (Status)) {
2078 RemainingDevicePath,
2087 if (*NumberOfChildren == 0) {
2095 for (Index = 0; Index < *NumberOfChildren; Index++) {
2101 if (EFI_ERROR (Status)) {
2137 Status =
gBS->OpenProtocol (
2139 &gEfiPciRootBridgeIoProtocolGuid,
2140 (VOID **)&PciRootBridgeIo,
2143 EFI_OPEN_PROTOCOL_GET_PROTOCOL
2146 if (EFI_ERROR (Status)) {
2151 for (Index = 0; Index < gPciHostBridgeNumber; Index++) {
2152 if (HostBridgeHandle == gPciHostBrigeHandles[Index]) {
2177 if (HostBridgeHandle ==
NULL) {
2181 for (Index = 0; Index < gPciHostBridgeNumber; Index++) {
2182 if (HostBridgeHandle == gPciHostBrigeHandles[Index]) {
2187 if (Index < PCI_MAX_HOST_BRIDGE_NUM) {
2188 gPciHostBrigeHandles[Index] = HostBridgeHandle;
2189 gPciHostBridgeNumber++;
PACKED struct @89 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS PciHostBridgeEnumerator(IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc)
EFI_STATUS PciHostBridgeResourceAllocator(IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc)
EFI_STATUS PciScanBus(IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber, OUT UINT8 *SubBusNumber, OUT UINT8 *PaddedBusRange)
EFI_STATUS PciAllocateBusNumber(IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber, IN UINT8 NumberOfBuses, OUT UINT8 *NextBusNumber)
#define DEBUG(Expression)
#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type, Value, DevicePathParameter)
#define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type, Value, ExtendedData, ExtendedDataSize)
#define IS_PCI_BRIDGE(_p)
#define IS_PCI_MULTI_FUNC(_p)
#define IS_CARDBUS_BRIDGE(_p)
EFI_STATUS DeRegisterPciDevice(IN EFI_HANDLE Controller, IN EFI_HANDLE Handle)
EFI_STATUS StartPciDevicesOnBridge(IN EFI_HANDLE Controller, IN PCI_IO_DEVICE *RootBridge, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, IN OUT UINT8 *NumberOfChildren, IN OUT EFI_HANDLE *ChildHandleBuffer)
PCI_IO_DEVICE * GetRootBridgeByHandle(EFI_HANDLE RootBridgeHandle)
VOID RemoveAllPciDeviceOnBridge(EFI_HANDLE RootBridgeHandle, PCI_IO_DEVICE *Bridge)
VOID GetResourceBase(IN VOID *Config, OUT UINT64 *IoBase, OUT UINT64 *Mem32Base, OUT UINT64 *PMem32Base, OUT UINT64 *Mem64Base, OUT UINT64 *PMem64Base)
EFI_STATUS PciRootBridgeEnumerator(IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc, IN PCI_IO_DEVICE *RootBridgeDev)
EFI_STATUS EFIAPI PciHotPlugRequestNotify(IN EFI_PCI_HOTPLUG_REQUEST_PROTOCOL *This, IN EFI_PCI_HOTPLUG_OPERATION Operation, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN OUT UINT8 *NumberOfChildren, IN OUT EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS RejectPciDevice(IN PCI_IO_DEVICE *PciDevice)
VOID ProcessOptionRom(IN PCI_IO_DEVICE *Bridge, IN UINT64 RomBase, IN UINT64 MaxLength)
EFI_STATUS PciBridgeResourceAllocator(IN PCI_IO_DEVICE *Bridge)
EFI_STATUS AddHostBridgeEnumerator(IN EFI_HANDLE HostBridgeHandle)
BOOLEAN SearchHostBridgeHandle(IN EFI_HANDLE RootBridgeHandle)
EFI_STATUS GetResourceBaseFromBridge(IN PCI_IO_DEVICE *Bridge, OUT UINT64 *IoBase, OUT UINT64 *Mem32Base, OUT UINT64 *PMem32Base, OUT UINT64 *Mem64Base, OUT UINT64 *PMem64Base)
PCI_RESOURCE_NODE * GetLargerConsumerDevice(IN PCI_RESOURCE_NODE *PciResNode1, IN PCI_RESOURCE_NODE *PciResNode2)
EFI_STATUS PciHostBridgeDeviceAttribute(IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc)
PCI_RESOURCE_NODE * GetMaxResourceConsumerDevice(IN PCI_RESOURCE_NODE *ResPool)
EFI_STATUS DetermineRootBridgeAttributes(IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc, IN PCI_IO_DEVICE *RootBridgeDev)
BOOLEAN IsRejectiveDevice(IN PCI_RESOURCE_NODE *PciResNode)
VOID GetResourceAllocationStatus(VOID *AcpiConfig, OUT UINT64 *IoResStatus, OUT UINT64 *Mem32ResStatus, OUT UINT64 *PMem32ResStatus, OUT UINT64 *Mem64ResStatus, OUT UINT64 *PMem64ResStatus)
EFI_STATUS PreprocessController(IN PCI_IO_DEVICE *Bridge, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func, IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase)
UINT32 GetMaxOptionRomSize(IN PCI_IO_DEVICE *Bridge)
EFI_STATUS PciBridgeEnumerator(IN PCI_IO_DEVICE *BridgeDev)
EFI_STATUS PciHostBridgeAdjustAllocation(IN PCI_RESOURCE_NODE *IoPool, IN PCI_RESOURCE_NODE *Mem32Pool, IN PCI_RESOURCE_NODE *PMem32Pool, IN PCI_RESOURCE_NODE *Mem64Pool, IN PCI_RESOURCE_NODE *PMem64Pool, IN UINT64 IoResStatus, IN UINT64 Mem32ResStatus, IN UINT64 PMem32ResStatus, IN UINT64 Mem64ResStatus, IN UINT64 PMem64ResStatus)
EFI_STATUS ConstructAcpiResourceRequestor(IN PCI_IO_DEVICE *Bridge, IN PCI_RESOURCE_NODE *IoNode, IN PCI_RESOURCE_NODE *Mem32Node, IN PCI_RESOURCE_NODE *PMem32Node, IN PCI_RESOURCE_NODE *Mem64Node, IN PCI_RESOURCE_NODE *PMem64Node, OUT VOID **Config)
EFI_STATUS PciAssignBusNumber(IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber, OUT UINT8 *SubBusNumber)
EFI_STATUS PciEnumerator(IN EFI_HANDLE Controller, IN EFI_HANDLE HostBridgeHandle)
EFI_STATUS NotifyPhase(IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc, EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase)
EFI_STATUS PciHostBridgeP2CProcess(IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc)
EFI_STATUS PciPciDeviceInfoCollector(IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber)
EFI_STATUS PciDevicePresent(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo, OUT PCI_TYPE00 *Pci, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func)
VOID InitializeP2C(IN PCI_IO_DEVICE *PciIoDevice)
EFI_STATUS DetermineDeviceAttribute(IN PCI_IO_DEVICE *PciIoDevice)
VOID InitializePciDevice(IN PCI_IO_DEVICE *PciIoDevice)
VOID ResetAllPpbBusNumber(IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber)
#define EFI_RESOURCE_SATISFIED
#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM
#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE
@ EfiPciHostBridgeEndEnumeration
@ EfiPciHostBridgeBeginEnumeration
EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE
#define EFI_RESOURCE_NOT_SATISFIED
EFI_PCI_HOTPLUG_OPERATION
@ EfiPciHotplugRequestRemove
@ EfiPciHotPlugRequestAdd
EFI_STATUS LoadOpRomImage(IN PCI_IO_DEVICE *PciDevice, IN UINT64 RomBase)
BOOLEAN ResourceRequestExisted(IN PCI_RESOURCE_NODE *Bridge)
EFI_STATUS ProgramResource(IN UINT64 Base, IN PCI_RESOURCE_NODE *Bridge)
VOID CreateResourceMap(IN PCI_IO_DEVICE *Bridge, IN OUT PCI_RESOURCE_NODE *IoNode, IN OUT PCI_RESOURCE_NODE *Mem32Node, IN OUT PCI_RESOURCE_NODE *PMem32Node, IN OUT PCI_RESOURCE_NODE *Mem64Node, IN OUT PCI_RESOURCE_NODE *PMem64Node)
PCI_RESOURCE_NODE * CreateResourceNode(IN PCI_IO_DEVICE *PciDev, IN UINT64 Length, IN UINT64 Alignment, IN UINT8 Bar, IN PCI_BAR_TYPE ResType, IN PCI_RESOURCE_USAGE ResUsage)
VOID DestroyResourceTree(IN PCI_RESOURCE_NODE *Bridge)
#define EFI_IOB_PCI_BUS_ENUM
#define EFI_PROGRESS_CODE
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
EFI_HANDLE DriverBindingHandle
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER PreprocessController
EFI_PCI_PLATFORM_PHASE_NOTIFY PlatformNotify
EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController
EFI_PCI_IO_PROTOCOL_CONFIG Read
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write