23#define MEMORY_ATTRIBUTE_MASK (EFI_RESOURCE_ATTRIBUTE_PRESENT | \
24 EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \
25 EFI_RESOURCE_ATTRIBUTE_TESTED | \
26 EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED | \
27 EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED | \
28 EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED | \
29 EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED | \
30 EFI_RESOURCE_ATTRIBUTE_16_BIT_IO | \
31 EFI_RESOURCE_ATTRIBUTE_32_BIT_IO | \
32 EFI_RESOURCE_ATTRIBUTE_64_BIT_IO | \
33 EFI_RESOURCE_ATTRIBUTE_PERSISTENT )
35#define TESTED_MEMORY_ATTRIBUTES (EFI_RESOURCE_ATTRIBUTE_PRESENT | \
36 EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \
37 EFI_RESOURCE_ATTRIBUTE_TESTED )
76 IN VOID *EfiMemoryBottom,
77 IN VOID *EfiMemoryTop,
78 IN VOID *EfiFreeMemoryBottom,
79 IN VOID *EfiFreeMemoryTop
91 IN UINT64 AcpiTableBase
107 if (Hob->Raw ==
NULL) {
111 NewHob.Header =
CreateHob (Hob->Header->HobType, Hob->Header->HobLength);
113 if (NewHob.Header !=
NULL) {
137 for (Hob.Raw = (UINT8 *)HobList; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
141 if (GET_HOB_TYPE (Hob) != EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
148 ResourceHob = Hob.ResourceDescriptor;
149 if (ResourceHob->
ResourceType != EFI_RESOURCE_SYSTEM_MEMORY) {
153 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) != TESTED_MEMORY_ATTRIBUTES) {
160 if (Base < ResourceHob->PhysicalStart) {
194 ReturnResourceHob =
NULL;
196 for (Hob.Raw = (UINT8 *)HobList; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
200 if (GET_HOB_TYPE (Hob) != EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
207 ResourceHob = Hob.ResourceDescriptor;
208 if (ResourceHob->
ResourceType != EFI_RESOURCE_SYSTEM_MEMORY) {
212 if ((ResourceHob->
ResourceAttribute & MEMORY_ATTRIBUTE_MASK) != TESTED_MEMORY_ATTRIBUTES) {
219 if (ResourceHob == ExceptResourceHob) {
240 if (ReturnResourceHob ==
NULL) {
241 ReturnResourceHob = ResourceHob;
244 ReturnResourceHob = ResourceHob;
249 return ReturnResourceHob;
268 if (Hob.Header->
HobType == EFI_HOB_TYPE_HANDOFF) {
272 if (Hob.Header->
HobType == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
ACPI_BOARD_INFO * BuildHobFromAcpi(IN UINT64 AcpiTableBase)
VOID *EFIAPI CreateHob(IN UINT16 HobType, IN UINT16 HobLength)
VOID AddNewHob(IN EFI_PEI_HOB_POINTERS *Hob)
EFI_HOB_HANDOFF_INFO_TABLE *EFIAPI HobConstructor(IN VOID *EfiMemoryBottom, IN VOID *EfiMemoryTop, IN VOID *EfiFreeMemoryBottom, IN VOID *EfiFreeMemoryTop)
EFI_HOB_RESOURCE_DESCRIPTOR * FindResourceDescriptorByRange(IN VOID *HobList, IN EFI_PHYSICAL_ADDRESS Base, IN EFI_PHYSICAL_ADDRESS Top)
BOOLEAN IsHobNeed(EFI_PEI_HOB_POINTERS Hob)
EFI_HOB_RESOURCE_DESCRIPTOR * FindAnotherHighestBelow4GResourceDescriptor(IN VOID *HobList, IN UINTN MinimalNeededSize, IN EFI_HOB_RESOURCE_DESCRIPTOR *ExceptResourceHob)
UINT64 EFI_PHYSICAL_ADDRESS
EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader
EFI_PHYSICAL_ADDRESS PhysicalStart
EFI_RESOURCE_TYPE ResourceType
EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute