summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Core/Pei
diff options
context:
space:
mode:
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-31 07:18:41 +0000
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-31 07:18:41 +0000
commita8b194b97cd4d0cd46ce9880293c4500bd841fc1 (patch)
tree2946b896350c071dad8e53ee9ae3d32f197fb20e /EdkModulePkg/Core/Pei
parent03a053669fdbd4bc49f336a8d29d059ec181db35 (diff)
downloadedk2-a8b194b97cd4d0cd46ce9880293c4500bd841fc1.zip
edk2-a8b194b97cd4d0cd46ce9880293c4500bd841fc1.tar.gz
edk2-a8b194b97cd4d0cd46ce9880293c4500bd841fc1.tar.bz2
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
Diffstat (limited to 'EdkModulePkg/Core/Pei')
-rw-r--r--EdkModulePkg/Core/Pei/Image/Image.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/EdkModulePkg/Core/Pei/Image/Image.c b/EdkModulePkg/Core/Pei/Image/Image.c
index dfe4668..2029368 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
//