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