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