From 1c8029e3aa194404c95ec238630eebf6360810f1 Mon Sep 17 00:00:00 2001 From: andrewfish Date: Wed, 7 Jul 2010 23:27:08 +0000 Subject: 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 --- MdeModulePkg/Core/Pei/Image/Image.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'MdeModulePkg') 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; -- cgit v1.2.3