- \r
- if (MemoryType == EfiReservedMemoryType) {\r
- //\r
- // Memory type needs to be updated to EfiReservedMemoryType. Per PI spec Volume 1, \r
- // PEI AllocatePages() will automate the creation of the Memory Allocation HOB types. \r
- // Search Memory Allocation HOB and find the matched memory region,\r
- // then change its memory type to EfiReservedMemoryType.\r
- //\r
- Hob.Raw = GetFirstHob (EFI_HOB_TYPE_MEMORY_ALLOCATION);\r
- while (Hob.Raw != NULL && Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress != Memory) {\r
- Hob.Raw = GET_NEXT_HOB (Hob);\r
- Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, Hob.Raw);\r
- }\r
- ASSERT (Hob.Raw != NULL);\r
- Hob.MemoryAllocation->AllocDescriptor.MemoryType = EfiReservedMemoryType;\r
- }\r