MdeModulePkg/Bds: MemoryTypeInformation excludes boot option mem use
The patch re-orders the sequences by putting updating memory type information before loading the boot option so that the reserved memory usage by HTTP RAM disk boot can be excluded by the memory type information updating. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@ -130,13 +130,10 @@ BmMatchDevicePaths (
|
||||
|
||||
@param Boot TRUE if current boot option belongs to boot
|
||||
category instead of application category.
|
||||
@param RamDiskSizeInPages Reserved memory size in pages occupied by
|
||||
RAM Disk.
|
||||
**/
|
||||
VOID
|
||||
BmSetMemoryTypeInformationVariable (
|
||||
IN BOOLEAN Boot,
|
||||
IN UINTN RamDiskSizeInPages
|
||||
IN BOOLEAN Boot
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@ -229,14 +226,6 @@ BmSetMemoryTypeInformationVariable (
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Do not count the reserved memory occupied by RAM Disk.
|
||||
//
|
||||
if ((CurrentMemoryTypeInformation[Index1].Type == EfiReservedMemoryType) &&
|
||||
(CurrentMemoryTypeInformation[Index1].NumberOfPages > ((UINT32) RamDiskSizeInPages))) {
|
||||
CurrentMemoryTypeInformation[Index1].NumberOfPages -= (UINT32) RamDiskSizeInPages;
|
||||
}
|
||||
|
||||
//
|
||||
// Previous is the number of pages pre-allocated
|
||||
// Current is the number of pages actually needed
|
||||
|
Reference in New Issue
Block a user