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
This commit is contained in:
andrewfish 2010-07-07 23:27:08 +00:00
parent 27172c0f36
commit 1c8029e3aa
1 changed files with 8 additions and 8 deletions

View File

@ -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)) {
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
//
// 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.
//
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;