]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Use PcdResetOnMemoryTypeInformationChange in MdeModulePkg to control whether to reset...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 22 Nov 2010 05:25:03 +0000 (05:25 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 22 Nov 2010 05:25:03 +0000 (05:25 +0000)
Check memory type information after signaling the ReadyToBoot event.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11080 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h

index a6a91186f1cb3082b4581f66b2fd276b3bd92fc9..8ee0b3e6986a27749ee628d2fa3882346d0c9ac2 100644 (file)
@@ -227,6 +227,12 @@ BdsLibBootViaBootOption (
   //\r
   EfiSignalEventReadyToBoot();\r
 \r
+  //\r
+  // 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
+  BdsSetMemoryTypeInformationVariable ();\r
+\r
 \r
   //\r
   // Set Boot Current\r
index 3d2e199e52e86123f6ef8b0dc6f6f995d9957668..1e88922630889d81e312f272349d542148d10174 100644 (file)
@@ -1096,21 +1096,12 @@ BdsLibGetImageHeader (
 }\r
 \r
 /**\r
-\r
-  This routine is a notification function for legayc boot or exit boot\r
-  service event. It will adjust the memory information for different\r
-  memory type and save them into the variables for next boot.\r
-\r
-\r
-  @param Event           The event that triggered this notification function.\r
-  @param Context         Pointer to the notification functions context.\r
-\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
-EFIAPI\r
 BdsSetMemoryTypeInformationVariable (\r
-  EFI_EVENT  Event,\r
-  VOID       *Context\r
+  VOID\r
   )\r
 {\r
   EFI_STATUS                   Status;\r
@@ -1238,17 +1229,15 @@ BdsSetMemoryTypeInformationVariable (
     // 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
-      DEBUG ((EFI_D_ERROR, "Memory Type Information settings change. Warm Reset!!!\n"));\r
+    if (MemoryTypeInformationModified && 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
   }\r
 }\r
 \r
 /**\r
-  This routine register a function to adjust the different type memory page number\r
-  just before booting and save the updated info into the variable for next boot to use.\r
-\r
+  This routine is kept for backward compatibility.\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -1256,18 +1245,6 @@ BdsLibSaveMemoryTypeInformation (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                   Status;\r
-  EFI_EVENT                    ReadyToBootEvent;\r
-\r
-  Status = EfiCreateEventReadyToBootEx (\r
-           TPL_CALLBACK,\r
-           BdsSetMemoryTypeInformationVariable,\r
-           NULL,\r
-           &ReadyToBootEvent\r
-           );\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR,"Bds Set Memory Type Informationa Variable Fails\n"));\r
-  }\r
 }\r
 \r
 \r
index 8db77c12a64b3649ba177ef04650bc42a4263ea0..1f773f357142606640c0e901bc0ef9d37c103c8e 100644 (file)
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
 \r
 [Pcd]\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
\ No newline at end of file
index 90ffa610daf9854a828eaff5f82f8962524831c8..326aa91203b5788a85c61e5f8892d717ab935f78 100644 (file)
@@ -111,4 +111,13 @@ BdsLibGetImageHeader (
   OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr\r
   );\r
 \r
+/**\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
+  VOID\r
+  );\r
+\r
 #endif // _BDS_LIB_H_\r