summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-23 14:49:45 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-23 14:49:45 +0000
commitdc8d93ca0c9a798fe4e23f68b5b5adc032bf5509 (patch)
tree27b9574788851b7b5e9fb8fdc008724fa832a6cd /MdeModulePkg
parent6fa28b758b1f4f9febd69a07d27bfa2436a9567d (diff)
downloadedk2-platforms-dc8d93ca0c9a798fe4e23f68b5b5adc032bf5509.tar.xz
add detail comments on the complicated code segment.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5954 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/Page.c23
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/Pool.c4
2 files changed, 18 insertions, 9 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c
index 5e3c81d786..c55bbe3b92 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Page.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
@@ -35,18 +35,20 @@ typedef struct {
//
UINTN mMemoryMapKey = 0;
-//
-// mMapStack - space to use as temp storage to build new map descriptors
-// mMapDepth - depth of new descriptor stack
-//
-
#define MAX_MAP_DEPTH 6
+
+///
+/// mMapDepth - depth of new descriptor stack
+///
UINTN mMapDepth = 0;
+///
+/// mMapStack - space to use as temp storage to build new map descriptors
+///
MEMORY_MAP mMapStack[MAX_MAP_DEPTH];
UINTN mFreeMapStack = 0;
-//
-// This list maintain the free memory map list
-//
+///
+/// This list maintain the free memory map list
+///
LIST_ENTRY mFreeMemoryMapEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mFreeMemoryMapEntryList);
BOOLEAN mMemoryTypeInformationInitialized = FALSE;
@@ -1287,7 +1289,10 @@ CoreGetMemoryMap (
if ((GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypeReserved) ||
(GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypeMemoryMappedIo)) {
if ((GcdMapEntry->Attributes & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME) {
-
+ //
+ // Create EFI_MEMORY_DESCRIPTOR for every Reserved and MMIO GCD entries
+ // that are marked for runtime use
+ //
MemoryMap->PhysicalStart = GcdMapEntry->BaseAddress;
MemoryMap->VirtualStart = 0;
MemoryMap->NumberOfPages = RShiftU64 ((GcdMapEntry->EndAddress - GcdMapEntry->BaseAddress + 1), EFI_PAGE_SHIFT);
diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c
index cea6fada4c..ce70cff513 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Pool.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c
@@ -124,6 +124,10 @@ LookupPoolHead (
return &mPoolHead[MemoryType];
}
+ //
+ // MemoryType values in the range 0x80000000..0xFFFFFFFF are reserved for use by UEFI
+ // OS loaders that are provided by operating system vendors
+ //
if (MemoryType < 0) {
for (Link = mPoolHeadList.ForwardLink; Link != &mPoolHeadList; Link = Link->ForwardLink) {