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