summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Pei
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-09-29 14:27:24 +0800
committerStar Zeng <star.zeng@intel.com>2017-09-30 09:29:44 +0800
commitaa57c0f096e2e0d555038fc63caea34398f219e6 (patch)
tree037297ae536ab69339566522c93b49433eaede53 /MdeModulePkg/Core/Pei
parent27daa8658e518902bf281b07993c2d60af1913c3 (diff)
downloadedk2-aa57c0f096e2e0d555038fc63caea34398f219e6.tar.gz
edk2-aa57c0f096e2e0d555038fc63caea34398f219e6.tar.bz2
edk2-aa57c0f096e2e0d555038fc63caea34398f219e6.zip
MdeModulePkg PeiCore: More debug messages for pre-memory allocations
The debug messages can help developer to know the pre-memory allocation usage. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Core/Pei')
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 04ece9a627..38299c5d98 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -675,7 +675,8 @@ PeiCheckAndSwitchStack (
// usage in temporary memory for debugging.
//
DEBUG_CODE_BEGIN ();
- UINT32 *StackPointer;
+ UINT32 *StackPointer;
+ EFI_PEI_HOB_POINTERS Hob;
for (StackPointer = (UINT32*)SecCoreData->StackBase;
(StackPointer < (UINT32*)((UINTN)SecCoreData->StackBase + SecCoreData->StackSize)) \
@@ -691,6 +692,17 @@ PeiCheckAndSwitchStack (
DEBUG ((DEBUG_INFO, " temporary memory heap used for HobList: %d bytes.\n",
(UINT32)((UINTN)Private->HobList.HandoffInformationTable->EfiFreeMemoryBottom - (UINTN)Private->HobList.Raw)
));
+ DEBUG ((DEBUG_INFO, " temporary memory heap occupied by memory pages: %d bytes.\n",
+ (UINT32)(UINTN)(Private->HobList.HandoffInformationTable->EfiMemoryTop - Private->HobList.HandoffInformationTable->EfiFreeMemoryTop)
+ ));
+ for (Hob.Raw = Private->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
+ if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
+ DEBUG ((DEBUG_INFO, "Memory Allocation 0x%08x 0x%0lx - 0x%0lx\n", \
+ Hob.MemoryAllocation->AllocDescriptor.MemoryType, \
+ Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress, \
+ Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress + Hob.MemoryAllocation->AllocDescriptor.MemoryLength - 1));
+ }
+ }
DEBUG_CODE_END ();
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 && (Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {