]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/FirmwareVolume.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Ppi / FirmwareVolume.h
CommitLineData
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
00edb218 20typedef struct _EFI_PEI_FIRMWARE_VOLUME_PPI EFI_PEI_FIRMWARE_VOLUME_PPI;\r
5879b875 21\r
22\r
23/**\r
d7132512
LG
24 Process a firmware volume and create a volume handle.\r
25\r
5879b875 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
9095d37b
LG
33\r
34\r
dafa11b1 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
9095d37b 41 be unique within the system.\r
5879b875 42\r
dafa11b1 43 @retval EFI_SUCCESS Firmware volume handle created.\r
00edb218 44 @retval EFI_VOLUME_CORRUPTED Volume was corrupt.\r
5879b875 45\r
46**/\r
47typedef\r
48EFI_STATUS\r
8b13229b 49(EFIAPI *EFI_PEI_FV_PROCESS_FV)(\r
dafa11b1 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
5879b875 54);\r
55\r
5879b875 56/**\r
d7132512 57 Finds the next file of the specified type.\r
5879b875 58\r
9095d37b 59 This service enables PEI modules to discover additional firmware files.\r
d7132512 60 The FileHandle must be unique within the system.\r
5879b875 61\r
dafa11b1 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
5879b875 73\r
00edb218 74 @retval EFI_SUCCESS The file was found.\r
d7132512 75 @retval EFI_NOT_FOUND The file was not found. FileHandle contains NULL.\r
dafa11b1 76\r
9095d37b 77**/\r
dafa11b1 78typedef\r
79EFI_STATUS\r
9095d37b
LG
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
dafa11b1 83 IN EFI_PEI_FV_HANDLE FvHandle,\r
9095d37b 84 IN OUT EFI_PEI_FILE_HANDLE *FileHandle\r
5879b875 85);\r
86\r
87\r
88/**\r
9095d37b
LG
89 Find a file within a volume by its name.\r
90\r
00edb218
A
91 This service searches for files with a specific name, within\r
92 either the specified firmware volume or all firmware volumes.\r
5879b875 93\r
dafa11b1 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
5879b875 109 FileName was NULL.\r
110\r
111\r
112**/\r
113typedef\r
114EFI_STATUS\r
8b13229b 115(EFIAPI *EFI_PEI_FV_FIND_FILE_NAME)(\r
dafa11b1 116 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
117 IN CONST EFI_GUID *FileName,\r
44218d2e 118 IN EFI_PEI_FV_HANDLE *FvHandle,\r
dafa11b1 119 OUT EFI_PEI_FILE_HANDLE *FileHandle\r
5879b875 120);\r
121\r
122\r
123/**\r
d7132512
LG
124 Returns information about a specific file.\r
125\r
5879b875 126 This function returns information about a specific\r
00edb218 127 file, including its file name, type, attributes, starting\r
9095d37b
LG
128 address and size.\r
129\r
dafa11b1 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
5879b875 135\r
00edb218 136 @retval EFI_SUCCESS File information returned.\r
00edb218 137 @retval EFI_INVALID_PARAMETER If FileHandle does not\r
5879b875 138 represent a valid file.\r
dafa11b1 139 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
9095d37b
LG
140\r
141**/\r
5879b875 142typedef\r
dafa11b1 143EFI_STATUS\r
144(EFIAPI *EFI_PEI_FV_GET_FILE_INFO)(\r
9095d37b
LG
145 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
146 IN EFI_PEI_FILE_HANDLE FileHandle,\r
dafa11b1 147 OUT EFI_FV_FILE_INFO *FileInfo\r
5879b875 148);\r
149\r
c7935105
SZ
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
9095d37b 155 address, size and authentication status.\r
c7935105
SZ
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
9095d37b 172 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
c7935105
SZ
173 IN EFI_PEI_FILE_HANDLE FileHandle,\r
174 OUT EFI_FV_FILE_INFO2 *FileInfo\r
175);\r
176\r
5879b875 177/**\r
dafa11b1 178 This function returns information about the firmware volume.\r
9095d37b 179\r
dafa11b1 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
9095d37b 190**/\r
5879b875 191typedef\r
dafa11b1 192EFI_STATUS\r
193(EFIAPI *EFI_PEI_FV_GET_INFO)(\r
9095d37b
LG
194 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
195 IN EFI_PEI_FV_HANDLE FvHandle,\r
dafa11b1 196 OUT EFI_FV_INFO *VolumeInfo\r
5879b875 197);\r
198\r
199/**\r
d7132512 200 Find the next matching section in the firmware file.\r
9095d37b 201\r
dafa11b1 202 This service enables PEI modules to discover sections\r
203 of a given type within a valid file.\r
9095d37b 204\r
dafa11b1 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
9095d37b 213\r
00edb218 214 @retval EFI_SUCCESS Section was found.\r
00edb218
A
215 @retval EFI_NOT_FOUND Section of the specified type was not\r
216 found. SectionData contains NULL.\r
5879b875 217**/\r
218typedef\r
219EFI_STATUS\r
8b13229b 220(EFIAPI *EFI_PEI_FV_FIND_SECTION)(\r
dafa11b1 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
5879b875 225);\r
226\r
c7935105
SZ
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
dafa11b1 264///\r
265/// This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.\r
266///\r
5879b875 267struct _EFI_PEI_FIRMWARE_VOLUME_PPI {\r
00edb218
A
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
c7935105
SZ
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
dafa11b1 284};\r
5879b875 285\r
00edb218 286extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid;\r
5879b875 287\r
9095d37b 288#endif\r