17#define MINIMUM_INITIAL_MEMORY_SIZE 0x10000
19#define MEMORY_ATTRIBUTE_MASK (EFI_RESOURCE_ATTRIBUTE_PRESENT | \
20 EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \
21 EFI_RESOURCE_ATTRIBUTE_TESTED | \
22 EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED | \
23 EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED | \
24 EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED | \
25 EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED | \
26 EFI_RESOURCE_ATTRIBUTE_16_BIT_IO | \
27 EFI_RESOURCE_ATTRIBUTE_32_BIT_IO | \
28 EFI_RESOURCE_ATTRIBUTE_64_BIT_IO | \
29 EFI_RESOURCE_ATTRIBUTE_PERSISTENT )
31#define TESTED_MEMORY_ATTRIBUTES (EFI_RESOURCE_ATTRIBUTE_PRESENT | \
32 EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \
33 EFI_RESOURCE_ATTRIBUTE_TESTED )
35#define INITIALIZED_MEMORY_ATTRIBUTES (EFI_RESOURCE_ATTRIBUTE_PRESENT |\
36 EFI_RESOURCE_ATTRIBUTE_INITIALIZED )
38#define PRESENT_MEMORY_ATTRIBUTES (EFI_RESOURCE_ATTRIBUTE_PRESENT)
49 EFI_GCD_MAP_SIGNATURE,
65 EFI_GCD_MAP_SIGNATURE,
81 { EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE, EFI_MEMORY_UC,
TRUE },
82 { EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED, EFI_MEMORY_UCE,
TRUE },
83 { EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE, EFI_MEMORY_WC,
TRUE },
84 { EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE, EFI_MEMORY_WT,
TRUE },
85 { EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE, EFI_MEMORY_WB,
TRUE },
86 { EFI_RESOURCE_ATTRIBUTE_READ_PROTECTABLE, EFI_MEMORY_RP,
TRUE },
87 { EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE, EFI_MEMORY_WP,
TRUE },
88 { EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTABLE, EFI_MEMORY_XP,
TRUE },
89 { EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE, EFI_MEMORY_RO,
TRUE },
90 { EFI_RESOURCE_ATTRIBUTE_PRESENT, EFI_MEMORY_PRESENT,
FALSE },
91 { EFI_RESOURCE_ATTRIBUTE_INITIALIZED, EFI_MEMORY_INITIALIZED,
FALSE },
92 { EFI_RESOURCE_ATTRIBUTE_TESTED, EFI_MEMORY_TESTED,
FALSE },
93 { EFI_RESOURCE_ATTRIBUTE_PERSISTABLE, EFI_MEMORY_NV,
TRUE },
94 { EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE, EFI_MEMORY_MORE_RELIABLE,
TRUE },
95 { EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE, EFI_MEMORY_SP,
TRUE },
127 "AnySearchBottomUp ",
128 "MaxAddressSearchBottomUp ",
131 "MaxAddressSearchTopDown ",
150 UINTN NumberOfDescriptors;
158 DEBUG ((DEBUG_GCD,
"GCD:Initial GCD Memory Space Map\n"));
161 DEBUG ((DEBUG_GCD,
"GCDMemType Range Capabilities Attributes \n"));
162 DEBUG ((DEBUG_GCD,
"========== ================================= ================ ================\n"));
163 for (Index = 0; Index < NumberOfDescriptors; Index++) {
166 "%a %016lx-%016lx %016lx %016lx%c\n",
168 MemorySpaceMap[Index].BaseAddress,
169 MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - 1,
170 MemorySpaceMap[Index].Capabilities,
171 MemorySpaceMap[Index].Attributes,
172 MemorySpaceMap[Index].ImageHandle ==
NULL ?
' ' :
'*'
176 DEBUG ((DEBUG_GCD,
"\n"));
196 UINTN NumberOfDescriptors;
204 DEBUG ((DEBUG_GCD,
"GCD:Initial GCD I/O Space Map\n"));
207 DEBUG ((DEBUG_GCD,
"GCDIoType Range \n"));
208 DEBUG ((DEBUG_GCD,
"========== =================================\n"));
209 for (Index = 0; Index < NumberOfDescriptors; Index++) {
212 "%a %016lx-%016lx%c\n",
214 IoSpaceMap[Index].BaseAddress,
215 IoSpaceMap[Index].BaseAddress + IoSpaceMap[Index].Length - 1,
216 IoSpaceMap[Index].ImageHandle ==
NULL ?
' ' :
'*'
220 DEBUG ((DEBUG_GCD,
"\n"));
240 ((Attributes & EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED) == 0) ||
241 ((Attributes & EFI_RESOURCE_ATTRIBUTE_READ_PROTECTABLE) != 0)
244 ((Attributes & EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED) == 0) ||
245 ((Attributes & EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE) != 0)
248 ((Attributes & EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED) == 0) ||
249 ((Attributes & EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTABLE) != 0)
252 ((Attributes & EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED) == 0) ||
253 ((Attributes & EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE) != 0)
256 ((Attributes & EFI_RESOURCE_ATTRIBUTE_PERSISTENT) == 0) ||
257 ((Attributes & EFI_RESOURCE_ATTRIBUTE_PERSISTABLE) != 0)
332 UINT64 AlignmentMask;
334 AlignmentMask =
LShiftU64 (1, Alignment) - 1;
336 Value += AlignmentMask;
339 return Value & (~AlignmentMask);
402 if (*TopEntry ==
NULL) {
403 return EFI_OUT_OF_RESOURCES;
409 if (*BottomEntry ==
NULL) {
411 return EFI_OUT_OF_RESOURCES;
441 ASSERT (Length != 0);
443 if (BaseAddress > Entry->BaseAddress) {
444 ASSERT (BottomEntry->Signature == 0);
447 Entry->BaseAddress = BaseAddress;
448 BottomEntry->EndAddress = BaseAddress - 1;
452 if ((BaseAddress + Length - 1) < Entry->EndAddress) {
453 ASSERT (TopEntry->Signature == 0);
456 TopEntry->BaseAddress = BaseAddress + Length;
457 Entry->EndAddress = BaseAddress + Length - 1;
491 AdjacentLink = Link->ForwardLink;
493 AdjacentLink = Link->BackLink;
499 if (AdjacentLink == Map) {
506 if (Entry->Capabilities != AdjacentEntry->Capabilities) {
507 return EFI_UNSUPPORTED;
510 if (Entry->Attributes != AdjacentEntry->Attributes) {
511 return EFI_UNSUPPORTED;
514 if (Entry->GcdMemoryType != AdjacentEntry->GcdMemoryType) {
515 return EFI_UNSUPPORTED;
518 if (Entry->GcdIoType != AdjacentEntry->GcdIoType) {
519 return EFI_UNSUPPORTED;
522 if (Entry->ImageHandle != AdjacentEntry->ImageHandle) {
523 return EFI_UNSUPPORTED;
526 if (Entry->DeviceHandle != AdjacentEntry->DeviceHandle) {
527 return EFI_UNSUPPORTED;
531 Entry->EndAddress = AdjacentEntry->EndAddress;
533 Entry->BaseAddress = AdjacentEntry->BaseAddress;
565 if (TopEntry->Signature == 0) {
569 if (BottomEntry->Signature == 0) {
574 while (Link != EndLink->ForwardLink) {
576 Link = Link->ForwardLink;
611 ASSERT (Length != 0);
616 Link = Map->ForwardLink;
617 while (Link != Map) {
619 if ((BaseAddress >= Entry->BaseAddress) && (BaseAddress <= Entry->EndAddress)) {
623 if (*StartLink !=
NULL) {
624 if (((BaseAddress + Length - 1) >= Entry->BaseAddress) &&
625 ((BaseAddress + Length - 1) <= Entry->EndAddress))
632 Link = Link->ForwardLink;
635 return EFI_NOT_FOUND;
655 Link = Map->ForwardLink;
656 while (Link != Map) {
658 Link = Link->ForwardLink;
677 UINT64 CpuArchAttributes;
679 CpuArchAttributes = Attributes & EFI_MEMORY_ATTRIBUTE_MASK;
681 if ((Attributes & EFI_MEMORY_UC) == EFI_MEMORY_UC) {
682 CpuArchAttributes |= EFI_MEMORY_UC;
683 }
else if ((Attributes & EFI_MEMORY_WC) == EFI_MEMORY_WC) {
684 CpuArchAttributes |= EFI_MEMORY_WC;
685 }
else if ((Attributes & EFI_MEMORY_WT) == EFI_MEMORY_WT) {
686 CpuArchAttributes |= EFI_MEMORY_WT;
687 }
else if ((Attributes & EFI_MEMORY_WB) == EFI_MEMORY_WB) {
688 CpuArchAttributes |= EFI_MEMORY_WB;
689 }
else if ((Attributes & EFI_MEMORY_UCE) == EFI_MEMORY_UCE) {
690 CpuArchAttributes |= EFI_MEMORY_UCE;
691 }
else if ((Attributes & EFI_MEMORY_WP) == EFI_MEMORY_WP) {
692 CpuArchAttributes |= EFI_MEMORY_WP;
695 return CpuArchAttributes;
729 IN UINT64 Capabilities,
741 UINT64 CpuArchAttributes;
744 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_INVALID_PARAMETER));
745 return EFI_INVALID_PARAMETER;
749 if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {
751 Map = &mGcdMemorySpaceMap;
752 }
else if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {
754 Map = &mGcdIoSpaceMap;
763 if (EFI_ERROR (Status)) {
764 Status = EFI_UNSUPPORTED;
769 ASSERT (StartLink !=
NULL && EndLink !=
NULL);
775 while (Link != EndLink->ForwardLink) {
781 case GCD_ADD_MEMORY_OPERATION:
783 (Entry->ImageHandle !=
NULL))
785 Status = EFI_ACCESS_DENIED;
790 case GCD_ADD_IO_OPERATION:
792 (Entry->ImageHandle !=
NULL))
794 Status = EFI_ACCESS_DENIED;
802 case GCD_FREE_MEMORY_OPERATION:
803 case GCD_FREE_IO_OPERATION:
804 if (Entry->ImageHandle ==
NULL) {
805 Status = EFI_NOT_FOUND;
813 case GCD_REMOVE_MEMORY_OPERATION:
815 Status = EFI_NOT_FOUND;
819 if (Entry->ImageHandle !=
NULL) {
820 Status = EFI_ACCESS_DENIED;
825 case GCD_REMOVE_IO_OPERATION:
827 Status = EFI_NOT_FOUND;
831 if (Entry->ImageHandle !=
NULL) {
832 Status = EFI_ACCESS_DENIED;
840 case GCD_SET_ATTRIBUTES_MEMORY_OPERATION:
841 if ((Attributes & EFI_MEMORY_RUNTIME) != 0) {
842 if (((BaseAddress & EFI_PAGE_MASK) != 0) || ((Length & EFI_PAGE_MASK) != 0)) {
843 Status = EFI_INVALID_PARAMETER;
848 if ((Entry->Capabilities & Attributes) != Attributes) {
849 Status = EFI_UNSUPPORTED;
857 case GCD_SET_CAPABILITIES_MEMORY_OPERATION:
858 if (((BaseAddress & EFI_PAGE_MASK) != 0) || ((Length & EFI_PAGE_MASK) != 0)) {
859 Status = EFI_INVALID_PARAMETER;
867 if ((Capabilities & Entry->Attributes) != Entry->Attributes) {
868 Status = EFI_UNSUPPORTED;
875 Link = Link->ForwardLink;
882 if (EFI_ERROR (Status)) {
883 Status = EFI_OUT_OF_RESOURCES;
887 ASSERT (TopEntry !=
NULL && BottomEntry !=
NULL);
892 CpuArchAttributes = 0;
893 if (Operation == GCD_SET_ATTRIBUTES_MEMORY_OPERATION) {
912 if (CpuArchAttributes != 0) {
916 Status = gCpu->SetMemoryAttributes (
924 if (EFI_ERROR (Status)) {
936 while (Link != EndLink->ForwardLink) {
943 case GCD_ADD_MEMORY_OPERATION:
944 Entry->GcdMemoryType = GcdMemoryType;
946 Entry->Capabilities = Capabilities | EFI_MEMORY_RUNTIME | EFI_MEMORY_PORT_IO;
948 Entry->Capabilities = Capabilities | EFI_MEMORY_RUNTIME;
952 case GCD_ADD_IO_OPERATION:
953 Entry->GcdIoType = GcdIoType;
958 case GCD_FREE_MEMORY_OPERATION:
959 case GCD_FREE_IO_OPERATION:
960 Entry->ImageHandle =
NULL;
961 Entry->DeviceHandle =
NULL;
966 case GCD_REMOVE_MEMORY_OPERATION:
968 Entry->Capabilities = 0;
970 case GCD_REMOVE_IO_OPERATION:
976 case GCD_SET_ATTRIBUTES_MEMORY_OPERATION:
977 if (CpuArchAttributes == 0) {
982 Attributes |= (Entry->Attributes & (EFI_CACHE_ATTRIBUTE_MASK | EFI_MEMORY_ATTRIBUTE_MASK));
985 Entry->Attributes = Attributes;
990 case GCD_SET_CAPABILITIES_MEMORY_OPERATION:
991 Entry->Capabilities = Capabilities;
1002 Capabilities & (~EFI_MEMORY_RUNTIME)
1009 Link = Link->ForwardLink;
1018 DEBUG ((DEBUG_GCD,
" Status = %r\n", Status));
1020 if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {
1025 if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {
1056 if (Entry->ImageHandle !=
NULL) {
1057 return EFI_NOT_FOUND;
1060 switch (Operation) {
1061 case GCD_ALLOCATE_MEMORY_OPERATION:
1062 if (Entry->GcdMemoryType != GcdMemoryType) {
1063 return EFI_NOT_FOUND;
1067 case GCD_ALLOCATE_IO_OPERATION:
1068 if (Entry->GcdIoType != GcdIoType) {
1069 return EFI_NOT_FOUND;
1074 return EFI_UNSUPPORTED;
1127 if ((UINT32)GcdAllocateType >= EfiGcdMaxAllocateType) {
1128 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_INVALID_PARAMETER));
1129 return EFI_INVALID_PARAMETER;
1132 if ((UINT32)GcdMemoryType >= EfiGcdMemoryTypeMaximum) {
1133 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_INVALID_PARAMETER));
1134 return EFI_INVALID_PARAMETER;
1137 if ((UINT32)GcdIoType >= EfiGcdIoTypeMaximum) {
1138 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_INVALID_PARAMETER));
1139 return EFI_INVALID_PARAMETER;
1142 if (BaseAddress ==
NULL) {
1143 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_INVALID_PARAMETER));
1144 return EFI_INVALID_PARAMETER;
1147 if (ImageHandle ==
NULL) {
1148 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_INVALID_PARAMETER));
1149 return EFI_INVALID_PARAMETER;
1152 if (Alignment >= 64) {
1153 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_NOT_FOUND));
1154 return EFI_NOT_FOUND;
1158 DEBUG ((DEBUG_GCD,
" Status = %r\n", EFI_INVALID_PARAMETER));
1159 return EFI_INVALID_PARAMETER;
1163 if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {
1165 Map = &mGcdMemorySpaceMap;
1166 }
else if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {
1168 Map = &mGcdIoSpaceMap;
1179 AlignmentMask =
LShiftU64 (1, Alignment) - 1;
1185 if ((*BaseAddress & AlignmentMask) != 0) {
1186 Status = EFI_NOT_FOUND;
1194 if (EFI_ERROR (Status)) {
1195 Status = EFI_NOT_FOUND;
1199 ASSERT (StartLink !=
NULL && EndLink !=
NULL);
1205 while (Link != EndLink->ForwardLink) {
1207 Link = Link->ForwardLink;
1209 if (EFI_ERROR (Status)) {
1224 MaxAddress = *BaseAddress;
1226 MaxAddress = Entry->EndAddress;
1235 Link = Map->BackLink;
1237 Link = Map->ForwardLink;
1240 while (Link != Map) {
1246 Link = Link->BackLink;
1248 Link = Link->ForwardLink;
1252 if (EFI_ERROR (Status)) {
1259 if ((Entry->BaseAddress + Length) > MaxAddress) {
1263 if (Length > (Entry->EndAddress + 1)) {
1264 Status = EFI_NOT_FOUND;
1268 if (Entry->EndAddress > MaxAddress) {
1269 *BaseAddress = MaxAddress;
1271 *BaseAddress = Entry->EndAddress;
1274 *BaseAddress = (*BaseAddress + 1 - Length) & (~AlignmentMask);
1276 *BaseAddress = (Entry->BaseAddress + AlignmentMask) & (~AlignmentMask);
1277 if ((*BaseAddress + Length - 1) > MaxAddress) {
1278 Status = EFI_NOT_FOUND;
1287 if (EFI_ERROR (Status)) {
1288 Status = EFI_NOT_FOUND;
1292 ASSERT (StartLink !=
NULL && EndLink !=
NULL);
1299 SubLink = StartLink;
1300 while (SubLink != EndLink->ForwardLink) {
1303 if (EFI_ERROR (Status)) {
1309 SubLink = SubLink->ForwardLink;
1319 Status = EFI_NOT_FOUND;
1327 if (EFI_ERROR (Status)) {
1328 Status = EFI_OUT_OF_RESOURCES;
1332 ASSERT (TopEntry !=
NULL && BottomEntry !=
NULL);
1338 while (Link != EndLink->ForwardLink) {
1341 Entry->ImageHandle = ImageHandle;
1342 Entry->DeviceHandle = DeviceHandle;
1343 Link = Link->ForwardLink;
1352 DEBUG ((DEBUG_GCD,
" Status = %r", Status));
1353 if (!EFI_ERROR (Status)) {
1354 DEBUG ((DEBUG_GCD,
" (BaseAddress = %016lx)", *BaseAddress));
1357 DEBUG ((DEBUG_GCD,
"\n"));
1359 if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {
1364 if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {
1389 IN UINT64 Capabilities
1392 DEBUG ((DEBUG_GCD,
"GCD:AddMemorySpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1394 DEBUG ((DEBUG_GCD,
" Capabilities = %016lx\n", Capabilities));
1400 return EFI_INVALID_PARAMETER;
1439 if (BaseAddress !=
NULL) {
1440 DEBUG ((DEBUG_GCD,
"GCD:AllocateMemorySpace(Base=%016lx,Length=%016lx)\n", *BaseAddress, Length));
1442 DEBUG ((DEBUG_GCD,
"GCD:AllocateMemorySpace(Base=<NULL>,Length=%016lx)\n", Length));
1447 DEBUG ((DEBUG_GCD,
" Alignment = %016lx\n",
LShiftU64 (1, Alignment)));
1448 DEBUG ((DEBUG_GCD,
" ImageHandle = %p\n", ImageHandle));
1449 DEBUG ((DEBUG_GCD,
" DeviceHandle = %p\n", DeviceHandle));
1452 GCD_ALLOCATE_MEMORY_OPERATION,
1482 IN UINT64 Capabilities
1493 PageLength =
PageAlignLength (BaseAddress + Length - PageBaseAddress);
1501 gDxeCoreImageHandle,
1505 if (!EFI_ERROR (Status)) {
1513 for ( ; PageLength != 0; PageLength -= EFI_PAGE_SIZE, PageBaseAddress += EFI_PAGE_SIZE) {
1520 gDxeCoreImageHandle,
1524 if (!EFI_ERROR (Status)) {
1556 DEBUG ((DEBUG_GCD,
"GCD:FreeMemorySpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1578 DEBUG ((DEBUG_GCD,
"GCD:RemoveMemorySpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1596 Descriptor->BaseAddress = Entry->BaseAddress;
1597 Descriptor->Length = Entry->EndAddress - Entry->BaseAddress + 1;
1598 Descriptor->Capabilities = Entry->Capabilities;
1599 Descriptor->Attributes = Entry->Attributes;
1600 Descriptor->GcdMemoryType = Entry->GcdMemoryType;
1601 Descriptor->ImageHandle = Entry->ImageHandle;
1602 Descriptor->DeviceHandle = Entry->DeviceHandle;
1630 if (Descriptor ==
NULL) {
1631 return EFI_INVALID_PARAMETER;
1640 if (EFI_ERROR (Status)) {
1641 Status = EFI_NOT_FOUND;
1643 ASSERT (StartLink !=
NULL && EndLink !=
NULL);
1683 IN UINT64 Attributes
1686 DEBUG ((DEBUG_GCD,
"GCD:SetMemorySpaceAttributes(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1687 DEBUG ((DEBUG_GCD,
" Attributes = %016lx\n", Attributes));
1714 IN UINT64 Capabilities
1717 DEBUG ((DEBUG_GCD,
"GCD:CoreSetMemorySpaceCapabilities(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1718 DEBUG ((DEBUG_GCD,
" Capabilities = %016lx\n", Capabilities));
1745 UINTN DescriptorCount;
1750 if (NumberOfDescriptors ==
NULL) {
1751 return EFI_INVALID_PARAMETER;
1754 if (MemorySpaceMap ==
NULL) {
1755 return EFI_INVALID_PARAMETER;
1758 *NumberOfDescriptors = 0;
1759 *MemorySpaceMap =
NULL;
1771 if ((DescriptorCount == *NumberOfDescriptors) && (*MemorySpaceMap !=
NULL)) {
1775 Descriptor = *MemorySpaceMap;
1776 Link = mGcdMemorySpaceMap.ForwardLink;
1777 while (Link != &mGcdMemorySpaceMap) {
1781 Link = Link->ForwardLink;
1801 if (*MemorySpaceMap !=
NULL) {
1809 if (*MemorySpaceMap ==
NULL) {
1810 *NumberOfDescriptors = 0;
1811 return EFI_OUT_OF_RESOURCES;
1818 *NumberOfDescriptors = DescriptorCount;
1852 DEBUG ((DEBUG_GCD,
"GCD:AddIoSpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1859 return EFI_INVALID_PARAMETER;
1894 if (BaseAddress !=
NULL) {
1895 DEBUG ((DEBUG_GCD,
"GCD:AllocateIoSpace(Base=%016lx,Length=%016lx)\n", *BaseAddress, Length));
1897 DEBUG ((DEBUG_GCD,
"GCD:AllocateIoSpace(Base=<NULL>,Length=%016lx)\n", Length));
1902 DEBUG ((DEBUG_GCD,
" Alignment = %016lx\n",
LShiftU64 (1, Alignment)));
1903 DEBUG ((DEBUG_GCD,
" ImageHandle = %p\n", ImageHandle));
1904 DEBUG ((DEBUG_GCD,
" DeviceHandle = %p\n", DeviceHandle));
1907 GCD_ALLOCATE_IO_OPERATION,
1936 DEBUG ((DEBUG_GCD,
"GCD:FreeIoSpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1958 DEBUG ((DEBUG_GCD,
"GCD:RemoveIoSpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
1976 Descriptor->BaseAddress = Entry->BaseAddress;
1977 Descriptor->Length = Entry->EndAddress - Entry->BaseAddress + 1;
1978 Descriptor->GcdIoType = Entry->GcdIoType;
1979 Descriptor->ImageHandle = Entry->ImageHandle;
1980 Descriptor->DeviceHandle = Entry->DeviceHandle;
2008 if (Descriptor ==
NULL) {
2009 return EFI_INVALID_PARAMETER;
2018 if (EFI_ERROR (Status)) {
2019 Status = EFI_NOT_FOUND;
2021 ASSERT (StartLink !=
NULL && EndLink !=
NULL);
2060 if (NumberOfDescriptors ==
NULL) {
2061 return EFI_INVALID_PARAMETER;
2064 if (IoSpaceMap ==
NULL) {
2065 return EFI_INVALID_PARAMETER;
2079 if (*IoSpaceMap ==
NULL) {
2080 Status = EFI_OUT_OF_RESOURCES;
2087 Descriptor = *IoSpaceMap;
2088 Link = mGcdIoSpaceMap.ForwardLink;
2089 while (Link != &mGcdIoSpaceMap) {
2093 Link = Link->ForwardLink;
2120 UINT64 Capabilities;
2126 for (Capabilities = 0, Conversion = mAttributeConversionTable; Conversion->Attribute != 0; Conversion++) {
2128 if (Attributes & Conversion->Attribute) {
2129 Capabilities |= Conversion->Capability;
2134 return Capabilities;
2155 for (Index = 0; gMemoryTypeInformation[Index].
Type != EfiMaxMemoryType; Index++) {
2156 TotalSize +=
LShiftU64 (gMemoryTypeInformation[Index].NumberOfPages, EFI_PAGE_SHIFT);
2174 IN OUT UINT64 *Length,
2185 TopAddress = *BaseAddress + *Length;
2186 while (MemoryHob !=
NULL) {
2187 AllocatedTop = MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength;
2189 if ((MemoryHob->AllocDescriptor.MemoryBaseAddress >= *BaseAddress) &&
2190 (AllocatedTop <= TopAddress))
2192 LowerBase = *BaseAddress;
2193 LowerSize = MemoryHob->AllocDescriptor.MemoryBaseAddress - *BaseAddress;
2194 UpperBase = AllocatedTop;
2195 UpperSize = TopAddress - AllocatedTop;
2197 if (LowerSize != 0) {
2201 if (UpperSize != 0) {
2205 if (UpperSize >= LowerSize) {
2206 *Length = UpperSize;
2207 *BaseAddress = UpperBase;
2209 *Length = LowerSize;
2210 *BaseAddress = LowerBase;
2216 MemoryHob =
GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, GET_NEXT_HOB (MemoryHob));
2239 OUT UINT64 *MemoryLength
2254 UINT64 Capabilities;
2256 UINT64 TestedMemoryLength;
2259 UINT32 ReservedCodePageNumber;
2260 UINT64 MinimalMemorySizeNeeded;
2265 Hob.Raw = *HobStart;
2266 ASSERT (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_HANDOFF);
2277 PhitResourceHob =
NULL;
2286 PhitHob = Hob.HandoffInformationTable;
2288 if (
PcdGet64 (PcdLoadModuleAtFixAddressEnable) != 0) {
2289 ReservedCodePageNumber =
PcdGet32 (PcdLoadFixAddressRuntimeCodePageNumber);
2290 ReservedCodePageNumber +=
PcdGet32 (PcdLoadFixAddressBootTimeCodePageNumber);
2302 MemoryTypeInformationResourceHob =
NULL;
2304 if (GuidHob !=
NULL) {
2305 EfiMemoryTypeInformation = GET_GUID_HOB_DATA (GuidHob);
2306 DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
2308 CopyMem (&gMemoryTypeInformation, EfiMemoryTypeInformation, DataSize);
2316 for (Hob.Raw = *HobStart; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
2317 if (GET_HOB_TYPE (Hob) != EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
2321 ResourceHob = Hob.ResourceDescriptor;
2327 if (ResourceHob->
ResourceType != EFI_RESOURCE_SYSTEM_MEMORY) {
2331 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) != TESTED_MEMORY_ATTRIBUTES) {
2336 MemoryTypeInformationResourceHob = ResourceHob;
2341 MemoryTypeInformationResourceHob =
NULL;
2355 for (Hob.Raw = *HobStart; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
2359 if (GET_HOB_TYPE (Hob) != EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
2366 ResourceHob = Hob.ResourceDescriptor;
2367 if (ResourceHob->
ResourceType != EFI_RESOURCE_SYSTEM_MEMORY) {
2371 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) != TESTED_MEMORY_ATTRIBUTES) {
2389 PhitResourceHob = ResourceHob;
2397 if (MemoryTypeInformationResourceHob == PhitResourceHob) {
2398 MemoryTypeInformationResourceHob =
NULL;
2408 if (Length < MinimalMemorySizeNeeded) {
2416 if (Length < MinimalMemorySizeNeeded) {
2441 if (Length < MinimalMemorySizeNeeded) {
2449 for (Hob.Raw = *HobStart; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
2453 if (Hob.ResourceDescriptor == PhitResourceHob) {
2460 if (Hob.ResourceDescriptor == MemoryTypeInformationResourceHob) {
2467 if (GET_HOB_TYPE (Hob) != EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
2474 ResourceHob = Hob.ResourceDescriptor;
2475 if (ResourceHob->
ResourceType != EFI_RESOURCE_SYSTEM_MEMORY) {
2479 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) != TESTED_MEMORY_ATTRIBUTES) {
2500 if (TestedMemoryLength < MinimalMemorySizeNeeded) {
2507 BaseAddress = TestedMemoryBaseAddress;
2508 Length = TestedMemoryLength;
2514 DEBUG ((DEBUG_INFO,
"CoreInitializeMemoryServices:\n"));
2515 DEBUG ((DEBUG_INFO,
" BaseAddress - 0x%lx Length - 0x%lx MinimalMemorySizeNeeded - 0x%lx\n", BaseAddress, Length, MinimalMemorySizeNeeded));
2520 ASSERT (Length >= MinimalMemorySizeNeeded);
2525 if ((Attributes & EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE) == EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE) {
2531 if (MemoryTypeInformationResourceHob !=
NULL) {
2553 *MemoryBaseAddress = BaseAddress;
2554 *MemoryLength = Length;
2575 IN OUT VOID **HobStart,
2577 IN UINT64 MemoryLength
2583 UINT8 SizeOfMemorySpace;
2584 UINT8 SizeOfIoSpace;
2595 UINTN NumberOfDescriptors;
2598 UINT64 Capabilities;
2611 ASSERT (CpuHob !=
NULL);
2619 ASSERT (Entry !=
NULL);
2621 Entry->EndAddress =
LShiftU64 (1, SizeOfMemorySpace) - 1;
2631 ASSERT (Entry !=
NULL);
2633 Entry->EndAddress =
LShiftU64 (1, SizeOfIoSpace) - 1;
2642 for (Hob.Raw = *HobStart; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
2646 if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
2647 ResourceHob = Hob.ResourceDescriptor;
2650 case EFI_RESOURCE_SYSTEM_MEMORY:
2651 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) == TESTED_MEMORY_ATTRIBUTES) {
2652 if ((ResourceHob->
ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE) == EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE) {
2659 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) == INITIALIZED_MEMORY_ATTRIBUTES) {
2663 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) == PRESENT_MEMORY_ATTRIBUTES) {
2667 if ((ResourceHob->
ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_PERSISTENT) == EFI_RESOURCE_ATTRIBUTE_PERSISTENT) {
2672 case EFI_RESOURCE_MEMORY_MAPPED_IO:
2673 case EFI_RESOURCE_FIRMWARE_DEVICE:
2676 case EFI_RESOURCE_MEMORY_MAPPED_IO_PORT:
2677 case EFI_RESOURCE_MEMORY_RESERVED:
2680 case EFI_RESOURCE_MEMORY_UNACCEPTED:
2683 case EFI_RESOURCE_IO:
2686 case EFI_RESOURCE_IO_RESERVED:
2727 if (!EFI_ERROR (Status)) {
2738 gDxeCoreImageHandle,
2747 for (Hob.Raw = *HobStart; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
2748 if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
2749 MemoryHob = Hob.MemoryAllocation;
2752 if (!EFI_ERROR (Status)) {
2759 gDxeCoreImageHandle,
2762 if (!EFI_ERROR (Status) &&
2776 if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) {
2777 FirmwareVolumeHob = Hob.FirmwareVolume;
2783 FirmwareVolumeHob->
Length,
2785 gDxeCoreImageHandle,
2797 MemorySpaceMapHobList =
NULL;
2798 for (Index = 0; Index < NumberOfDescriptors; Index++) {
2802 if (MemorySpaceMap[Index].ImageHandle ==
NULL) {
2804 Length =
PageAlignLength (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - BaseAddress);
2805 if ((Length == 0) || (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length < BaseAddress)) {
2809 if (((
UINTN)MemorySpaceMap[Index].BaseAddress <= (
UINTN)(*HobStart)) &&
2817 MemorySpaceMapHobList = &MemorySpaceMap[Index];
2825 MemorySpaceMap[Index].Capabilities & (~EFI_MEMORY_RUNTIME)
2829 MemorySpaceMap[Index].GcdMemoryType,
2833 gDxeCoreImageHandle,
2851 ASSERT (NewHobList !=
NULL);
2853 *HobStart = NewHobList;
2856 if (MemorySpaceMapHobList !=
NULL) {
2867 MemorySpaceMapHobList->
Capabilities & (~EFI_MEMORY_RUNTIME)
2875 gDxeCoreImageHandle,
#define MAX_ALLOC_ADDRESS
VOID *EFIAPI GetFirstHob(IN UINT16 Type)
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI GetNextHob(IN UINT16 Type, IN CONST VOID *HobStart)
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
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 CoreAddMemoryDescriptor(IN EFI_MEMORY_TYPE Type, IN EFI_PHYSICAL_ADDRESS Start, IN UINT64 NumberOfPages, IN UINT64 Attribute)
VOID CoreUpdateMemoryAttributes(IN EFI_PHYSICAL_ADDRESS Start, IN UINT64 NumberOfPages, IN UINT64 NewAttributes)
VOID CoreAcquireLock(IN EFI_LOCK *Lock)
VOID CoreReleaseLock(IN EFI_LOCK *Lock)
VOID CoreSetMemoryTypeInformationRange(IN EFI_PHYSICAL_ADDRESS Start, IN UINT64 Length)
VOID CoreInitializePool(VOID)
EFI_STATUS EFIAPI CoreFreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS EFIAPI CoreFreeIoSpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
EFI_STATUS CoreCleanupGcdMapEntry(IN EFI_GCD_MAP_ENTRY *TopEntry, IN EFI_GCD_MAP_ENTRY *BottomEntry, IN LIST_ENTRY *StartLink, IN LIST_ENTRY *EndLink, IN LIST_ENTRY *Map)
EFI_STATUS EFIAPI CoreGetIoSpaceDescriptor(IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor)
VOID EFIAPI CoreDumpGcdIoSpaceMap(BOOLEAN InitialMap)
EFI_STATUS CoreAllocateSpaceCheckEntry(IN UINTN Operation, IN EFI_GCD_MAP_ENTRY *Entry, IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_GCD_IO_TYPE GcdIoType)
VOID FindLargestFreeRegion(IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN OUT UINT64 *Length, IN EFI_HOB_MEMORY_ALLOCATION *MemoryHob)
UINT64 AlignValue(IN UINT64 Value, IN UINTN Alignment, IN BOOLEAN RoundUp)
EFI_STATUS CoreAllocateSpace(IN UINTN Operation, IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_GCD_IO_TYPE GcdIoType, IN UINTN Alignment, IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL)
UINT64 CoreConvertResourceDescriptorHobAttributesToCapabilities(EFI_GCD_MEMORY_TYPE GcdMemoryType, UINT64 Attributes)
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * mGcdIoTypeNames[]
EFI_STATUS EFIAPI CoreGetIoSpaceMap(OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap)
EFI_STATUS EFIAPI CoreGetMemorySpaceDescriptor(IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor)
EFI_STATUS EFIAPI CoreAddMemorySpace(IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities)
VOID CoreAcquireGcdMemoryLock(VOID)
EFI_STATUS CoreInitializeMemoryServices(IN VOID **HobStart, OUT EFI_PHYSICAL_ADDRESS *MemoryBaseAddress, OUT UINT64 *MemoryLength)
UINT64 CalculateTotalMemoryBinSizeNeeded(VOID)
EFI_STATUS CoreConvertSpace(IN UINTN Operation, IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_GCD_IO_TYPE GcdIoType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities, IN UINT64 Attributes)
EFI_STATUS CoreMergeGcdMapEntry(IN LIST_ENTRY *Link, IN BOOLEAN Forward, IN LIST_ENTRY *Map)
EFI_STATUS EFIAPI CoreFreeMemorySpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
EFI_STATUS EFIAPI CoreRemoveMemorySpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
EFI_STATUS CoreInitializeGcdServices(IN OUT VOID **HobStart, IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress, IN UINT64 MemoryLength)
EFI_STATUS CoreInsertGcdMapEntry(IN LIST_ENTRY *Link, IN EFI_GCD_MAP_ENTRY *Entry, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN EFI_GCD_MAP_ENTRY *TopEntry, IN EFI_GCD_MAP_ENTRY *BottomEntry)
EFI_STATUS EFIAPI CoreSetMemorySpaceCapabilities(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities)
UINT64 PageAlignLength(IN UINT64 Value)
EFI_STATUS EFIAPI CoreAddIoSpace(IN EFI_GCD_IO_TYPE GcdIoType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
VOID EFIAPI CoreDumpGcdMemorySpaceMap(BOOLEAN InitialMap)
EFI_STATUS EFIAPI CoreSetMemorySpaceAttributes(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
VOID BuildMemoryDescriptor(IN OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor, IN EFI_GCD_MAP_ENTRY *Entry)
EFI_STATUS EFIAPI CoreGetMemorySpaceMap(OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap)
EFI_STATUS CoreInternalAddMemorySpace(IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities)
UINT64 PageAlignAddress(IN UINT64 Value)
VOID CoreAcquireGcdIoLock(VOID)
UINT64 ConverToCpuArchAttributes(UINT64 Attributes)
VOID CoreValidateResourceDescriptorHobAttributes(IN UINT64 Attributes)
VOID BuildIoDescriptor(IN EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor, IN EFI_GCD_MAP_ENTRY *Entry)
EFI_STATUS EFIAPI CoreAllocateIoSpace(IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_IO_TYPE GcdIoType, IN UINTN Alignment, IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL)
VOID CoreReleaseGcdMemoryLock(VOID)
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * mGcdAllocationTypeNames[]
EFI_STATUS EFIAPI CoreRemoveIoSpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
EFI_STATUS CoreAllocateGcdMapEntry(IN OUT EFI_GCD_MAP_ENTRY **TopEntry, IN OUT EFI_GCD_MAP_ENTRY **BottomEntry)
UINTN CoreCountGcdMapEntry(IN LIST_ENTRY *Map)
VOID CoreReleaseGcdIoLock(VOID)
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * mGcdMemoryTypeNames[]
EFI_STATUS CoreSearchGcdMapEntry(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, OUT LIST_ENTRY **StartLink, OUT LIST_ENTRY **EndLink, IN LIST_ENTRY *Map)
EFI_STATUS EFIAPI CoreAllocateMemorySpace(IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN UINTN Alignment, IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL)
#define GLOBAL_REMOVE_IF_UNREFERENCED
#define DEBUG_CODE_BEGIN()
#define DEBUG(Expression)
#define CR(Record, TYPE, Field, TestSignature)
#define PcdGet64(TokenName)
#define PcdGet32(TokenName)
@ EfiGcdMemoryTypeReserved
@ EfiGcdMemoryTypeNonExistent
@ EfiGcdMemoryTypePersistent
@ EfiGcdMemoryTypeMoreReliable
@ EfiGcdMemoryTypeUnaccepted
@ EfiGcdMemoryTypeSystemMemory
@ EfiGcdMemoryTypeMemoryMappedIo
@ EfiGcdAllocateMaxAddressSearchBottomUp
@ EfiGcdAllocateMaxAddressSearchTopDown
@ EfiGcdAllocateAnySearchTopDown
@ EfiGcdIoTypeNonExistent
#define EFI_NOT_AVAILABLE_YET
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_PAGES_TO_SIZE(Pages)
#define EFI_INITIALIZE_LOCK_VARIABLE(Priority)
EFI_GCD_MEMORY_TYPE GcdMemoryType
EFI_PHYSICAL_ADDRESS BaseAddress
EFI_PHYSICAL_ADDRESS BaseAddress
EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
EFI_PHYSICAL_ADDRESS EfiMemoryTop
EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop
EFI_PHYSICAL_ADDRESS MemoryBaseAddress
EFI_MEMORY_TYPE MemoryType
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
EFI_PHYSICAL_ADDRESS PhysicalStart
EFI_RESOURCE_TYPE ResourceType
EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
EFI_PHYSICAL_ADDRESS DxeCodeTopAddress
The top address below which the Dxe runtime code and below which the Dxe runtime/boot code and PEI co...
UINT32 Type
EFI memory type defined in UEFI specification.