/** @file\r
Pei Core Load Image Support\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation \r
+Copyright (c) 2006 - 2009, Intel Corporation \r
All rights reserved. This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
Machine = PeCoffLoaderGetMachineType (Pe32Data);\r
\r
if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Machine)) {\r
- return EFI_UNSUPPORTED; \r
+ if (!EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED (Machine)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
}\r
\r
if (ImageAddressArg != NULL) {\r
//\r
// Print debug message: Loading PEIM at 0x12345678 EntryPoint=0x12345688 Driver.efi\r
//\r
- if (Machine != IMAGE_FILE_MACHINE_IA64) {\r
+ if (Machine != EFI_IMAGE_MACHINE_IA64) {\r
DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%11p EntryPoint=0x%11p ", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)*EntryPoint));\r
} else {\r
//\r
AuthenticationState\r
);\r
if (!EFI_ERROR (Status)) {\r
+ //\r
+ // The image to be started must have the machine type supported by PeiCore.\r
+ //\r
+ ASSERT (EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCoffLoaderGetMachineType ((VOID *) (UINTN) ImageAddress)));\r
+ if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCoffLoaderGetMachineType ((VOID *) (UINTN) ImageAddress))) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
return Status;\r
}\r
}\r
Index++;\r
} while (!EFI_ERROR (PpiStatus));\r
\r
- //\r
- // If no instances reports EFI_SUCCESS, then build-in support for\r
- // the PE32+/TE XIP image format is used.\r
- //\r
- Status = PeiLoadImageLoadImage (\r
- PeiServices, \r
- FileHandle, \r
- NULL, \r
- NULL, \r
- EntryPoint, \r
- AuthenticationState\r
- );\r
- return Status;\r
+ return PpiStatus;\r
}\r
\r
\r