From a8b194b97cd4d0cd46ce9880293c4500bd841fc1 Mon Sep 17 00:00:00 2001 From: xgu3 Date: Wed, 31 Jan 2007 07:18:41 +0000 Subject: 1. PEI core needs to check image machine type 2. In BDS, Legacy free may make BdsLibConnectAllDefaultConsoles fail. 3. Pci22.h, we need to add more definition in that 4. EBC: EBC Exception Subclass should add EFI_SUBCLASS_SPECIFIC 5. PciEnumeratorSupport Null Pointer Error git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2340 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Core/Pei/Image/Image.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'EdkModulePkg/Core') diff --git a/EdkModulePkg/Core/Pei/Image/Image.c b/EdkModulePkg/Core/Pei/Image/Image.c index dfe4668c1b..202936869b 100644 --- a/EdkModulePkg/Core/Pei/Image/Image.c +++ b/EdkModulePkg/Core/Pei/Image/Image.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2006, Intel Corporation +Copyright (c) 2006 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -56,6 +56,7 @@ Returns: UINT64 ImageSize; EFI_PHYSICAL_ADDRESS ImageEntryPoint; EFI_TE_IMAGE_HEADER *TEImageHeader; + UINT16 Machine; *EntryPoint = NULL; TEImageHeader = NULL; @@ -114,7 +115,7 @@ Returns: // Retrieve the entry point from the TE image header // ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) TEImageHeader; - *EntryPoint = (VOID *)((UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) + + *EntryPoint = (VOID *)((UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) + TEImageHeader->AddressOfEntryPoint - TEImageHeader->StrippedSize); } } else { @@ -128,6 +129,17 @@ Returns: } } + if (((EFI_TE_IMAGE_HEADER *) (UINTN) ImageAddress)->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) { + TEImageHeader = (EFI_TE_IMAGE_HEADER *) (UINTN) ImageAddress; + Machine = TEImageHeader->Machine; + } else { + Machine = PeCoffLoaderGetMachineType (Pe32Data); + } + + if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Machine)) { + return EFI_UNSUPPORTED; + } + // // Print debug message: Loading PEIM at 0x12345678 EntryPoint=0x12345688 Driver.efi // -- cgit v1.2.3