]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePeCoffLib/Ia32/PeCoffLoaderEx.c
Add in BasePeCoff library instance.
[mirror_edk2.git] / MdePkg / Library / BasePeCoffLib / Ia32 / PeCoffLoaderEx.c
CommitLineData
d071fb19 1/** @file\r
2 IA-32 Specific relocation fixups.\r
3\r
4 Copyright (c) 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 Module Name: PeCoffLoaderEx.c\r
14\r
15**/\r
16\r
17\r
18\r
19\r
20\r
21//\r
22// Include common header file for this module.\r
23//\r
24#include "CommonHeader.h"\r
25\r
26/**\r
27 Performs an IA-32 specific relocation fixup.\r
28\r
29 @param Reloc Pointer to the relocation record.\r
30 @param Fixup Pointer to the address to fix up.\r
31 @param FixupData Pointer to a buffer to log the fixups.\r
32 @param Adjust The offset to adjust the fixup.\r
33\r
34 @retval EFI_UNSUPPORTED Unsupported now.\r
35\r
36**/\r
37RETURN_STATUS\r
38PeCoffLoaderRelocateImageEx (\r
39 IN UINT16 *Reloc,\r
40 IN OUT CHAR8 *Fixup,\r
41 IN OUT CHAR8 **FixupData,\r
42 IN UINT64 Adjust\r
43 )\r
44{\r
45 return RETURN_UNSUPPORTED;\r
46}\r
47\r
48/**\r
49 Returns TRUE if the machine type of PE/COFF image is supported. Supported \r
50 does not mean the image can be executed it means the PE/COFF loader supports\r
51 loading and relocating of the image type. It's up to the caller to support\r
52 the entry point. \r
53\r
54 This function implies the basic PE/COFF loader/relocator supports IA32, EBC,\r
55 & X64 images. Calling the entry point in a correct mannor is up to the \r
56 consumer of this library.\r
57\r
58 @param Machine Machine type from the PE Header.\r
59\r
60 @return TRUE if this PE/COFF loader can load the image\r
61\r
62**/\r
63BOOLEAN\r
64PeCoffLoaderImageFormatSupported (\r
65 IN UINT16 Machine\r
66 )\r
67{\r
68 if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) || \r
69 (Machine == EFI_IMAGE_MACHINE_EBC)) {\r
70 return TRUE; \r
71 }\r
72\r
73 return FALSE;\r
74}\r
75\r
76/**\r
77 Performs an Itanium-based specific re-relocation fixup and is a no-op on other\r
78 instruction sets. This is used to re-relocated the image into the EFI virtual\r
79 space for runtime calls.\r
80\r
81 @param Reloc Pointer to the relocation record.\r
82 @param Fixup Pointer to the address to fix up.\r
83 @param FixupData Pointer to a buffer to log the fixups.\r
84 @param Adjust The offset to adjust the fixup.\r
85\r
86 @return Status code.\r
87\r
88**/\r
89RETURN_STATUS\r
90PeHotRelocateImageEx (\r
91 IN UINT16 *Reloc,\r
92 IN OUT CHAR8 *Fixup,\r
93 IN OUT CHAR8 **FixupData,\r
94 IN UINT64 Adjust\r
95 )\r
96{\r
97 return RETURN_UNSUPPORTED;\r
98}\r
99\r