]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
MdePkg: Apply uncrustify changes
[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
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
d071fb19 6\r
d071fb19 7**/\r
8\r
f734a10a 9#include "BasePeCoffLibInternals.h"\r
d071fb19 10\r
d071fb19 11/**\r
efb23117 12 Performs an Itanium-based specific relocation fixup and is a no-op on other\r
13 instruction sets.\r
d071fb19 14\r
2fc59a00 15 @param Reloc The pointer to the relocation record.\r
16 @param Fixup The pointer to the address to fix up.\r
17 @param FixupData The pointer to a buffer to log the fixups.\r
d071fb19 18 @param Adjust The offset to adjust the fixup.\r
19\r
efb23117 20 @return Status code.\r
d071fb19 21\r
22**/\r
23RETURN_STATUS\r
24PeCoffLoaderRelocateImageEx (\r
2f88bd3a
MK
25 IN UINT16 *Reloc,\r
26 IN OUT CHAR8 *Fixup,\r
27 IN OUT CHAR8 **FixupData,\r
28 IN UINT64 Adjust\r
d071fb19 29 )\r
30{\r
31 return RETURN_UNSUPPORTED;\r
32}\r
33\r
34/**\r
efb23117 35 Returns TRUE if the machine type of PE/COFF image is supported. Supported\r
d071fb19 36 does not mean the image can be executed it means the PE/COFF loader supports\r
37 loading and relocating of the image type. It's up to the caller to support\r
efb23117 38 the entry point.\r
9095d37b 39\r
981b0f90 40 The IA32/X64 version PE/COFF loader/relocater both support IA32, X64 and EBC images.\r
d071fb19 41\r
2fc59a00 42 @param Machine The machine type from the PE Header.\r
d071fb19 43\r
44 @return TRUE if this PE/COFF loader can load the image\r
45\r
46**/\r
47BOOLEAN\r
48PeCoffLoaderImageFormatSupported (\r
49 IN UINT16 Machine\r
50 )\r
51{\r
9095d37b 52 if ((Machine == IMAGE_FILE_MACHINE_I386) || (Machine == IMAGE_FILE_MACHINE_X64) ||\r
2f88bd3a
MK
53 (Machine == IMAGE_FILE_MACHINE_EBC) || (Machine == IMAGE_FILE_MACHINE_ARM64))\r
54 {\r
9095d37b 55 return TRUE;\r
d071fb19 56 }\r
57\r
58 return FALSE;\r
59}\r
60\r
61/**\r
62 Performs an Itanium-based specific re-relocation fixup and is a no-op on other\r
63 instruction sets. This is used to re-relocated the image into the EFI virtual\r
64 space for runtime calls.\r
65\r
2fc59a00 66 @param Reloc The pointer to the relocation record.\r
67 @param Fixup The pointer to the address to fix up.\r
68 @param FixupData The pointer to a buffer to log the fixups.\r
d071fb19 69 @param Adjust The offset to adjust the fixup.\r
70\r
efb23117 71 @return Status code.\r
d071fb19 72\r
73**/\r
74RETURN_STATUS\r
75PeHotRelocateImageEx (\r
2f88bd3a
MK
76 IN UINT16 *Reloc,\r
77 IN OUT CHAR8 *Fixup,\r
78 IN OUT CHAR8 **FixupData,\r
79 IN UINT64 Adjust\r
d071fb19 80 )\r
81{\r
82 return RETURN_UNSUPPORTED;\r
83}\r