2 This file provides functions for accessing a memory-mapped firmware volume of a specific format.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
7 @par Revision Reference:
8 This PPI is from PI Version 1.0 errata.
12 #ifndef __FIRMWARE_VOLUME_PPI_H__
13 #define __FIRMWARE_VOLUME_PPI_H__
16 /// The GUID for this PPI is the same as the firmware volume format GUID.
17 /// The FV format can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for a user-defined
18 /// format. The EFI_FIRMWARE_FILE_SYSTEM2_GUID is the PI Firmware Volume format.
20 typedef struct _EFI_PEI_FIRMWARE_VOLUME_PPI EFI_PEI_FIRMWARE_VOLUME_PPI
;
23 Process a firmware volume and create a volume handle.
25 Create a volume handle from the information in the buffer. For
26 memory-mapped firmware volumes, Buffer and BufferSize refer to
27 the start of the firmware volume and the firmware volume size.
28 For non memory-mapped firmware volumes, this points to a
29 buffer which contains the necessary information for creating
30 the firmware volume handle. Normally, these values are derived
31 from the EFI_FIRMWARE_VOLUME_INFO_PPI.
34 @param This Points to this instance of the
35 EFI_PEI_FIRMWARE_VOLUME_PPI.
36 @param Buffer Points to the start of the buffer.
37 @param BufferSize Size of the buffer.
38 @param FvHandle Points to the returned firmware volume
39 handle. The firmware volume handle must
40 be unique within the system.
42 @retval EFI_SUCCESS Firmware volume handle created.
43 @retval EFI_VOLUME_CORRUPTED Volume was corrupt.
48 (EFIAPI
*EFI_PEI_FV_PROCESS_FV
)(
49 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
52 OUT EFI_PEI_FV_HANDLE
*FvHandle
56 Finds the next file of the specified type.
58 This service enables PEI modules to discover additional firmware files.
59 The FileHandle must be unique within the system.
61 @param This Points to this instance of the
62 EFI_PEI_FIRMWARE_VOLUME_PPI.
63 @param SearchType A filter to find only files of this type. Type
64 EFI_FV_FILETYPE_ALL causes no filtering to be
66 @param FvHandle Handle of firmware volume in which to
68 @param FileHandle Points to the current handle from which to
69 begin searching or NULL to start at the
70 beginning of the firmware volume. Updated
71 upon return to reflect the file found.
73 @retval EFI_SUCCESS The file was found.
74 @retval EFI_NOT_FOUND The file was not found. FileHandle contains NULL.
79 (EFIAPI
*EFI_PEI_FV_FIND_FILE_TYPE
)(
80 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
81 IN EFI_FV_FILETYPE SearchType
,
82 IN EFI_PEI_FV_HANDLE FvHandle
,
83 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
87 Find a file within a volume by its name.
89 This service searches for files with a specific name, within
90 either the specified firmware volume or all firmware volumes.
92 @param This Points to this instance of the
93 EFI_PEI_FIRMWARE_VOLUME_PPI.
94 @param FileName A pointer to the name of the file to find
95 within the firmware volume.
96 @param FvHandle Upon entry, the pointer to the firmware
97 volume to search or NULL if all firmware
98 volumes should be searched. Upon exit, the
99 actual firmware volume in which the file was
101 @param FileHandle Upon exit, points to the found file's
102 handle or NULL if it could not be found.
104 @retval EFI_SUCCESS File was found.
105 @retval EFI_NOT_FOUND File was not found.
106 @retval EFI_INVALID_PARAMETER FvHandle or FileHandle or
113 (EFIAPI
*EFI_PEI_FV_FIND_FILE_NAME
)(
114 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
115 IN CONST EFI_GUID
*FileName
,
116 IN EFI_PEI_FV_HANDLE
*FvHandle
,
117 OUT EFI_PEI_FILE_HANDLE
*FileHandle
121 Returns information about a specific file.
123 This function returns information about a specific
124 file, including its file name, type, attributes, starting
127 @param This Points to this instance of the
128 EFI_PEI_FIRMWARE_VOLUME_PPI.
129 @param FileHandle Handle of the file.
130 @param FileInfo Upon exit, points to the file's
133 @retval EFI_SUCCESS File information returned.
134 @retval EFI_INVALID_PARAMETER If FileHandle does not
135 represent a valid file.
136 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
141 (EFIAPI
*EFI_PEI_FV_GET_FILE_INFO
)(
142 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
143 IN EFI_PEI_FILE_HANDLE FileHandle
,
144 OUT EFI_FV_FILE_INFO
*FileInfo
148 Returns information about a specific file.
150 This function returns information about a specific
151 file, including its file name, type, attributes, starting
152 address, size and authentication status.
154 @param This Points to this instance of the
155 EFI_PEI_FIRMWARE_VOLUME_PPI.
156 @param FileHandle Handle of the file.
157 @param FileInfo Upon exit, points to the file's
160 @retval EFI_SUCCESS File information returned.
161 @retval EFI_INVALID_PARAMETER If FileHandle does not
162 represent a valid file.
163 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
168 (EFIAPI
*EFI_PEI_FV_GET_FILE_INFO2
)(
169 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
170 IN EFI_PEI_FILE_HANDLE FileHandle
,
171 OUT EFI_FV_FILE_INFO2
*FileInfo
175 This function returns information about the firmware volume.
177 @param This Points to this instance of the
178 EFI_PEI_FIRMWARE_VOLUME_PPI.
179 @param FvHandle Handle to the firmware handle.
180 @param VolumeInfo Points to the returned firmware volume
183 @retval EFI_SUCCESS Information returned successfully.
184 @retval EFI_INVALID_PARAMETER FvHandle does not indicate a valid
185 firmware volume or VolumeInfo is NULL.
190 (EFIAPI
*EFI_PEI_FV_GET_INFO
)(
191 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
192 IN EFI_PEI_FV_HANDLE FvHandle
,
193 OUT EFI_FV_INFO
*VolumeInfo
197 Find the next matching section in the firmware file.
199 This service enables PEI modules to discover sections
200 of a given type within a valid file.
202 @param This Points to this instance of the
203 EFI_PEI_FIRMWARE_VOLUME_PPI.
204 @param SearchType A filter to find only sections of this
206 @param FileHandle Handle of firmware file in which to
208 @param SectionData Updated upon return to point to the
211 @retval EFI_SUCCESS Section was found.
212 @retval EFI_NOT_FOUND Section of the specified type was not
213 found. SectionData contains NULL.
217 (EFIAPI
*EFI_PEI_FV_FIND_SECTION
)(
218 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
219 IN EFI_SECTION_TYPE SearchType
,
220 IN EFI_PEI_FILE_HANDLE FileHandle
,
221 OUT VOID
**SectionData
225 Find the next matching section in the firmware file.
227 This service enables PEI modules to discover sections
228 of a given instance and type within a valid file.
230 @param This Points to this instance of the
231 EFI_PEI_FIRMWARE_VOLUME_PPI.
232 @param SearchType A filter to find only sections of this
234 @param SearchInstance A filter to find the specific instance
236 @param FileHandle Handle of firmware file in which to
238 @param SectionData Updated upon return to point to the
240 @param AuthenticationStatus Updated upon return to point to the
241 authentication status for this section.
243 @retval EFI_SUCCESS Section was found.
244 @retval EFI_NOT_FOUND Section of the specified type was not
245 found. SectionData contains NULL.
249 (EFIAPI
*EFI_PEI_FV_FIND_SECTION2
)(
250 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
251 IN EFI_SECTION_TYPE SearchType
,
252 IN UINTN SearchInstance
,
253 IN EFI_PEI_FILE_HANDLE FileHandle
,
254 OUT VOID
**SectionData
,
255 OUT UINT32
*AuthenticationStatus
258 #define EFI_PEI_FIRMWARE_VOLUME_PPI_SIGNATURE SIGNATURE_32 ('P', 'F', 'V', 'P')
259 #define EFI_PEI_FIRMWARE_VOLUME_PPI_REVISION 0x00010030
262 /// This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.
264 struct _EFI_PEI_FIRMWARE_VOLUME_PPI
{
265 EFI_PEI_FV_PROCESS_FV ProcessVolume
;
266 EFI_PEI_FV_FIND_FILE_TYPE FindFileByType
;
267 EFI_PEI_FV_FIND_FILE_NAME FindFileByName
;
268 EFI_PEI_FV_GET_FILE_INFO GetFileInfo
;
269 EFI_PEI_FV_GET_INFO GetVolumeInfo
;
270 EFI_PEI_FV_FIND_SECTION FindSectionByType
;
271 EFI_PEI_FV_GET_FILE_INFO2 GetFileInfo2
;
272 EFI_PEI_FV_FIND_SECTION2 FindSectionByType2
;
274 /// Signature is used to keep backward-compatibility, set to {'P','F','V','P'}.
278 /// Revision for further extension.
283 extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid
;