]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
MdeModulePkg/Bds: MemoryTypeInformation excludes boot option mem use
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmBoot.c
index 4da401d23cfd15d40afae5722a651e55cf05791a..bb38f0055a09669de0fa30c7c3b826a050f822a9 100644 (file)
@@ -1569,7 +1569,6 @@ EfiBootManagerBoot (
   UINTN                     FileSize;\r
   EFI_BOOT_LOGO_PROTOCOL    *BootLogo;\r
   EFI_EVENT                 LegacyBootEvent;\r
-  UINTN                     RamDiskSizeInPages;\r
 \r
   if (BootOption == NULL) {\r
     return;\r
@@ -1643,8 +1642,24 @@ EfiBootManagerBoot (
   PERF_START_EX (gImageHandle, "BdsAttempt", NULL, 0, (UINT32) OptionNumber);\r
 \r
   //\r
-  // 5. Load EFI boot option to ImageHandle\r
+  // 5. Adjust the different type memory page number just before booting\r
+  //    and save the updated info into the variable for next boot to use\r
+  //\r
+  BmSetMemoryTypeInformationVariable (\r
+    (BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT)\r
+  );\r
+\r
   //\r
+  // 6. Load EFI boot option to ImageHandle\r
+  //\r
+  DEBUG_CODE_BEGIN ();\r
+  if (BootOption->Description == NULL) {\r
+    DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting from unknown device path\n"));\r
+  } else {\r
+    DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting %s\n", BootOption->Description));\r
+  }\r
+  DEBUG_CODE_END ();\r
+\r
   ImageHandle       = NULL;\r
   RamDiskDevicePath = NULL;\r
   if (DevicePathType (BootOption->FilePath) != BBS_DEVICE_PATH) {\r
@@ -1700,28 +1715,6 @@ EfiBootManagerBoot (
     }\r
   }\r
 \r
-  //\r
-  // 6. Adjust the different type memory page number just before booting\r
-  //    and save the updated info into the variable for next boot to use\r
-  //\r
-  if (RamDiskDevicePath == NULL) {\r
-    RamDiskSizeInPages = 0;\r
-  } else {\r
-    BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);\r
-  }\r
-  BmSetMemoryTypeInformationVariable (\r
-    (BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT),\r
-    RamDiskSizeInPages\r
-    );\r
-\r
-  DEBUG_CODE_BEGIN();\r
-    if (BootOption->Description == NULL) {\r
-      DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting from unknown device path\n"));\r
-    } else {\r
-      DEBUG ((DEBUG_INFO | DEBUG_LOAD, "[Bds]Booting %s\n", BootOption->Description));\r
-    }\r
-  DEBUG_CODE_END();\r
-\r
   //\r
   // Check to see if we should legacy BOOT. If yes then do the legacy boot\r
   // Write boot to OS performance data for Legacy boot\r