]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
1) Remove UEFI specific defines from IndustryStandard/PeImage.h
[mirror_edk2.git] / MdePkg / Library / BasePeCoffLib / PeCoffLoaderEx.c
CommitLineData
d071fb19 1/** @file\r
2bfb6009 2 Specific relocation fixups for none Itanium architecture.\r
d071fb19 3\r
2bfb6009 4 Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
d071fb19 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
d071fb19 13**/\r
14\r
f734a10a 15#include "BasePeCoffLibInternals.h"\r
d071fb19 16\r
17\r
d071fb19 18/**\r
efb23117 19 Performs an Itanium-based specific relocation fixup and is a no-op on other\r
20 instruction sets.\r
d071fb19 21\r
22 @param Reloc Pointer to the relocation record.\r
23 @param Fixup Pointer to the address to fix up.\r
24 @param FixupData Pointer to a buffer to log the fixups.\r
25 @param Adjust The offset to adjust the fixup.\r
26\r
efb23117 27 @return Status code.\r
d071fb19 28\r
29**/\r
30RETURN_STATUS\r
31PeCoffLoaderRelocateImageEx (\r
32 IN UINT16 *Reloc,\r
33 IN OUT CHAR8 *Fixup,\r
34 IN OUT CHAR8 **FixupData,\r
35 IN UINT64 Adjust\r
36 )\r
37{\r
38 return RETURN_UNSUPPORTED;\r
39}\r
40\r
41/**\r
efb23117 42 Returns TRUE if the machine type of PE/COFF image is supported. Supported\r
d071fb19 43 does not mean the image can be executed it means the PE/COFF loader supports\r
44 loading and relocating of the image type. It's up to the caller to support\r
efb23117 45 the entry point.\r
d071fb19 46\r
47 @param Machine Machine type from the PE Header.\r
48\r
49 @return TRUE if this PE/COFF loader can load the image\r
50\r
51**/\r
52BOOLEAN\r
53PeCoffLoaderImageFormatSupported (\r
54 IN UINT16 Machine\r
55 )\r
56{\r
4ab0dff3 57 if ((Machine == IMAGE_FILE_MACHINE_I386) || (Machine == IMAGE_FILE_MACHINE_X64) || \r
58 (Machine == IMAGE_FILE_MACHINE_EBC)) {\r
d071fb19 59 return TRUE; \r
60 }\r
61\r
62 return FALSE;\r
63}\r
64\r
65/**\r
66 Performs an Itanium-based specific re-relocation fixup and is a no-op on other\r
67 instruction sets. This is used to re-relocated the image into the EFI virtual\r
68 space for runtime calls.\r
69\r
70 @param Reloc Pointer to the relocation record.\r
71 @param Fixup Pointer to the address to fix up.\r
72 @param FixupData Pointer to a buffer to log the fixups.\r
73 @param Adjust The offset to adjust the fixup.\r
74\r
efb23117 75 @return Status code.\r
d071fb19 76\r
77**/\r
78RETURN_STATUS\r
79PeHotRelocateImageEx (\r
80 IN UINT16 *Reloc,\r
81 IN OUT CHAR8 *Fixup,\r
82 IN OUT CHAR8 **FixupData,\r
83 IN UINT64 Adjust\r
84 )\r
85{\r
86 return RETURN_UNSUPPORTED;\r
87}\r
88\r