mirror of https://github.com/acidanthera/audk.git
For now PEI Core LoadImage() service to always call LoadAndRelocatePeCoffImage() even for XIP PEIMs.However the AllocatePage invoked in S3 path will make system assert. The patch is to fix it.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9368 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9ecbc6547b
commit
c2a19e9235
|
@ -83,7 +83,7 @@ GetImageReadFunction (
|
|||
|
||||
Private = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer ());
|
||||
|
||||
if (!Private->PeiMemoryInstalled) {
|
||||
if (!Private->PeiMemoryInstalled || (Private->HobList.HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME)) {
|
||||
ImageContext->ImageRead = PeiImageRead;
|
||||
} else {
|
||||
MemoryBuffer = AllocatePages (0x400 / EFI_PAGE_SIZE + 1);
|
||||
|
@ -145,7 +145,7 @@ LoadAndRelocatePeCoffImage (
|
|||
//
|
||||
// Allocate Memory for the image
|
||||
//
|
||||
if (Private->PeiMemoryInstalled) {
|
||||
if ((Private->PeiMemoryInstalled) && (Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {
|
||||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));
|
||||
ASSERT (ImageContext.ImageAddress != 0);
|
||||
|
||||
|
@ -179,7 +179,7 @@ LoadAndRelocatePeCoffImage (
|
|||
//
|
||||
// Flush the instruction cache so the image data is written before we execute it
|
||||
//
|
||||
if (Private->PeiMemoryInstalled) {
|
||||
if ((Private->PeiMemoryInstalled) && (Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {
|
||||
InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue