//\r
UINTN mMemoryMapKey = 0;\r
\r
-//\r
-// mMapStack - space to use as temp storage to build new map descriptors\r
-// mMapDepth - depth of new descriptor stack\r
-//\r
-\r
#define MAX_MAP_DEPTH 6\r
+\r
+///\r
+/// mMapDepth - depth of new descriptor stack\r
+///\r
UINTN mMapDepth = 0;\r
+///\r
+/// mMapStack - space to use as temp storage to build new map descriptors\r
+///\r
MEMORY_MAP mMapStack[MAX_MAP_DEPTH];\r
UINTN mFreeMapStack = 0;\r
-//\r
-// This list maintain the free memory map list\r
-//\r
+///\r
+/// This list maintain the free memory map list\r
+///\r
LIST_ENTRY mFreeMemoryMapEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mFreeMemoryMapEntryList);\r
BOOLEAN mMemoryTypeInformationInitialized = FALSE;\r
\r
if ((GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypeReserved) ||\r
(GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypeMemoryMappedIo)) {\r
if ((GcdMapEntry->Attributes & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME) {\r
-\r
+ // \r
+ // Create EFI_MEMORY_DESCRIPTOR for every Reserved and MMIO GCD entries\r
+ // that are marked for runtime use\r
+ //\r
MemoryMap->PhysicalStart = GcdMapEntry->BaseAddress;\r
MemoryMap->VirtualStart = 0;\r
MemoryMap->NumberOfPages = RShiftU64 ((GcdMapEntry->EndAddress - GcdMapEntry->BaseAddress + 1), EFI_PAGE_SHIFT);\r
return &mPoolHead[MemoryType];\r
}\r
\r
+ //\r
+ // MemoryType values in the range 0x80000000..0xFFFFFFFF are reserved for use by UEFI \r
+ // OS loaders that are provided by operating system vendors\r
+ //\r
if (MemoryType < 0) {\r
\r
for (Link = mPoolHeadList.ForwardLink; Link != &mPoolHeadList; Link = Link->ForwardLink) {\r