]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
Update the text to use "x64" instead of "X64" in MdePkg.
[mirror_edk2.git] / MdePkg / Library / BasePeCoffLib / PeCoffLoaderEx.c
1 /** @file
2 Specific relocation fixups for none Itanium architecture.
3
4 Copyright (c) 2006 - 2008, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "BasePeCoffLibInternals.h"
16
17
18 /**
19 Performs an IA-32 specific relocation fixup.
20
21 @param Reloc Pointer to the relocation record.
22 @param Fixup Pointer to the address to fix up.
23 @param FixupData Pointer to a buffer to log the fixups.
24 @param Adjust The offset to adjust the fixup.
25
26 @retval EFI_UNSUPPORTED Unsupported now.
27
28 **/
29 RETURN_STATUS
30 PeCoffLoaderRelocateImageEx (
31 IN UINT16 *Reloc,
32 IN OUT CHAR8 *Fixup,
33 IN OUT CHAR8 **FixupData,
34 IN UINT64 Adjust
35 )
36 {
37 return RETURN_UNSUPPORTED;
38 }
39
40 /**
41 Returns TRUE if the machine type of PE/COFF image is supported. Supported
42 does not mean the image can be executed it means the PE/COFF loader supports
43 loading and relocating of the image type. It's up to the caller to support
44 the entry point.
45
46 This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
47 & x64 images. Calling the entry point in a correct mannor is up to the
48 consumer of this library.
49
50 @param Machine Machine type from the PE Header.
51
52 @return TRUE if this PE/COFF loader can load the image
53
54 **/
55 BOOLEAN
56 PeCoffLoaderImageFormatSupported (
57 IN UINT16 Machine
58 )
59 {
60 if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) ||
61 (Machine == EFI_IMAGE_MACHINE_EBC)) {
62 return TRUE;
63 }
64
65 return FALSE;
66 }
67
68 /**
69 Performs an Itanium-based specific re-relocation fixup and is a no-op on other
70 instruction sets. This is used to re-relocated the image into the EFI virtual
71 space for runtime calls.
72
73 @param Reloc Pointer to the relocation record.
74 @param Fixup Pointer to the address to fix up.
75 @param FixupData Pointer to a buffer to log the fixups.
76 @param Adjust The offset to adjust the fixup.
77
78 @return Always return UNSUPPORTED.
79
80 **/
81 RETURN_STATUS
82 PeHotRelocateImageEx (
83 IN UINT16 *Reloc,
84 IN OUT CHAR8 *Fixup,
85 IN OUT CHAR8 **FixupData,
86 IN UINT64 Adjust
87 )
88 {
89 return RETURN_UNSUPPORTED;
90 }
91