]>
Commit | Line | Data |
---|---|---|
5879b875 | 1 | /** @file\r |
2 | Load image file from fv to memory. \r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation \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 | |
5879b875 | 13 | @par Revision Reference:\r |
14 | This PPI is defined in PI Version 1.00.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __FV_FILE_LOADER_PPI_H__\r | |
19 | #define __FV_FILE_LOADER_PPI_H__\r | |
20 | \r | |
21 | #define EFI_PEI_LOAD_FILE_PPI_GUID \\r | |
00edb218 | 22 | { 0xb9e0abfe, 0x5979, 0x4914, { 0x97, 0x7f, 0x6d, 0xee, 0x78, 0xc2, 0x78, 0xa6 } }\r |
5879b875 | 23 | \r |
24 | \r | |
00edb218 | 25 | typedef struct _EFI_PEI_LOAD_FILE_PPI EFI_PEI_LOAD_FILE_PPI;\r |
5879b875 | 26 | \r |
27 | /**\r | |
28 | This service is the single member function of EFI_LOAD_FILE_PPI. This service separates\r | |
29 | image loading and relocating from the PEI Foundation.\r | |
30 | \r | |
00edb218 | 31 | @param This Interface pointer that implements\r |
5879b875 | 32 | the Load File PPI instance.\r |
33 | \r | |
00edb218 A |
34 | @param FileHandle File handle of the file to load.\r |
35 | Type EFI_PEI_FILE_HANDLE is defined in\r | |
36 | FfsFindNextFile().\r | |
5879b875 | 37 | \r |
00edb218 A |
38 | @param ImageAddress Pointer to the address of the\r |
39 | loaded image.\r | |
5879b875 | 40 | \r |
00edb218 | 41 | @param ImageSize Pointer to the size of the loaded\r |
5879b875 | 42 | image.\r |
43 | \r | |
00edb218 | 44 | @param EntryPoint Pointer to the entry point of the\r |
5879b875 | 45 | image.\r |
46 | \r | |
00edb218 | 47 | @param AuthenticationState On exit, points to the attestation\r |
5879b875 | 48 | authentication state of the image\r |
49 | or 0 if no attestation was\r | |
50 | performed. The format of\r | |
51 | AuthenticationState is defined in\r | |
52 | EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI.ExtractSection()\r | |
53 | \r | |
54 | \r | |
00edb218 | 55 | @retval EFI_SUCCESS The image was loaded successfully.\r |
5879b875 | 56 | \r |
00edb218 | 57 | @retval EFI_OUT_OF_RESOURCES There was not enough memory.\r |
5879b875 | 58 | \r |
00edb218 | 59 | @retval EFI_LOAD_ERROR There was no supported image in\r |
5879b875 | 60 | the file EFI_INVALID_PARAMETER\r |
61 | FileHandle was not a valid\r | |
62 | firmware file handle.\r | |
00edb218 | 63 | @retval EFI_INVALID_PARAMETER EntryPoint was NULL.\r |
5879b875 | 64 | \r |
00edb218 A |
65 | @retval EFI_NOT_SUPPORTED An image requires relocations or\r |
66 | is not memory mapped.\r | |
5879b875 | 67 | \r |
68 | **/\r | |
69 | typedef\r | |
70 | EFI_STATUS\r | |
71 | (EFIAPI *EFI_PEI_LOAD_FILE) (\r | |
00edb218 A |
72 | IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r |
73 | IN CONST EFI_PEI_FILE_HANDLE FileHandle,\r | |
74 | OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r | |
75 | OUT UINT64 *ImageSize,\r | |
76 | OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r | |
77 | OUT UINT32 *AuthenticationState\r | |
5879b875 | 78 | );\r |
79 | \r | |
80 | \r | |
81 | /**\r | |
82 | This PPI is a pointer to the Load File service.\r | |
83 | This service will be published by a PEIM. The PEI Foundation\r | |
84 | will use this service to launch the known PEI module images.\r | |
85 | \r | |
86 | \r | |
87 | @param LoadFile Loads a PEIM into memory for subsequent\r | |
88 | execution. See the LoadFile() function\r | |
89 | description.\r | |
90 | \r | |
91 | **/\r | |
92 | struct _EFI_PEI_LOAD_FILE_PPI {\r | |
00edb218 | 93 | EFI_PEI_LOAD_FILE LoadFile;\r |
5879b875 | 94 | };\r |
95 | \r | |
96 | \r | |
97 | \r | |
98 | #define EFI_PEI_FV_FILE_LOADER_GUID \\r | |
99 | { \\r | |
100 | 0x7e1f0d85, 0x4ff, 0x4bb2, {0x86, 0x6a, 0x31, 0xa2, 0x99, 0x6a, 0x48, 0xa8 } \\r | |
101 | }\r | |
102 | \r | |
103 | typedef struct _EFI_PEI_FV_FILE_LOADER_PPI EFI_PEI_FV_FILE_LOADER_PPI;\r | |
104 | \r | |
105 | /**\r | |
106 | Loads a PEIM into memory for subsequent execution.\r | |
107 | \r | |
108 | @param This Interface pointer that implements the Load File PPI instance.\r | |
109 | @param FfsHeader Pointer to the FFS header of the file to load.\r | |
110 | @param ImageAddress Pointer to the address of the loaded Image\r | |
111 | @param ImageSize Pointer to the size of the loaded image.\r | |
112 | @param EntryPoint Pointer to the entry point of the image.\r | |
113 | \r | |
114 | @retval EFI_SUCCESS The image was loaded successfully.\r | |
115 | @retval EFI_OUT_OF_RESOURCES There was not enough memory.\r | |
116 | @retval EFI_INVALID_PARAMETER The contents of the FFS file did not\r | |
117 | contain a valid PE/COFF image that could be loaded.\r | |
118 | \r | |
119 | **/\r | |
120 | typedef\r | |
121 | EFI_STATUS\r | |
122 | (EFIAPI *EFI_PEI_FV_LOAD_FILE) (\r | |
123 | IN EFI_PEI_FV_FILE_LOADER_PPI *This,\r | |
124 | IN EFI_FFS_FILE_HEADER *FfsHeader,\r | |
125 | OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r | |
126 | OUT UINT64 *ImageSize,\r | |
127 | OUT EFI_PHYSICAL_ADDRESS *EntryPoint\r | |
128 | );\r | |
129 | \r | |
130 | /**\r | |
131 | @par Ppi Description:\r | |
132 | This PPI is a pointer to the Load File service. This service will be \r | |
133 | published by a PEIM.The PEI Foundation will use this service to \r | |
134 | launch the known non-XIP PE/COFF PEIM images. This service may \r | |
135 | depend upon the presence of the EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI.\r | |
136 | \r | |
137 | @param FvLoadFile\r | |
138 | Loads a PEIM into memory for subsequent execution\r | |
139 | \r | |
140 | **/\r | |
141 | struct _EFI_PEI_FV_FILE_LOADER_PPI {\r | |
142 | EFI_PEI_FV_LOAD_FILE FvLoadFile;\r | |
143 | };\r | |
144 | \r | |
145 | extern EFI_GUID gEfiPeiFvFileLoaderPpiGuid;\r | |
146 | \r | |
147 | #endif\r |