1/*++ 2 3Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR> 4This program and the accompanying materials 5are licensed and made available under the terms and conditions of the BSD License 6which accompanies this distribution. The full text of the license may be found at 7http://opensource.org/licenses/bsd-license.php 8 9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 12Module Name: 13 14 PeCoffLoaderEx.c 15 16Abstract: 17 18 IA-32 Specific relocation fixups 19 20Revision History 21 22--*/ 23 24#include "TianoCommon.h" 25#include "EfiImage.h" 26 27EFI_STATUS 28PeCoffLoaderRelocateImageEx ( 29 IN UINT16 *Reloc, 30 IN OUT CHAR8 *Fixup, 31 IN OUT CHAR8 **FixupData, 32 IN UINT64 Adjust 33 ) 34/*++ 35 36Routine Description: 37 38 Performs an IA-32 specific relocation fixup 39 40Arguments: 41 42 Reloc - Pointer to the relocation record 43 44 Fixup - Pointer to the address to fix up 45 46 FixupData - Pointer to a buffer to log the fixups 47 48 Adjust - The offset to adjust the fixup 49 50Returns: 51 52 EFI_UNSUPPORTED - relocate unsupported 53 54--*/ 55{ 56 return EFI_UNSUPPORTED; 57} 58 59BOOLEAN 60PeCoffLoaderImageFormatSupported ( 61 IN UINT16 Machine 62 ) 63/*++ 64Routine Description: 65 66 Returns TRUE if the machine type of PE/COFF image is supported. Supported 67 does not mean the image can be executed it means the PE/COFF loader supports 68 loading and relocating of the image type. It's up to the caller to support 69 the entry point. 70 71 This function implies the basic PE/COFF loader/relocator supports IA32, EBC, 72 & X64 images. Calling the entry point in a correct mannor is up to the 73 consumer of this library. 74 75Arguments: 76 77 Machine - Machine type from the PE Header. 78 79Returns: 80 81 TRUE - if this PE/COFF loader can load the image 82 FALSE - if this PE/COFF loader cannot load the image 83 84--*/ 85{ 86 if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) || 87 (Machine == EFI_IMAGE_MACHINE_EBC)) { 88 return TRUE; 89 } 90 91 return FALSE; 92} 93 94