summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-07 23:27:08 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-07 23:27:08 +0000
commit1c8029e3aa194404c95ec238630eebf6360810f1 (patch)
treefbc4edc9a6ccf4a490fccdaaf678f1d7ff55b18c /MdeModulePkg/Core
parent27172c0f366fd159ea5789e4e85454d160f37447 (diff)
downloadedk2-platforms-1c8029e3aa194404c95ec238630eebf6360810f1.tar.xz
Update the previous fix to only shadow the function for supported processor architectrues. The old way required non supported processor architectures to opt out.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10637 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/Pei/Image/Image.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c
index 0130d77342..0906548ede 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -116,15 +116,13 @@ GetImageReadFunction (
VOID* MemoryBuffer;
Private = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer ());
-
- if (!Private->PeiMemoryInstalled || (Private->HobList.HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME) ||
- EFI_IMAGE_MACHINE_TYPE_SUPPORTED(EFI_IMAGE_MACHINE_IA64) || EFI_IMAGE_MACHINE_TYPE_SUPPORTED(EFI_IMAGE_MACHINE_ARMTHUMB_MIXED)) {
- //
- // Point to ROM version if memory is not installed, we are in an S3.
- // The shadow code is not ANSI C so skip on IA64 and ARM architectures.
+
+ if ((Private->PeiMemoryInstalled && !(Private->HobList.HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME)) &&
+ (EFI_IMAGE_MACHINE_TYPE_SUPPORTED(EFI_IMAGE_MACHINE_X64) || EFI_IMAGE_MACHINE_TYPE_SUPPORTED(EFI_IMAGE_MACHINE_IA32))) {
+ //
+ // Shadow algorithm makes lots of non ANSI C assumptions and only works for IA32 and X64
+ // compilers that have been tested
//
- ImageContext->ImageRead = PeiImageRead;
- } else {
if (Private->ShadowedImageRead == NULL) {
MemoryBuffer = AllocatePages (0x400 / EFI_PAGE_SIZE + 1);
ASSERT (MemoryBuffer != NULL);
@@ -133,6 +131,8 @@ GetImageReadFunction (
}
ImageContext->ImageRead = Private->ShadowedImageRead;
+ } else {
+ ImageContext->ImageRead = PeiImageRead;
}
return EFI_SUCCESS;