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();
|
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
|
// Set Boot Current
|
||||||
|
|
|
@ -1096,21 +1096,12 @@ BdsLibGetImageHeader (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
This routine adjust the memory information for different memory type and
|
||||||
This routine is a notification function for legayc boot or exit boot
|
save them into the variables for next 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.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
|
||||||
BdsSetMemoryTypeInformationVariable (
|
BdsSetMemoryTypeInformationVariable (
|
||||||
EFI_EVENT Event,
|
VOID
|
||||||
VOID *Context
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -1238,17 +1229,15 @@ BdsSetMemoryTypeInformationVariable (
|
||||||
// so the new Memory Type Information setting will be used to guarantee that an S4
|
// so the new Memory Type Information setting will be used to guarantee that an S4
|
||||||
// entry/resume cycle will not fail.
|
// entry/resume cycle will not fail.
|
||||||
//
|
//
|
||||||
if (MemoryTypeInformationModified) {
|
if (MemoryTypeInformationModified && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {
|
||||||
DEBUG ((EFI_D_ERROR, "Memory Type Information settings change. Warm Reset!!!\n"));
|
DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));
|
||||||
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
|
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This routine register a function to adjust the different type memory page number
|
This routine is kept for backward compatibility.
|
||||||
just before booting and save the updated info into the variable for next boot to use.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
|
@ -1256,18 +1245,6 @@ BdsLibSaveMemoryTypeInformation (
|
||||||
VOID
|
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
|
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange
|
||||||
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
|
@ -111,4 +111,13 @@ BdsLibGetImageHeader (
|
||||||
OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
|
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_
|
#endif // _BDS_LIB_H_
|
||||||
|
|
Loading…
Reference in New Issue