]>
Commit | Line | Data |
---|---|---|
c311f86b | 1 | /** @file\r |
5879b875 | 2 | This file provides functions for accessing a memory-mapped firmware volume of a specific format.\r |
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 |
5879b875 | 6 | \r |
5879b875 | 7 | @par Revision Reference:\r |
44218d2e | 8 | This PPI is from PI Version 1.0 errata.\r |
5879b875 | 9 | \r |
10 | **/\r | |
11 | \r | |
12 | #ifndef __FIRMWARE_VOLUME_PPI_H__\r | |
13 | #define __FIRMWARE_VOLUME_PPI_H__\r | |
14 | \r | |
06889842 | 15 | ///\r |
16 | /// The GUID for this PPI is the same as the firmware volume format GUID.\r | |
dafa11b1 | 17 | /// The FV format can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for a user-defined\r |
18 | /// format. The EFI_FIRMWARE_FILE_SYSTEM2_GUID is the PI Firmware Volume format.\r | |
9095d37b | 19 | ///\r |
2f88bd3a | 20 | typedef struct _EFI_PEI_FIRMWARE_VOLUME_PPI EFI_PEI_FIRMWARE_VOLUME_PPI;\r |
5879b875 | 21 | \r |
22 | /**\r | |
d7132512 LG |
23 | Process a firmware volume and create a volume handle.\r |
24 | \r | |
5879b875 | 25 | Create a volume handle from the information in the buffer. For\r |
26 | memory-mapped firmware volumes, Buffer and BufferSize refer to\r | |
27 | the start of the firmware volume and the firmware volume size.\r | |
28 | For non memory-mapped firmware volumes, this points to a\r | |
29 | buffer which contains the necessary information for creating\r | |
30 | the firmware volume handle. Normally, these values are derived\r | |
31 | from the EFI_FIRMWARE_VOLUME_INFO_PPI.\r | |
9095d37b LG |
32 | \r |
33 | \r | |
dafa11b1 | 34 | @param This Points to this instance of the\r |
35 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
36 | @param Buffer Points to the start of the buffer.\r | |
37 | @param BufferSize Size of the buffer.\r | |
38 | @param FvHandle Points to the returned firmware volume\r | |
39 | handle. The firmware volume handle must\r | |
9095d37b | 40 | be unique within the system.\r |
5879b875 | 41 | \r |
dafa11b1 | 42 | @retval EFI_SUCCESS Firmware volume handle created.\r |
00edb218 | 43 | @retval EFI_VOLUME_CORRUPTED Volume was corrupt.\r |
5879b875 | 44 | \r |
45 | **/\r | |
46 | typedef\r | |
47 | EFI_STATUS\r | |
8b13229b | 48 | (EFIAPI *EFI_PEI_FV_PROCESS_FV)(\r |
dafa11b1 | 49 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r |
50 | IN VOID *Buffer,\r | |
51 | IN UINTN BufferSize,\r | |
52 | OUT EFI_PEI_FV_HANDLE *FvHandle\r | |
2f88bd3a | 53 | );\r |
5879b875 | 54 | \r |
5879b875 | 55 | /**\r |
d7132512 | 56 | Finds the next file of the specified type.\r |
5879b875 | 57 | \r |
9095d37b | 58 | This service enables PEI modules to discover additional firmware files.\r |
d7132512 | 59 | The FileHandle must be unique within the system.\r |
5879b875 | 60 | \r |
dafa11b1 | 61 | @param This Points to this instance of the\r |
62 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
63 | @param SearchType A filter to find only files of this type. Type\r | |
64 | EFI_FV_FILETYPE_ALL causes no filtering to be\r | |
65 | done.\r | |
66 | @param FvHandle Handle of firmware volume in which to\r | |
67 | search.\r | |
68 | @param FileHandle Points to the current handle from which to\r | |
69 | begin searching or NULL to start at the\r | |
70 | beginning of the firmware volume. Updated\r | |
71 | upon return to reflect the file found.\r | |
5879b875 | 72 | \r |
00edb218 | 73 | @retval EFI_SUCCESS The file was found.\r |
d7132512 | 74 | @retval EFI_NOT_FOUND The file was not found. FileHandle contains NULL.\r |
dafa11b1 | 75 | \r |
9095d37b | 76 | **/\r |
dafa11b1 | 77 | typedef\r |
78 | EFI_STATUS\r | |
9095d37b LG |
79 | (EFIAPI *EFI_PEI_FV_FIND_FILE_TYPE)(\r |
80 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r | |
81 | IN EFI_FV_FILETYPE SearchType,\r | |
dafa11b1 | 82 | IN EFI_PEI_FV_HANDLE FvHandle,\r |
9095d37b | 83 | IN OUT EFI_PEI_FILE_HANDLE *FileHandle\r |
2f88bd3a | 84 | );\r |
5879b875 | 85 | \r |
86 | /**\r | |
9095d37b LG |
87 | Find a file within a volume by its name.\r |
88 | \r | |
00edb218 A |
89 | This service searches for files with a specific name, within\r |
90 | either the specified firmware volume or all firmware volumes.\r | |
5879b875 | 91 | \r |
dafa11b1 | 92 | @param This Points to this instance of the\r |
93 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
94 | @param FileName A pointer to the name of the file to find\r | |
95 | within the firmware volume.\r | |
96 | @param FvHandle Upon entry, the pointer to the firmware\r | |
97 | volume to search or NULL if all firmware\r | |
98 | volumes should be searched. Upon exit, the\r | |
99 | actual firmware volume in which the file was\r | |
100 | found.\r | |
101 | @param FileHandle Upon exit, points to the found file's\r | |
102 | handle or NULL if it could not be found.\r | |
103 | \r | |
104 | @retval EFI_SUCCESS File was found.\r | |
105 | @retval EFI_NOT_FOUND File was not found.\r | |
106 | @retval EFI_INVALID_PARAMETER FvHandle or FileHandle or\r | |
5879b875 | 107 | FileName was NULL.\r |
108 | \r | |
109 | \r | |
110 | **/\r | |
111 | typedef\r | |
112 | EFI_STATUS\r | |
8b13229b | 113 | (EFIAPI *EFI_PEI_FV_FIND_FILE_NAME)(\r |
dafa11b1 | 114 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r |
115 | IN CONST EFI_GUID *FileName,\r | |
44218d2e | 116 | IN EFI_PEI_FV_HANDLE *FvHandle,\r |
dafa11b1 | 117 | OUT EFI_PEI_FILE_HANDLE *FileHandle\r |
2f88bd3a | 118 | );\r |
5879b875 | 119 | \r |
120 | /**\r | |
d7132512 LG |
121 | Returns information about a specific file.\r |
122 | \r | |
5879b875 | 123 | This function returns information about a specific\r |
00edb218 | 124 | file, including its file name, type, attributes, starting\r |
9095d37b LG |
125 | address and size.\r |
126 | \r | |
dafa11b1 | 127 | @param This Points to this instance of the\r |
128 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
129 | @param FileHandle Handle of the file.\r | |
130 | @param FileInfo Upon exit, points to the file's\r | |
131 | information.\r | |
5879b875 | 132 | \r |
00edb218 | 133 | @retval EFI_SUCCESS File information returned.\r |
00edb218 | 134 | @retval EFI_INVALID_PARAMETER If FileHandle does not\r |
5879b875 | 135 | represent a valid file.\r |
dafa11b1 | 136 | @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r |
9095d37b LG |
137 | \r |
138 | **/\r | |
5879b875 | 139 | typedef\r |
dafa11b1 | 140 | EFI_STATUS\r |
141 | (EFIAPI *EFI_PEI_FV_GET_FILE_INFO)(\r | |
9095d37b LG |
142 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r |
143 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
dafa11b1 | 144 | OUT EFI_FV_FILE_INFO *FileInfo\r |
2f88bd3a | 145 | );\r |
5879b875 | 146 | \r |
c7935105 SZ |
147 | /**\r |
148 | Returns information about a specific file.\r | |
149 | \r | |
150 | This function returns information about a specific\r | |
151 | file, including its file name, type, attributes, starting\r | |
9095d37b | 152 | address, size and authentication status.\r |
c7935105 SZ |
153 | \r |
154 | @param This Points to this instance of the\r | |
155 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
156 | @param FileHandle Handle of the file.\r | |
157 | @param FileInfo Upon exit, points to the file's\r | |
158 | information.\r | |
159 | \r | |
160 | @retval EFI_SUCCESS File information returned.\r | |
161 | @retval EFI_INVALID_PARAMETER If FileHandle does not\r | |
162 | represent a valid file.\r | |
163 | @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r | |
164 | \r | |
165 | **/\r | |
166 | typedef\r | |
167 | EFI_STATUS\r | |
168 | (EFIAPI *EFI_PEI_FV_GET_FILE_INFO2)(\r | |
9095d37b | 169 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r |
c7935105 SZ |
170 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
171 | OUT EFI_FV_FILE_INFO2 *FileInfo\r | |
2f88bd3a | 172 | );\r |
c7935105 | 173 | \r |
5879b875 | 174 | /**\r |
dafa11b1 | 175 | This function returns information about the firmware volume.\r |
9095d37b | 176 | \r |
dafa11b1 | 177 | @param This Points to this instance of the\r |
178 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
179 | @param FvHandle Handle to the firmware handle.\r | |
180 | @param VolumeInfo Points to the returned firmware volume\r | |
181 | information.\r | |
182 | \r | |
183 | @retval EFI_SUCCESS Information returned successfully.\r | |
184 | @retval EFI_INVALID_PARAMETER FvHandle does not indicate a valid\r | |
185 | firmware volume or VolumeInfo is NULL.\r | |
186 | \r | |
9095d37b | 187 | **/\r |
5879b875 | 188 | typedef\r |
dafa11b1 | 189 | EFI_STATUS\r |
190 | (EFIAPI *EFI_PEI_FV_GET_INFO)(\r | |
9095d37b LG |
191 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r |
192 | IN EFI_PEI_FV_HANDLE FvHandle,\r | |
dafa11b1 | 193 | OUT EFI_FV_INFO *VolumeInfo\r |
2f88bd3a | 194 | );\r |
5879b875 | 195 | \r |
196 | /**\r | |
d7132512 | 197 | Find the next matching section in the firmware file.\r |
9095d37b | 198 | \r |
dafa11b1 | 199 | This service enables PEI modules to discover sections\r |
200 | of a given type within a valid file.\r | |
9095d37b | 201 | \r |
dafa11b1 | 202 | @param This Points to this instance of the\r |
203 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
204 | @param SearchType A filter to find only sections of this\r | |
205 | type.\r | |
206 | @param FileHandle Handle of firmware file in which to\r | |
207 | search.\r | |
208 | @param SectionData Updated upon return to point to the\r | |
209 | section found.\r | |
9095d37b | 210 | \r |
00edb218 | 211 | @retval EFI_SUCCESS Section was found.\r |
00edb218 A |
212 | @retval EFI_NOT_FOUND Section of the specified type was not\r |
213 | found. SectionData contains NULL.\r | |
5879b875 | 214 | **/\r |
215 | typedef\r | |
216 | EFI_STATUS\r | |
8b13229b | 217 | (EFIAPI *EFI_PEI_FV_FIND_SECTION)(\r |
dafa11b1 | 218 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r |
219 | IN EFI_SECTION_TYPE SearchType,\r | |
220 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
221 | OUT VOID **SectionData\r | |
2f88bd3a | 222 | );\r |
5879b875 | 223 | \r |
c7935105 SZ |
224 | /**\r |
225 | Find the next matching section in the firmware file.\r | |
226 | \r | |
227 | This service enables PEI modules to discover sections\r | |
228 | of a given instance and type within a valid file.\r | |
229 | \r | |
230 | @param This Points to this instance of the\r | |
231 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
232 | @param SearchType A filter to find only sections of this\r | |
233 | type.\r | |
234 | @param SearchInstance A filter to find the specific instance\r | |
235 | of sections.\r | |
236 | @param FileHandle Handle of firmware file in which to\r | |
237 | search.\r | |
238 | @param SectionData Updated upon return to point to the\r | |
239 | section found.\r | |
240 | @param AuthenticationStatus Updated upon return to point to the\r | |
241 | authentication status for this section.\r | |
242 | \r | |
243 | @retval EFI_SUCCESS Section was found.\r | |
244 | @retval EFI_NOT_FOUND Section of the specified type was not\r | |
245 | found. SectionData contains NULL.\r | |
246 | **/\r | |
247 | typedef\r | |
248 | EFI_STATUS\r | |
249 | (EFIAPI *EFI_PEI_FV_FIND_SECTION2)(\r | |
250 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r | |
251 | IN EFI_SECTION_TYPE SearchType,\r | |
252 | IN UINTN SearchInstance,\r | |
253 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
254 | OUT VOID **SectionData,\r | |
255 | OUT UINT32 *AuthenticationStatus\r | |
2f88bd3a | 256 | );\r |
c7935105 | 257 | \r |
2f88bd3a MK |
258 | #define EFI_PEI_FIRMWARE_VOLUME_PPI_SIGNATURE SIGNATURE_32 ('P', 'F', 'V', 'P')\r |
259 | #define EFI_PEI_FIRMWARE_VOLUME_PPI_REVISION 0x00010030\r | |
c7935105 | 260 | \r |
dafa11b1 | 261 | ///\r |
262 | /// This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.\r | |
263 | ///\r | |
5879b875 | 264 | struct _EFI_PEI_FIRMWARE_VOLUME_PPI {\r |
2f88bd3a MK |
265 | EFI_PEI_FV_PROCESS_FV ProcessVolume;\r |
266 | EFI_PEI_FV_FIND_FILE_TYPE FindFileByType;\r | |
267 | EFI_PEI_FV_FIND_FILE_NAME FindFileByName;\r | |
268 | EFI_PEI_FV_GET_FILE_INFO GetFileInfo;\r | |
269 | EFI_PEI_FV_GET_INFO GetVolumeInfo;\r | |
270 | EFI_PEI_FV_FIND_SECTION FindSectionByType;\r | |
271 | EFI_PEI_FV_GET_FILE_INFO2 GetFileInfo2;\r | |
272 | EFI_PEI_FV_FIND_SECTION2 FindSectionByType2;\r | |
c7935105 SZ |
273 | ///\r |
274 | /// Signature is used to keep backward-compatibility, set to {'P','F','V','P'}.\r | |
275 | ///\r | |
2f88bd3a | 276 | UINT32 Signature;\r |
c7935105 SZ |
277 | ///\r |
278 | /// Revision for further extension.\r | |
279 | ///\r | |
2f88bd3a | 280 | UINT32 Revision;\r |
dafa11b1 | 281 | };\r |
5879b875 | 282 | \r |
2f88bd3a | 283 | extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid;\r |
5879b875 | 284 | \r |
9095d37b | 285 | #endif\r |