summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-22 05:25:03 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-22 05:25:03 +0000
commit7caf72a907ef9b71e7c8f1c27c5b4eda98225689 (patch)
tree846ef0e9c417fe5d51fb17a729a8005cce2f6da4 /IntelFrameworkModulePkg
parentdad63934f9b77f64768090433df67c335e229112 (diff)
downloadedk2-platforms-7caf72a907ef9b71e7c8f1c27c5b4eda98225689.tar.xz
Use PcdResetOnMemoryTypeInformationChange in MdeModulePkg to control whether to reset system when memory type information changes.
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
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c6
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c35
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf3
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h9
4 files changed, 23 insertions, 30 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
index a6a91186f1..8ee0b3e698 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -227,6 +227,12 @@ BdsLibBootViaBootOption (
//
EfiSignalEventReadyToBoot();
+ //
+ // Adjust the different type memory page number just before booting
+ // and save the updated info into the variable for next boot to use
+ //
+ BdsSetMemoryTypeInformationVariable ();
+
//
// Set Boot Current
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
index 3d2e199e52..1e88922630 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
@@ -1096,21 +1096,12 @@ BdsLibGetImageHeader (
}
/**
-
- This routine is a notification function for legayc boot or exit boot
- service event. It will adjust the memory information for different
- memory type and save them into the variables for next boot.
-
-
- @param Event The event that triggered this notification function.
- @param Context Pointer to the notification functions context.
-
+ This routine adjust the memory information for different memory type and
+ save them into the variables for next boot.
**/
VOID
-EFIAPI
BdsSetMemoryTypeInformationVariable (
- EFI_EVENT Event,
- VOID *Context
+ VOID
)
{
EFI_STATUS Status;
@@ -1238,17 +1229,15 @@ BdsSetMemoryTypeInformationVariable (
// so the new Memory Type Information setting will be used to guarantee that an S4
// entry/resume cycle will not fail.
//
- if (MemoryTypeInformationModified) {
- DEBUG ((EFI_D_ERROR, "Memory Type Information settings change. Warm Reset!!!\n"));
+ if (MemoryTypeInformationModified && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {
+ DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
}
}
}
/**
- This routine register a function to adjust the different type memory page number
- just before booting and save the updated info into the variable for next boot to use.
-
+ This routine is kept for backward compatibility.
**/
VOID
EFIAPI
@@ -1256,18 +1245,6 @@ BdsLibSaveMemoryTypeInformation (
VOID
)
{
- EFI_STATUS Status;
- EFI_EVENT ReadyToBootEvent;
-
- Status = EfiCreateEventReadyToBootEx (
- TPL_CALLBACK,
- BdsSetMemoryTypeInformationVariable,
- NULL,
- &ReadyToBootEvent
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR,"Bds Set Memory Type Informationa Variable Fails\n"));
- }
}
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
index 8db77c12a6..1f773f3571 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
@@ -116,4 +116,5 @@
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
[Pcd]
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile \ No newline at end of file
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h b/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
index 90ffa610da..326aa91203 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
@@ -111,4 +111,13 @@ BdsLibGetImageHeader (
OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
);
+/**
+ This routine adjust the memory information for different memory type and
+ save them into the variables for next boot.
+**/
+VOID
+BdsSetMemoryTypeInformationVariable (
+ VOID
+ );
+
#endif // _BDS_LIB_H_