14BOOLEAN mReserveIsaAliases =
FALSE;
15BOOLEAN mReserveVgaAliases =
FALSE;
16BOOLEAN mPolicyDetermined =
FALSE;
36 ASSERT (Start !=
NULL);
43 StartOffset = Original & Mask;
44 LimitOffset = ((*Start) + Length - 1) & Mask;
45 if (LimitOffset >= VGABASE1) {
46 *Start = *Start - StartOffset + VGALIMIT2 + 1;
68 ASSERT (Start !=
NULL);
76 StartOffset = Original & Mask;
77 LimitOffset = ((*Start) + Length - 1) & Mask;
79 if (LimitOffset >= ISABASE) {
80 *Start = *Start - StartOffset + ISALIMIT + 1;
100 UINT64 ResNodeAlignRest;
101 UINT64 TempAlignRest;
103 ASSERT (Bridge !=
NULL);
104 ASSERT (ResNode !=
NULL);
108 CurrentLink = Bridge->ChildList.ForwardLink->ForwardLink;
109 while (CurrentLink != &Bridge->ChildList) {
110 Temp = RESOURCE_NODE_FROM_LINK (CurrentLink);
112 if (ResNode->Alignment > Temp->Alignment) {
114 }
else if (ResNode->Alignment == Temp->Alignment) {
115 ResNodeAlignRest = ResNode->Length & ResNode->Alignment;
116 TempAlignRest = Temp->Length & Temp->Alignment;
117 if ((ResNodeAlignRest == 0) || (ResNodeAlignRest >= TempAlignRest)) {
124 CurrentLink = ResNode->Link.ForwardLink;
156 ASSERT (Dst !=
NULL);
157 ASSERT (Res !=
NULL);
160 CurrentLink = Res->ChildList.ForwardLink;
162 Temp = RESOURCE_NODE_FROM_LINK (CurrentLink);
165 Temp->ResType = Dst->ResType;
191 UINT64 PaddingAperture;
193 if (!mPolicyDetermined) {
197 Status = EFI_NOT_FOUND;
199 if (gPciPlatformProtocol !=
NULL) {
201 gPciPlatformProtocol,
206 if (EFI_ERROR (Status) && (gPciOverrideProtocol !=
NULL)) {
208 gPciOverrideProtocol,
213 if (!EFI_ERROR (Status)) {
215 mReserveIsaAliases =
TRUE;
219 mReserveVgaAliases =
TRUE;
223 mPolicyDetermined =
TRUE;
229 if (Bridge ==
NULL) {
237 ; !
IsNull (&Bridge->ChildList, CurrentLink)
238 ; CurrentLink =
GetNextNode (&Bridge->ChildList, CurrentLink)
241 Node = RESOURCE_NODE_FROM_LINK (CurrentLink);
242 if (Node->ResourceUsage == PciResUsagePadding) {
243 ASSERT (PaddingAperture == 0);
244 PaddingAperture = Node->Length;
251 Offset = Aperture & (Node->Alignment);
254 Aperture = Aperture + (Node->Alignment + 1) - Offset;
262 if (mReserveIsaAliases || mReserveVgaAliases) {
268 if (mReserveIsaAliases) {
273 Offset = Aperture & (Node->Alignment);
275 Aperture = Aperture + (Node->Alignment + 1) - Offset;
277 }
else if (mReserveVgaAliases) {
282 Offset = Aperture & (Node->Alignment);
284 Aperture = Aperture + (Node->Alignment + 1) - Offset;
290 Node->Offset = Aperture;
295 Aperture += Node->Length;
301 Offset = Aperture & (Bridge->Alignment);
304 Aperture = Aperture + (Bridge->Alignment + 1) - Offset;
307 Bridge->Length = Aperture;
312 CurrentLink = Bridge->ChildList.ForwardLink;
313 if (CurrentLink != &Bridge->ChildList) {
314 Node = RESOURCE_NODE_FROM_LINK (CurrentLink);
315 if (Node->Alignment > Bridge->Alignment) {
316 Bridge->Alignment = Node->Alignment;
324 Bridge->Length =
MAX (Bridge->Length, PaddingAperture);
343 if (Bridge ==
NULL) {
347 if (Bridge->ResType == PciBarTypeIo16) {
352 Aperture[PciResUsageTypical] = 0;
353 Aperture[PciResUsagePadding] = 0;
358 ; !
IsNull (&Bridge->ChildList, CurrentLink)
359 ; CurrentLink =
GetNextNode (&Bridge->ChildList, CurrentLink)
362 Node = RESOURCE_NODE_FROM_LINK (CurrentLink);
369 (Node->ResourceUsage == PciResUsageTypical) ||
370 (Node->ResourceUsage == PciResUsagePadding)
372 ASSERT (Node->ResourceUsage <
ARRAY_SIZE (Aperture));
378 Node->Offset =
ALIGN_VALUE (Aperture[Node->ResourceUsage], Node->Alignment + 1);
383 Aperture[Node->ResourceUsage] = Node->Offset + Node->Length;
389 Aperture[PciResUsageTypical] =
ALIGN_VALUE (Aperture[PciResUsageTypical], Bridge->Alignment + 1);
390 Aperture[PciResUsagePadding] =
ALIGN_VALUE (Aperture[PciResUsagePadding], Bridge->Alignment + 1);
396 Bridge->Length =
MAX (Aperture[PciResUsageTypical], Aperture[PciResUsagePadding]);
401 CurrentLink = Bridge->ChildList.ForwardLink;
402 if (CurrentLink != &Bridge->ChildList) {
403 Node = RESOURCE_NODE_FROM_LINK (CurrentLink);
404 if (Node->Alignment > Bridge->Alignment) {
405 Bridge->Alignment = Node->Alignment;
433 BOOLEAN ResourceRequested;
436 ResourceRequested =
FALSE;
438 for (Index = 0; Index < PCI_MAX_BAR; Index++) {
439 switch ((PciDev->PciBar)[Index].BarType) {
440 case PciBarTypeMem32:
441 case PciBarTypeOpRom:
445 (PciDev->PciBar)[Index].Length,
446 (PciDev->PciBar)[Index].Alignment,
448 (PciDev->PciBar)[Index].BarType,
457 ResourceRequested =
TRUE;
460 case PciBarTypeMem64:
464 (PciDev->PciBar)[Index].Length,
465 (PciDev->PciBar)[Index].Alignment,
476 ResourceRequested =
TRUE;
479 case PciBarTypePMem64:
483 (PciDev->PciBar)[Index].Length,
484 (PciDev->PciBar)[Index].Alignment,
495 ResourceRequested =
TRUE;
498 case PciBarTypePMem32:
502 (PciDev->PciBar)[Index].Length,
503 (PciDev->PciBar)[Index].Alignment,
513 ResourceRequested =
TRUE;
521 (PciDev->PciBar)[Index].Length,
522 (PciDev->PciBar)[Index].Alignment,
532 ResourceRequested =
TRUE;
535 case PciBarTypeUnknown:
546 for (Index = 0; Index < PCI_MAX_BAR; Index++) {
547 switch ((PciDev->VfPciBar)[Index].BarType) {
548 case PciBarTypeMem32:
552 (PciDev->VfPciBar)[Index].Length,
553 (PciDev->VfPciBar)[Index].Alignment,
566 case PciBarTypeMem64:
570 (PciDev->VfPciBar)[Index].Length,
571 (PciDev->VfPciBar)[Index].Alignment,
584 case PciBarTypePMem64:
588 (PciDev->VfPciBar)[Index].Length,
589 (PciDev->VfPciBar)[Index].Alignment,
602 case PciBarTypePMem32:
606 (PciDev->VfPciBar)[Index].Length,
607 (PciDev->VfPciBar)[Index].Alignment,
623 case PciBarTypeUnknown:
634 if (!ResourceRequested) {
635 PciDev->Allocated =
TRUE;
659 IN PCI_BAR_TYPE ResType,
660 IN PCI_RESOURCE_USAGE ResUsage
668 ASSERT (Node !=
NULL);
673 Node->Signature = PCI_RESOURCE_SIGNATURE;
674 Node->PciDev = PciDev;
675 Node->Length = Length;
676 Node->Alignment = Alignment;
678 Node->ResType = ResType;
679 Node->Reserved =
FALSE;
680 Node->ResourceUsage = ResUsage;
706 IN PCI_BAR_TYPE ResType,
707 IN PCI_RESOURCE_USAGE ResUsage
717 Node->Virtual =
TRUE;
752 CurrentLink = Bridge->ChildList.ForwardLink;
754 while (CurrentLink !=
NULL && CurrentLink != &Bridge->ChildList) {
755 Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
781 Temp->BridgeIoAlignment,
924 CurrentLink = CurrentLink->ForwardLink;
984 if (PciDev->ResourcePaddingDescriptors !=
NULL) {
1030 ChildDeviceLink = Bridge->ChildList.ForwardLink;
1031 while (ChildDeviceLink !=
NULL && ChildDeviceLink != &Bridge->ChildList) {
1032 PciIoDevice = PCI_IO_DEVICE_FROM_LINK (ChildDeviceLink);
1033 if (PciIoDevice->RomSize != 0) {
1035 ChildNodeLink = Mem64Node->ChildList.ForwardLink;
1036 while (ChildNodeLink != &Mem64Node->ChildList) {
1037 ResourceNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
1038 NextChildNodeLink = ChildNodeLink->ForwardLink;
1040 if ((ResourceNode->PciDev == PciIoDevice) &&
1041 (ResourceNode->Virtual || !PciIoDevice->PciBar[ResourceNode->Bar].BarTypeFixed)
1048 ChildNodeLink = NextChildNodeLink;
1053 ChildNodeLink = PMem64Node->ChildList.ForwardLink;
1054 while (ChildNodeLink != &PMem64Node->ChildList) {
1055 ResourceNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
1056 NextChildNodeLink = ChildNodeLink->ForwardLink;
1058 if ((ResourceNode->PciDev == PciIoDevice) &&
1059 (ResourceNode->Virtual || !PciIoDevice->PciBar[ResourceNode->Bar].BarTypeFixed)
1066 ChildNodeLink = NextChildNodeLink;
1071 ChildDeviceLink = ChildDeviceLink->ForwardLink;
1079 if (
sizeof (
UINTN) <= 4) {
1118 if (!
IsListEmpty (&PMem64Node->ChildList) && (Bridge->Parent !=
NULL)) {
1179 if (((Bridge->Decodes) &
Decode) != 0) {
1208 if (Base == gAllOne) {
1209 return EFI_OUT_OF_RESOURCES;
1212 CurrentLink = Bridge->ChildList.ForwardLink;
1214 while (CurrentLink != &Bridge->ChildList) {
1215 Node = RESOURCE_NODE_FROM_LINK (CurrentLink);
1234 if (EFI_ERROR (Status)) {
1241 CurrentLink = CurrentLink->ForwardLink;
1264 ASSERT (Node->Bar < PCI_MAX_BAR);
1269 if (Node->Virtual) {
1275 PciIo = &(Node->PciDev->PciIo);
1277 Address = Base + Node->Offset;
1285 Node->PciDev->Allocated =
TRUE;
1287 switch ((Node->PciDev->PciBar[Node->Bar]).BarType) {
1288 case PciBarTypeIo16:
1289 case PciBarTypeIo32:
1290 case PciBarTypeMem32:
1291 case PciBarTypePMem32:
1295 EfiPciIoWidthUint32,
1296 (Node->PciDev->PciBar[Node->Bar]).Offset,
1306 case PciBarTypeOpRom:
1307 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1311 case PciBarTypeMem64:
1312 case PciBarTypePMem64:
1314 Address32 = (UINT32)(Address & 0x00000000FFFFFFFF);
1318 EfiPciIoWidthUint32,
1319 (Node->PciDev->PciBar[Node->Bar]).Offset,
1324 Address32 = (UINT32)
RShiftU64 (Address, 32);
1328 EfiPciIoWidthUint32,
1329 (UINT8)((Node->PciDev->PciBar[Node->Bar]).Offset + 4),
1334 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1360 ASSERT (Node->Bar < PCI_MAX_BAR);
1361 ASSERT (Node->Virtual);
1364 PciIo = &(Node->PciDev->PciIo);
1366 Address = Base + Node->Offset;
1374 Node->PciDev->Allocated =
TRUE;
1376 switch ((Node->PciDev->VfPciBar[Node->Bar]).BarType) {
1377 case PciBarTypeMem32:
1378 case PciBarTypePMem32:
1382 EfiPciIoWidthUint32,
1383 (Node->PciDev->VfPciBar[Node->Bar]).Offset,
1388 Node->PciDev->VfPciBar[Node->Bar].BaseAddress = Address;
1391 case PciBarTypeMem64:
1392 case PciBarTypePMem64:
1394 Address32 = (UINT32)(Address & 0x00000000FFFFFFFF);
1398 EfiPciIoWidthUint32,
1399 (Node->PciDev->VfPciBar[Node->Bar]).Offset,
1404 Address32 = (UINT32)
RShiftU64 (Address, 32);
1408 EfiPciIoWidthUint32,
1409 ((Node->PciDev->VfPciBar[Node->Bar]).Offset + 4),
1414 Node->PciDev->VfPciBar[Node->Bar].BaseAddress = Address;
1417 case PciBarTypeIo16:
1418 case PciBarTypeIo32:
1450 if ((Node->Length == 0) || (Node->ResourceUsage == PciResUsagePadding)) {
1457 PciIo = &(Node->PciDev->PciIo);
1458 Address = Base + Node->Offset;
1463 Node->PciDev->Allocated =
TRUE;
1465 switch (Node->Bar) {
1468 switch ((Node->PciDev->PciBar[Node->Bar]).BarType) {
1469 case PciBarTypeIo16:
1470 case PciBarTypeIo32:
1471 case PciBarTypeMem32:
1472 case PciBarTypePMem32:
1476 EfiPciIoWidthUint32,
1477 (Node->PciDev->PciBar[Node->Bar]).Offset,
1482 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1483 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1486 case PciBarTypeMem64:
1487 case PciBarTypePMem64:
1489 Address32 = (UINT32)(Address & 0x00000000FFFFFFFF);
1493 EfiPciIoWidthUint32,
1494 (Node->PciDev->PciBar[Node->Bar]).Offset,
1499 Address32 = (UINT32)
RShiftU64 (Address, 32);
1503 EfiPciIoWidthUint32,
1504 (UINT8)((Node->PciDev->PciBar[Node->Bar]).Offset + 4),
1509 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1510 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1521 Address32 = ((UINT32)(Address)) >> 8;
1533 EfiPciIoWidthUint16,
1539 Address32 = (UINT32)(Address + Node->Length - 1);
1540 Address32 = ((UINT32)(Address32)) >> 8;
1552 EfiPciIoWidthUint16,
1558 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1559 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1562 case PPB_MEM32_RANGE:
1564 Address32 = ((UINT32)(Address)) >> 16;
1567 EfiPciIoWidthUint16,
1573 Address32 = (UINT32)(Address + Node->Length - 1);
1574 Address32 = ((UINT32)(Address32)) >> 16;
1577 EfiPciIoWidthUint16,
1583 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1584 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1587 case PPB_PMEM32_RANGE:
1588 case PPB_PMEM64_RANGE:
1590 Address32 = ((UINT32)(Address)) >> 16;
1593 EfiPciIoWidthUint16,
1599 Address32 = (UINT32)(Address + Node->Length - 1);
1600 Address32 = ((UINT32)(Address32)) >> 16;
1603 EfiPciIoWidthUint16,
1609 Address32 = (UINT32)
RShiftU64 (Address, 32);
1612 EfiPciIoWidthUint32,
1618 Address32 = (UINT32)
RShiftU64 ((Address + Node->Length - 1), 32);
1621 EfiPciIoWidthUint32,
1627 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1628 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1647 IN UINT32 OptionRomBase,
1659 Parent = PciDevice->Parent;
1660 while (Parent !=
NULL) {
1665 PciIo = &Parent->PciIo;
1674 Base = (UINT16)(OptionRomBase >> 16);
1675 Limit = (UINT16)((OptionRomBase + PciDevice->RomSize - 1) >> 16);
1684 if (Parent->PciBar[PPB_MEM32_RANGE].Length == 0) {
1688 Base = (UINT16)gAllOne;
1689 Limit = (UINT16)gAllZero;
1691 Base = (UINT16)((UINT32)Parent->PciBar[PPB_MEM32_RANGE].BaseAddress >> 16);
1692 Limit = (UINT16)((UINT32)(Parent->PciBar[PPB_MEM32_RANGE].BaseAddress
1693 + Parent->PciBar[PPB_MEM32_RANGE].Length - 1) >> 16);
1702 Parent = Parent->Parent;
1720 if (Bridge !=
NULL) {
1721 if (!
IsListEmpty (&Bridge->ChildList) || (Bridge->Length != 0)) {
1740 IN PCI_BAR_TYPE ResourceType
1744 ResourcePool->ResType = ResourceType;
1745 ResourcePool->Signature = PCI_RESOURCE_SIGNATURE;
1764 CurrentLink = Bridge->ChildList.ForwardLink;
1766 Temp = RESOURCE_NODE_FROM_LINK (CurrentLink);
1893 UINT16 BridgeControl;
1896 PciIo = &(Node->PciDev->PciIo);
1898 Address = Base + Node->Offset;
1906 Node->PciDev->Allocated =
TRUE;
1908 switch (Node->Bar) {
1912 EfiPciIoWidthUint32,
1913 (Node->PciDev->PciBar[Node->Bar]).Offset,
1918 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1919 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1925 EfiPciIoWidthUint32,
1926 PCI_CARD_MEMORY_BASE_0,
1931 TempAddress = Address + Node->Length - 1;
1934 EfiPciIoWidthUint32,
1935 PCI_CARD_MEMORY_LIMIT_0,
1940 if (Node->ResType == PciBarTypeMem32) {
1946 EfiPciIoWidthUint16,
1947 PCI_CARD_BRIDGE_CONTROL,
1952 BridgeControl &= (UINT16) ~PCI_CARD_PREFETCHABLE_MEMORY_0_ENABLE;
1955 EfiPciIoWidthUint16,
1956 PCI_CARD_BRIDGE_CONTROL,
1966 EfiPciIoWidthUint16,
1967 PCI_CARD_BRIDGE_CONTROL,
1972 BridgeControl |= PCI_CARD_PREFETCHABLE_MEMORY_0_ENABLE;
1975 EfiPciIoWidthUint16,
1976 PCI_CARD_BRIDGE_CONTROL,
1982 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1983 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1984 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
1991 EfiPciIoWidthUint32,
1992 PCI_CARD_MEMORY_BASE_1,
1997 TempAddress = Address + Node->Length - 1;
2001 EfiPciIoWidthUint32,
2002 PCI_CARD_MEMORY_LIMIT_1,
2007 if (Node->ResType == PciBarTypeMem32) {
2013 EfiPciIoWidthUint16,
2014 PCI_CARD_BRIDGE_CONTROL,
2019 BridgeControl &= (UINT16) ~(PCI_CARD_PREFETCHABLE_MEMORY_1_ENABLE);
2022 EfiPciIoWidthUint16,
2023 PCI_CARD_BRIDGE_CONTROL,
2033 EfiPciIoWidthUint16,
2034 PCI_CARD_BRIDGE_CONTROL,
2039 BridgeControl |= PCI_CARD_PREFETCHABLE_MEMORY_1_ENABLE;
2042 EfiPciIoWidthUint16,
2043 PCI_CARD_BRIDGE_CONTROL,
2049 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
2050 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
2051 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
2057 EfiPciIoWidthUint32,
2058 PCI_CARD_IO_BASE_0_LOWER,
2063 TempAddress = Address + Node->Length - 1;
2066 EfiPciIoWidthUint32,
2067 PCI_CARD_IO_LIMIT_0_LOWER,
2072 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
2073 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
2074 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
2081 EfiPciIoWidthUint32,
2082 PCI_CARD_IO_BASE_1_LOWER,
2087 TempAddress = Address + Node->Length - 1;
2090 EfiPciIoWidthUint32,
2091 PCI_CARD_IO_LIMIT_1_LOWER,
2096 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
2097 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
2098 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
2129 UINT8 DummyBarIndex;
2132 Ptr = PciDev->ResourcePaddingDescriptors;
2135 if ((Ptr->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) && (Ptr->ResType == ACPI_ADDRESS_SPACE_TYPE_IO)) {
2136 if (Ptr->AddrLen != 0) {
2155 if ((Ptr->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) && (Ptr->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM)) {
2156 if (Ptr->AddrSpaceGranularity == 32) {
2160 if (Ptr->SpecificFlag == 0x6) {
2161 if (Ptr->AddrLen != 0) {
2183 if (Ptr->SpecificFlag == 0) {
2184 if (Ptr->AddrLen != 0) {
2204 if (Ptr->AddrSpaceGranularity == 64) {
2208 if (Ptr->SpecificFlag == 0x6) {
2209 if (Ptr->AddrLen != 0) {
2231 if (Ptr->SpecificFlag == 0) {
2232 if (Ptr->AddrLen != 0) {
2270 if ((gPciHotPlugInit !=
NULL) &&
FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
2271 if (PciIoDevice->ResourcePaddingDescriptors ==
NULL) {
PACKED struct @89 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI SwapListEntries(IN OUT LIST_ENTRY *FirstEntry, IN OUT LIST_ENTRY *SecondEntry)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID Decode(SCRATCH_DATA *Sd)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ALIGN_VALUE(Value, Alignment)
#define ARRAY_SIZE(Array)
#define OFFSET_OF(TYPE, Field)
#define FeaturePcdGet(TokenName)
#define IS_PCI_BRIDGE(_p)
#define EFI_PCI_COMMAND_MEMORY_SPACE
0x0002
#define IS_CARDBUS_BRIDGE(_p)
#define PCI_DISABLE_COMMAND_REGISTER(a, b)
#define PCI_ENABLE_COMMAND_REGISTER(a, b)
VOID GetResourcePaddingForHpb(IN PCI_IO_DEVICE *PciIoDevice)
BOOLEAN ResourceRequestExisted(IN PCI_RESOURCE_NODE *Bridge)
VOID GetResourcePaddingPpb(IN PCI_IO_DEVICE *PciIoDevice)
BOOLEAN BridgeSupportResourceDecode(IN PCI_IO_DEVICE *Bridge, IN UINT32 Decode)
VOID SkipIsaAliasAperture(OUT UINT64 *Start, IN UINT64 Length)
VOID CalculateApertureIo16(IN PCI_RESOURCE_NODE *Bridge)
PCI_RESOURCE_NODE * CreateVfResourceNode(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 SkipVGAAperture(OUT UINT64 *Start, IN UINT64 Length)
VOID ApplyResourcePadding(IN PCI_IO_DEVICE *PciDev, 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)
VOID ResourcePaddingForCardBusBridge(IN PCI_IO_DEVICE *PciDev, 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)
VOID GetResourceFromDevice(IN PCI_IO_DEVICE *PciDev, 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)
VOID ResourcePaddingPolicy(IN PCI_IO_DEVICE *PciDev, 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)
EFI_STATUS ProgramVfBar(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
VOID ProgramUpstreamBridgeForRom(IN PCI_IO_DEVICE *PciDevice, IN UINT32 OptionRomBase, IN BOOLEAN Enable)
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)
VOID InitializeResourcePool(IN OUT PCI_RESOURCE_NODE *ResourcePool, IN PCI_BAR_TYPE ResourceType)
VOID ProgramBar(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
VOID DegradeResource(IN PCI_IO_DEVICE *Bridge, IN PCI_RESOURCE_NODE *Mem32Node, IN PCI_RESOURCE_NODE *PMem32Node, IN PCI_RESOURCE_NODE *Mem64Node, IN PCI_RESOURCE_NODE *PMem64Node)
VOID InsertResourceNode(IN OUT PCI_RESOURCE_NODE *Bridge, IN PCI_RESOURCE_NODE *ResNode)
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 CalculateResourceAperture(IN PCI_RESOURCE_NODE *Bridge)
VOID MergeResourceTree(IN PCI_RESOURCE_NODE *Dst, IN PCI_RESOURCE_NODE *Res, IN BOOLEAN TypeMerge)
VOID DestroyResourceTree(IN PCI_RESOURCE_NODE *Bridge)
VOID ProgramPpbApperture(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
VOID ProgramP2C(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
EFI_PCI_PLATFORM_GET_PLATFORM_POLICY GetPlatformPolicy
EFI_PCI_IO_PROTOCOL_CONFIG Read
EFI_PCI_IO_PROTOCOL_CONFIG Write