]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UefiBootManagerLib: Always create MemoryTypeInfo variable
authorRuiyu Ni <ruiyu.ni@intel.com>
Tue, 24 Nov 2015 06:56:05 +0000 (06:56 +0000)
committerniruiyu <niruiyu@Edk2>
Tue, 24 Nov 2015 06:56:05 +0000 (06:56 +0000)
Align to old BDS behavior (IntelFrameworkModulePkg/BDS) to always create
MemoryTypeInfo variable regardless of the PcdResetOnMemoryTypeInformationChange
value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18926 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c
MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h

index 70ec2164f0e19798929a6a86dcf26648565fca0c..e9634580f4846e4aa94aa8106556fa06e5607f6e 100644 (file)
@@ -1765,11 +1765,9 @@ EfiBootManagerBoot (
   // 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 ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT) {\r
-    if (PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {\r
-      BmSetMemoryTypeInformationVariable ();\r
-    }\r
-  }\r
+  BmSetMemoryTypeInformationVariable (\r
+    (BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT)\r
+    );\r
 \r
   DEBUG_CODE_BEGIN();\r
     if (BootOption->Description == NULL) {\r
index cc2032cd8288d659437665f9fc19ce409bd0d848..1768781bfcc071b58c849e099c7e462aab88b0b4 100644 (file)
@@ -122,11 +122,16 @@ BmMatchDevicePaths (
 \r
 /**\r
   This routine adjust the memory information for different memory type and \r
-  save them into the variables for next boot.\r
+  save them into the variables for next boot. It resets the system when\r
+  memory information is updated and the current boot option belongs to\r
+  boot category instead of application category.\r
+\r
+  @param Boot  TRUE if current boot option belongs to boot category instead of\r
+               application category.\r
 **/\r
 VOID\r
 BmSetMemoryTypeInformationVariable (\r
-  VOID\r
+  IN BOOLEAN                    Boot\r
   )\r
 {\r
   EFI_STATUS                   Status;\r
@@ -267,11 +272,11 @@ BmSetMemoryTypeInformationVariable (
 \r
     if (!EFI_ERROR (Status)) {\r
       //\r
-      // If the Memory Type Information settings have been modified, then reset the platform\r
-      // so the new Memory Type Information setting will be used to guarantee that an S4\r
+      // If the Memory Type Information settings have been modified and the boot option belongs to boot category,\r
+      // then reset the platform so the new Memory Type Information setting will be used to guarantee that an S4\r
       // entry/resume cycle will not fail.\r
       //\r
-      if (MemoryTypeInformationModified) {\r
+      if (MemoryTypeInformationModified && Boot && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {\r
         DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));\r
         gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);\r
       }\r
index 6a888fa35e14c6f33c15d8bb9197ca624d8a6701..fa4d5af0049246fb7cf79c135d054780a88b40bb 100644 (file)
@@ -245,11 +245,16 @@ BmGetImageHeader (
 \r
 /**\r
   This routine adjust the memory information for different memory type and \r
-  save them into the variables for next boot.\r
+  save them into the variables for next boot. It resets the system when\r
+  memory information is updated and the current boot option belongs to\r
+  boot category instead of application category.\r
+\r
+  @param Boot  TRUE if current boot option belongs to boot category instead of\r
+               application category.\r
 **/\r
 VOID\r
 BmSetMemoryTypeInformationVariable (\r
-  VOID\r
+  IN BOOLEAN                    Boot\r
   );\r
 \r
 /**\r