]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Reset system only when the pre-allocated memory is more than 1.5 of needed memory...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 27 Sep 2012 02:57:01 +0000 (02:57 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 27 Sep 2012 02:57:01 +0000 (02:57 +0000)
Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com>
Reviewed-by: Elvin Li<elvin.li@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13748 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c

index da91b7d096a1a47f5229936a415c9c19b7015a63..971188bd0a85620331b3bf5287f8bd7544518105 100644 (file)
@@ -1283,10 +1283,8 @@ BdsLibGetImageHeader (
 }\r
 \r
 /**\r
-  This routine adjusts the memory information for different memory type and \r
-  saves them into the variables for next boot. It conditionally resets the\r
-  system when the memory information changes. Platform can reserve memory \r
-  large enough (125% of actual requirement) to avoid the reset in the first boot.\r
+  This routine adjust the memory information for different memory type and \r
+  save them into the variables for next boot.\r
 **/\r
 VOID\r
 BdsSetMemoryTypeInformationVariable (\r
@@ -1392,13 +1390,14 @@ BdsSetMemoryTypeInformationVariable (
     Next     = Previous;\r
 \r
     //\r
-    // Write next varible to 125% * current and Inconsistent Memory Reserved across bootings may lead to S4 fail\r
+    // Inconsistent Memory Reserved across bootings may lead to S4 fail\r
+    // Write next varible to 125% * current when the pre-allocated memory is:\r
+    //  1. More than 150% of needed memory and boot mode is BOOT_WITH_DEFAULT_SETTING\r
+    //  2. Less than the needed memory\r
     //\r
-    if (Current < Previous) {\r
+    if ((Current + (Current >> 1)) < Previous) {\r
       if (BootMode == BOOT_WITH_DEFAULT_SETTINGS) {\r
         Next = Current + (Current >> 2);\r
-      } else if (!MemoryTypeInformationVariableExists) {\r
-        Next = MAX (Current + (Current >> 2), Previous);\r
       }\r
     } else if (Current > Previous) {\r
       Next = Current + (Current >> 2);\r