diff options
author | jchen20 <jchen20@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-10-26 06:54:55 +0000 |
---|---|---|
committer | jchen20 <jchen20@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-10-26 06:54:55 +0000 |
commit | c2a19e92350dbb721dc4234d96d7bcaf47c8b9df (patch) | |
tree | dcdc3e590faf875f4d00eea2f8ceaef8c5295ea6 /MdeModulePkg/Core | |
parent | 9ecbc6547b2189cf297c0fa91318591fa1eed75a (diff) | |
download | edk2-platforms-c2a19e92350dbb721dc4234d96d7bcaf47c8b9df.tar.xz |
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
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r-- | MdeModulePkg/Core/Pei/Image/Image.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index 019c76972d..5e57ecd889 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -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);
}
|