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) {
1043 ChildDeviceLink = Bridge->ChildList.ForwardLink;
1044 while (ChildDeviceLink !=
NULL && ChildDeviceLink != &Bridge->ChildList) {
1045 PciIoDevice = PCI_IO_DEVICE_FROM_LINK (ChildDeviceLink);
1046 if (PciIoDevice->RomSize != 0) {
1048 ChildNodeLink = Mem64Node->ChildList.ForwardLink;
1049 while (ChildNodeLink != &Mem64Node->ChildList) {
1050 ResourceNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
1051 NextChildNodeLink = ChildNodeLink->ForwardLink;
1053 if ((ResourceNode->PciDev == PciIoDevice) &&
1054 (ResourceNode->Virtual || !PciIoDevice->PciBar[ResourceNode->Bar].BarTypeFixed)
1061 ChildNodeLink = NextChildNodeLink;
1066 ChildNodeLink = PMem64Node->ChildList.ForwardLink;
1067 while (ChildNodeLink != &PMem64Node->ChildList) {
1068 ResourceNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
1069 NextChildNodeLink = ChildNodeLink->ForwardLink;
1071 if ((ResourceNode->PciDev == PciIoDevice) &&
1072 (ResourceNode->Virtual || !PciIoDevice->PciBar[ResourceNode->Bar].BarTypeFixed)
1079 ChildNodeLink = NextChildNodeLink;
1084 ChildDeviceLink = ChildDeviceLink->ForwardLink;
1092 if (
sizeof (
UINTN) <= 4) {
1151 if (!
IsListEmpty (&PMem64Node->ChildList) && (Bridge->Parent !=
NULL)) {
1212 if (((Bridge->Decodes) &
Decode) != 0) {
1241 if (Base == gAllOne) {
1242 return EFI_OUT_OF_RESOURCES;
1245 CurrentLink = Bridge->ChildList.ForwardLink;
1247 while (CurrentLink != &Bridge->ChildList) {
1248 Node = RESOURCE_NODE_FROM_LINK (CurrentLink);
1267 if (EFI_ERROR (Status)) {
1274 CurrentLink = CurrentLink->ForwardLink;
1297 ASSERT (Node->Bar < PCI_MAX_BAR);
1302 if (Node->Virtual) {
1308 PciIo = &(Node->PciDev->PciIo);
1310 Address = Base + Node->Offset;
1318 Node->PciDev->Allocated =
TRUE;
1320 switch ((Node->PciDev->PciBar[Node->Bar]).BarType) {
1321 case PciBarTypeIo16:
1322 case PciBarTypeIo32:
1323 case PciBarTypeMem32:
1324 case PciBarTypePMem32:
1328 EfiPciIoWidthUint32,
1329 (Node->PciDev->PciBar[Node->Bar]).Offset,
1339 case PciBarTypeOpRom:
1340 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1344 case PciBarTypeMem64:
1345 case PciBarTypePMem64:
1347 Address32 = (UINT32)(Address & 0x00000000FFFFFFFF);
1351 EfiPciIoWidthUint32,
1352 (Node->PciDev->PciBar[Node->Bar]).Offset,
1357 Address32 = (UINT32)
RShiftU64 (Address, 32);
1361 EfiPciIoWidthUint32,
1362 (UINT8)((Node->PciDev->PciBar[Node->Bar]).Offset + 4),
1367 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1393 ASSERT (Node->Bar < PCI_MAX_BAR);
1394 ASSERT (Node->Virtual);
1397 PciIo = &(Node->PciDev->PciIo);
1399 Address = Base + Node->Offset;
1407 Node->PciDev->Allocated =
TRUE;
1409 switch ((Node->PciDev->VfPciBar[Node->Bar]).BarType) {
1410 case PciBarTypeMem32:
1411 case PciBarTypePMem32:
1415 EfiPciIoWidthUint32,
1416 (Node->PciDev->VfPciBar[Node->Bar]).Offset,
1421 Node->PciDev->VfPciBar[Node->Bar].BaseAddress = Address;
1424 case PciBarTypeMem64:
1425 case PciBarTypePMem64:
1427 Address32 = (UINT32)(Address & 0x00000000FFFFFFFF);
1431 EfiPciIoWidthUint32,
1432 (Node->PciDev->VfPciBar[Node->Bar]).Offset,
1437 Address32 = (UINT32)
RShiftU64 (Address, 32);
1441 EfiPciIoWidthUint32,
1442 ((Node->PciDev->VfPciBar[Node->Bar]).Offset + 4),
1447 Node->PciDev->VfPciBar[Node->Bar].BaseAddress = Address;
1450 case PciBarTypeIo16:
1451 case PciBarTypeIo32:
1483 if ((Node->Length == 0) || (Node->ResourceUsage == PciResUsagePadding)) {
1490 PciIo = &(Node->PciDev->PciIo);
1491 Address = Base + Node->Offset;
1496 Node->PciDev->Allocated =
TRUE;
1498 switch (Node->Bar) {
1501 switch ((Node->PciDev->PciBar[Node->Bar]).BarType) {
1502 case PciBarTypeIo16:
1503 case PciBarTypeIo32:
1504 case PciBarTypeMem32:
1505 case PciBarTypePMem32:
1509 EfiPciIoWidthUint32,
1510 (Node->PciDev->PciBar[Node->Bar]).Offset,
1515 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1516 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1519 case PciBarTypeMem64:
1520 case PciBarTypePMem64:
1522 Address32 = (UINT32)(Address & 0x00000000FFFFFFFF);
1526 EfiPciIoWidthUint32,
1527 (Node->PciDev->PciBar[Node->Bar]).Offset,
1532 Address32 = (UINT32)
RShiftU64 (Address, 32);
1536 EfiPciIoWidthUint32,
1537 (UINT8)((Node->PciDev->PciBar[Node->Bar]).Offset + 4),
1542 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1543 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1554 Address32 = ((UINT32)(Address)) >> 8;
1566 EfiPciIoWidthUint16,
1572 Address32 = (UINT32)(Address + Node->Length - 1);
1573 Address32 = ((UINT32)(Address32)) >> 8;
1585 EfiPciIoWidthUint16,
1591 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1592 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1595 case PPB_MEM32_RANGE:
1597 Address32 = ((UINT32)(Address)) >> 16;
1600 EfiPciIoWidthUint16,
1606 Address32 = (UINT32)(Address + Node->Length - 1);
1607 Address32 = ((UINT32)(Address32)) >> 16;
1610 EfiPciIoWidthUint16,
1616 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1617 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1620 case PPB_PMEM32_RANGE:
1621 case PPB_PMEM64_RANGE:
1623 Address32 = ((UINT32)(Address)) >> 16;
1626 EfiPciIoWidthUint16,
1632 Address32 = (UINT32)(Address + Node->Length - 1);
1633 Address32 = ((UINT32)(Address32)) >> 16;
1636 EfiPciIoWidthUint16,
1642 Address32 = (UINT32)
RShiftU64 (Address, 32);
1645 EfiPciIoWidthUint32,
1651 Address32 = (UINT32)
RShiftU64 ((Address + Node->Length - 1), 32);
1654 EfiPciIoWidthUint32,
1660 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1661 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1680 IN UINT32 OptionRomBase,
1692 Parent = PciDevice->Parent;
1693 while (Parent !=
NULL) {
1698 PciIo = &Parent->PciIo;
1707 Base = (UINT16)(OptionRomBase >> 16);
1708 Limit = (UINT16)((OptionRomBase + PciDevice->RomSize - 1) >> 16);
1717 if (Parent->PciBar[PPB_MEM32_RANGE].Length == 0) {
1721 Base = (UINT16)gAllOne;
1722 Limit = (UINT16)gAllZero;
1724 Base = (UINT16)((UINT32)Parent->PciBar[PPB_MEM32_RANGE].BaseAddress >> 16);
1725 Limit = (UINT16)((UINT32)(Parent->PciBar[PPB_MEM32_RANGE].BaseAddress
1726 + Parent->PciBar[PPB_MEM32_RANGE].Length - 1) >> 16);
1735 Parent = Parent->Parent;
1753 if (Bridge !=
NULL) {
1754 if (!
IsListEmpty (&Bridge->ChildList) || (Bridge->Length != 0)) {
1773 IN PCI_BAR_TYPE ResourceType
1777 ResourcePool->ResType = ResourceType;
1778 ResourcePool->Signature = PCI_RESOURCE_SIGNATURE;
1797 CurrentLink = Bridge->ChildList.ForwardLink;
1799 Temp = RESOURCE_NODE_FROM_LINK (CurrentLink);
1926 UINT16 BridgeControl;
1929 PciIo = &(Node->PciDev->PciIo);
1931 Address = Base + Node->Offset;
1939 Node->PciDev->Allocated =
TRUE;
1941 switch (Node->Bar) {
1945 EfiPciIoWidthUint32,
1946 (Node->PciDev->PciBar[Node->Bar]).Offset,
1951 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
1952 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
1958 EfiPciIoWidthUint32,
1959 PCI_CARD_MEMORY_BASE_0,
1964 TempAddress = Address + Node->Length - 1;
1967 EfiPciIoWidthUint32,
1968 PCI_CARD_MEMORY_LIMIT_0,
1973 if (Node->ResType == PciBarTypeMem32) {
1979 EfiPciIoWidthUint16,
1980 PCI_CARD_BRIDGE_CONTROL,
1985 BridgeControl &= (UINT16) ~PCI_CARD_PREFETCHABLE_MEMORY_0_ENABLE;
1988 EfiPciIoWidthUint16,
1989 PCI_CARD_BRIDGE_CONTROL,
1999 EfiPciIoWidthUint16,
2000 PCI_CARD_BRIDGE_CONTROL,
2005 BridgeControl |= PCI_CARD_PREFETCHABLE_MEMORY_0_ENABLE;
2008 EfiPciIoWidthUint16,
2009 PCI_CARD_BRIDGE_CONTROL,
2015 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
2016 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
2017 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
2024 EfiPciIoWidthUint32,
2025 PCI_CARD_MEMORY_BASE_1,
2030 TempAddress = Address + Node->Length - 1;
2034 EfiPciIoWidthUint32,
2035 PCI_CARD_MEMORY_LIMIT_1,
2040 if (Node->ResType == PciBarTypeMem32) {
2046 EfiPciIoWidthUint16,
2047 PCI_CARD_BRIDGE_CONTROL,
2052 BridgeControl &= (UINT16) ~(PCI_CARD_PREFETCHABLE_MEMORY_1_ENABLE);
2055 EfiPciIoWidthUint16,
2056 PCI_CARD_BRIDGE_CONTROL,
2066 EfiPciIoWidthUint16,
2067 PCI_CARD_BRIDGE_CONTROL,
2072 BridgeControl |= PCI_CARD_PREFETCHABLE_MEMORY_1_ENABLE;
2075 EfiPciIoWidthUint16,
2076 PCI_CARD_BRIDGE_CONTROL,
2082 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
2083 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
2084 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
2090 EfiPciIoWidthUint32,
2091 PCI_CARD_IO_BASE_0_LOWER,
2096 TempAddress = Address + Node->Length - 1;
2099 EfiPciIoWidthUint32,
2100 PCI_CARD_IO_LIMIT_0_LOWER,
2105 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
2106 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
2107 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
2114 EfiPciIoWidthUint32,
2115 PCI_CARD_IO_BASE_1_LOWER,
2120 TempAddress = Address + Node->Length - 1;
2123 EfiPciIoWidthUint32,
2124 PCI_CARD_IO_LIMIT_1_LOWER,
2129 Node->PciDev->PciBar[Node->Bar].BaseAddress = Address;
2130 Node->PciDev->PciBar[Node->Bar].Length = Node->Length;
2131 Node->PciDev->PciBar[Node->Bar].BarType = Node->ResType;
2162 UINT8 DummyBarIndex;
2165 Ptr = PciDev->ResourcePaddingDescriptors;
2168 if ((Ptr->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) && (Ptr->ResType == ACPI_ADDRESS_SPACE_TYPE_IO)) {
2169 if (Ptr->AddrLen != 0) {
2188 if ((Ptr->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) && (Ptr->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM)) {
2189 if (Ptr->AddrSpaceGranularity == 32) {
2193 if (Ptr->SpecificFlag == 0x6) {
2194 if (Ptr->AddrLen != 0) {
2216 if (Ptr->SpecificFlag == 0) {
2217 if (Ptr->AddrLen != 0) {
2237 if (Ptr->AddrSpaceGranularity == 64) {
2241 if (Ptr->SpecificFlag == 0x6) {
2242 if (Ptr->AddrLen != 0) {
2264 if (Ptr->SpecificFlag == 0) {
2265 if (Ptr->AddrLen != 0) {
2303 if ((gPciHotPlugInit !=
NULL) &&
FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
2304 if (PciIoDevice->ResourcePaddingDescriptors ==
NULL) {
PACKED struct @100 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