mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
MdeModulePkg: DxeCore: Update Memory Statistics from PEI
If memory bins are enabled for PEI, PEI will produce Memory Allocation HOBs marked with gEfiMemoryTypeInformationGuid. If these exist, DXE core will now process the stats from them to have accurate numbers. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This commit is contained in:
parent
2e7aa4810b
commit
cf1a2a541e
1 changed files with 15 additions and 0 deletions
|
|
@ -2785,6 +2785,21 @@ CoreInitializeGcdServices (
|
|||
RShiftU64 (MemoryHob->AllocDescriptor.MemoryLength, EFI_PAGE_SHIFT),
|
||||
Descriptor.Capabilities & (~EFI_MEMORY_RUNTIME)
|
||||
);
|
||||
|
||||
// if this Memory Allocation HOB came from PEI, update the memory bin statistics
|
||||
if (CompareGuid (&MemoryHob->AllocDescriptor.Name, &gEfiMemoryTypeInformationGuid)) {
|
||||
UpdateMemoryStatistics (
|
||||
EfiConventionalMemory,
|
||||
MemoryHob->AllocDescriptor.MemoryType,
|
||||
MemoryHob->AllocDescriptor.MemoryBaseAddress,
|
||||
EFI_SIZE_TO_PAGES ((UINT32)MemoryHob->AllocDescriptor.MemoryLength),
|
||||
&mMemoryTypeInformationInitialized,
|
||||
mMemoryTypeStatistics,
|
||||
gMemoryTypeInformation,
|
||||
mDefaultBaseAddress,
|
||||
mDefaultMaximumAddress
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue