mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
dad63934f9
commit
7caf72a907
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -116,4 +116,5 @@
|
|||
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||
|
||||
[Pcd]
|
||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange
|
||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
|
@ -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_
|
||||
|
|
Loading…
Reference in New Issue