MdeModulePkg/Bds: Memory Bins don't count the memory used by RAM Disk

MemoryTypeInformation don't count the reserved memory used by RAM Disk,
but it still check all types of memory and do reset when any type
of memory size changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
This commit is contained in:
Ni, Ruiyu
2016-03-29 18:32:13 +08:00
committed by Ruiyu Ni
parent 339ae051f6
commit 024bdafc68
3 changed files with 27 additions and 9 deletions

View File

@@ -1567,6 +1567,7 @@ EfiBootManagerBoot (
UINTN FileSize;
EFI_BOOT_LOGO_PROTOCOL *BootLogo;
EFI_EVENT LegacyBootEvent;
UINTN RamDiskSizeInPages;
if (BootOption == NULL) {
return;
@@ -1701,8 +1702,10 @@ EfiBootManagerBoot (
// 6. Adjust the different type memory page number just before booting
// and save the updated info into the variable for next boot to use
//
BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);
BmSetMemoryTypeInformationVariable (
(BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT)
(BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT),
RamDiskSizeInPages
);
DEBUG_CODE_BEGIN();