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