-/**\r
- Check if this memory entry spans across original memory map boundary.\r
-\r
- @param PhysicalStart The PhysicalStart of memory\r
- @param NumberOfPages The NumberOfPages of memory\r
-\r
- @retval TRUE This memory entry spans across original memory map boundary.\r
- @retval FALSE This memory entry does not span cross original memory map boundary.\r
-**/\r
-STATIC\r
-BOOLEAN\r
-DoesEntrySpanAcrossBoundary (\r
- IN UINT64 PhysicalStart,\r
- IN UINT64 NumberOfPages\r
- )\r
-{\r
- EFI_MEMORY_DESCRIPTOR *MemoryMapEntry;\r
- EFI_MEMORY_DESCRIPTOR *MemoryMapEnd;\r
- UINT64 MemoryBlockLength;\r
-\r
- MemoryMapEntry = mMemoryMapOrg;\r
- MemoryMapEnd = (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) mMemoryMapOrg + mMemoryMapOrgSize);\r
- while (MemoryMapEntry < MemoryMapEnd) {\r
- MemoryBlockLength = (UINT64) (EfiPagesToSize (MemoryMapEntry->NumberOfPages));\r
-\r
- if ((MemoryMapEntry->PhysicalStart <= PhysicalStart) &&\r
- (MemoryMapEntry->PhysicalStart + MemoryBlockLength > PhysicalStart) &&\r
- (MemoryMapEntry->PhysicalStart + MemoryBlockLength < PhysicalStart + EfiPagesToSize (NumberOfPages))) {\r
- return TRUE;\r
- }\r
-\r
- MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, mDescriptorSize);\r
- }\r
- return FALSE;\r
-}\r
-\r