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