]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Mem/Page.c
add detail comments on the complicated code segment.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Mem / Page.c
index 5e3c81d78693dcd4b827fd20223c3682851421f9..c55bbe3b921e09a95c80f1ee38bacb1a57fb4b0c 100644 (file)
@@ -35,18 +35,20 @@ typedef struct {
 //\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
@@ -1287,7 +1289,10 @@ CoreGetMemoryMap (
     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