summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-07-05 17:46:07 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-07-07 09:57:31 +0800
commit3a986a353db249e3ae128d47bff3a13c6e13a037 (patch)
tree4c11d26e0043bff0acc971ff6f6d031998ca319f /MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
parenteab4016490c863895c8773033dfe651b9dc90816 (diff)
downloadedk2-3a986a353db249e3ae128d47bff3a13c6e13a037.tar.gz
edk2-3a986a353db249e3ae128d47bff3a13c6e13a037.tar.bz2
edk2-3a986a353db249e3ae128d47bff3a13c6e13a037.zip
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>
Diffstat (limited to 'MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c')
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 4da401d23c..bb38f0055a 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1569,7 +1569,6 @@ EfiBootManagerBoot (
UINTN FileSize;
EFI_BOOT_LOGO_PROTOCOL *BootLogo;
EFI_EVENT LegacyBootEvent;
- UINTN RamDiskSizeInPages;
if (BootOption == NULL) {
return;
@@ -1643,8 +1642,24 @@ EfiBootManagerBoot (
PERF_START_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumber);
//
- // 5. Load EFI boot option to ImageHandle
+ // 5. Adjust the different type memory page number just before booting
+ // and save the updated info into the variable for next boot to use
+ //
+ BmSetMemoryTypeInformationVariable (
+ (BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT)
+ );
+
//
+ // 6. Load EFI boot option to ImageHandle
+ //
+ DEBUG_CODE_BEGIN ();
+ if (BootOption->Description == NULL) {
+ DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting from unknown device path\n"));
+ } else {
+ DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting %s\n", BootOption->Description));
+ }
+ DEBUG_CODE_END ();
+
ImageHandle = NULL;
RamDiskDevicePath = NULL;
if (DevicePathType (BootOption->FilePath) != BBS_DEVICE_PATH) {
@@ -1701,28 +1716,6 @@ 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
- //
- if (RamDiskDevicePath == NULL) {
- RamDiskSizeInPages = 0;
- } else {
- BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);
- }
- BmSetMemoryTypeInformationVariable (
- (BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT),
- RamDiskSizeInPages
- );
-
- DEBUG_CODE_BEGIN();
- if (BootOption->Description == NULL) {
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting from unknown device path\n"));
- } else {
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting %s\n", BootOption->Description));
- }
- DEBUG_CODE_END();
-
- //
// Check to see if we should legacy BOOT. If yes then do the legacy boot
// Write boot to OS performance data for Legacy boot
//