2 This file provides functions for accessing a memory-mapped firmware volume of a specific format.
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 @par Revision Reference:
14 This PPI is defined in PI.
19 #ifndef __FIRMWARE_VOLUME_PPI_H__
20 #define __FIRMWARE_VOLUME_PPI_H__
23 // The GUID for this PPI is the same as the firmware volume format GUID.
24 // can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for a user-defined format. The
25 // EFI_FIRMWARE_FILE_SYSTEM2_GUID is the PI Firmware Volume format.
28 typedef struct _EFI_PEI_FIRMWARE_VOLUME_PPI EFI_PEI_FIRMWARE_VOLUME_PPI
;
32 Create a volume handle from the information in the buffer. For
33 memory-mapped firmware volumes, Buffer and BufferSize refer to
34 the start of the firmware volume and the firmware volume size.
35 For non memory-mapped firmware volumes, this points to a
36 buffer which contains the necessary information for creating
37 the firmware volume handle. Normally, these values are derived
38 from the EFI_FIRMWARE_VOLUME_INFO_PPI.
41 @param This Points to this instance of the
42 EFI_PEI_FIRMWARE_VOLUME_PPI
43 @param Buffer Points to the start of the buffer.
44 @param BufferSize Size of the buffer.
45 @param FvHandle Points to the returned firmware volume
46 handle. The firmware volume handle must
47 be unique within the system.
50 @retval EFI_SUCCESS Firmware volume handle.
51 @retval EFI_VOLUME_CORRUPTED Volume was corrupt.
56 (EFIAPI
*EFI_PEI_FV_PROCESS_FV
) (
57 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
58 IN CONST VOID
*Buffer
,
59 IN CONST UINTN BufferSize
,
60 OUT EFI_PEI_FV_HANDLE
*FvHandle
65 Create a volume handle from the information in the buffer. For
66 memory-mapped firmware volumes, Buffer and BufferSize refer to
67 the start of the firmware volume and the firmware volume size.
68 For non memory-mapped firmware volumes, this points to a
69 buffer which contains the necessary information for creating
70 the firmware volume handle. Normally, these values are derived
71 from the EFI_FIRMWARE_VOLUME_INFO_PPI.
74 @param This Points to this instance of the
75 EFI_PEI_FIRMWARE_VOLUME_PPI
76 @param Buffer Points to the start of the buffer.
77 @param BufferSize Size of the buffer.
78 @param FvHandle Points to the returned firmware volume
79 handle. The firmware volume handle must
80 be unique within the system.
83 @retval EFI_SUCCESS Firmware volume handle.
84 @retval EFI_VOLUME_CORRUPTED Volume was corrupt.
89 This service enables PEI modules to discover additional firmware files. The FileHandle must be
90 unique within the system.
92 @param This Points to this instance of the
93 EFI_PEI_FIRMWARE_VOLUME_PPI. SearchType A filter
94 to find only files of this type. Type
95 EFI_FV_FILETYPE_ALL causes no filtering to be
97 @param FvHandle Handle of firmware volume in which to
100 @param FileHandle Points to the current handle from which to
101 begin searching or NULL to start at the
102 beginning of the firmware volume. Updated
103 upon return to reflect the file found.
106 @retval EFI_SUCCESS The file was found.
107 @retval EFI_NOT_FOUND The file was not found. FileHandle
111 (EFIAPI
*EFI_PEI_FV_FIND_FILE_TYPE
) (
112 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
113 IN CONST EFI_FV_FILETYPE SearchType
,
114 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
115 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
121 This service searches for files with a specific name, within
122 either the specified firmware volume or all firmware volumes.
124 @param This Points to this instance of the
125 EFI_PEI_FIRMWARE_VOLUME_PPI.
127 @param FileName A pointer to the name of the file to find
128 within the firmware volume.
130 @param FvHandle Upon entry, the pointer to the firmware
131 volume to search or NULL if all firmware
132 volumes should be searched. Upon exit, the
133 actual firmware volume in which the file was
136 @param FileHandle Upon exit, points to the found file's
137 handle or NULL if it could not be found.
139 @retval EFI_SUCCESS File was found.
141 @param EFI_NOT_FOUND File was not found.
143 @param EFI_INVALID_PARAMETER FvHandle or FileHandle or
150 (EFIAPI
*EFI_PEI_FV_FIND_FILE_NAME
) (
151 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
152 IN CONST EFI_GUID
*FileName
,
153 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
154 OUT EFI_PEI_FILE_HANDLE
*FileHandle
159 This function returns information about a specific
160 file, including its file name, type, attributes, starting
163 @param This Points to this instance of the
164 EFI_PEI_FIRMWARE_VOLUME_PPI.
166 @param FileHandle Handle of the file.
168 @param FileInfo Upon exit, points to the file????s
171 @retval EFI_SUCCESS File information returned.
173 @retval EFI_INVALID_PARAMETER If FileHandle does not
174 represent a valid file.
175 EFI_INVALID_PARAMETER If
181 EFI_STATUS (EFIAPI
*EFI_PEI_FV_GET_FILE_INFO
) (
182 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
183 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
184 OUT EFI_FV_FILE_INFO
*FileInfo
188 This function returns information about the firmware
191 @param This Points to this instance of the
192 EFI_PEI_FIRMWARE_VOLUME_PPI.
194 @param FvHandle Handle to the firmware handle.
196 @param VolumeInfo Points to the returned firmware volume
200 @retval EFI_SUCCESS Information returned
203 @retval EFI_INVALID_PARAMETER FvHandle does not indicate a
204 valid firmware volume or VolumeInfo is NULL
207 EFI_STATUS (EFIAPI
*EFI_PEI_FV_GET_INFO
)(
208 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
209 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
210 OUT EFI_FV_INFO
*VolumeInfo
214 This service enables PEI modules to discover sections of a given type within a valid file.
216 @param This Points to this instance of the
217 EFI_PEI_FIRMWARE_VOLUME_PPI.
219 @param SearchType A filter to find only sections of this
222 @param FileHandle Handle of firmware file in which to
225 @param SectionData Updated upon return to point to the
228 @retval EFI_SUCCESS Section was found.
230 @retval EFI_NOT_FOUND Section of the specified type was not
231 found. SectionData contains NULL.
235 (EFIAPI
*EFI_PEI_FV_FIND_SECTION
) (
236 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI
*This
,
237 IN CONST EFI_SECTION_TYPE SearchType
,
238 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
239 OUT VOID
**SectionData
245 This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.
247 @param ProcessVolume Process a firmware volume and create a volume handle.
248 @param FindFileByType Find all files of a specific type.
249 @param FindFileByName Find the file with a specific name.
250 @param GetFileInfo Return the information about a specific file
251 @param GetVolumeInfo Return the firmware volume attributes.
252 @param FindSectionByType Find all sections of a specific type.
255 struct _EFI_PEI_FIRMWARE_VOLUME_PPI
{
256 EFI_PEI_FV_PROCESS_FV ProcessVolume
;
257 EFI_PEI_FV_FIND_FILE_TYPE FindFileByType
;
258 EFI_PEI_FV_FIND_FILE_NAME FindFileByName
;
259 EFI_PEI_FV_GET_FILE_INFO GetFileInfo
;
260 EFI_PEI_FV_GET_INFO GetVolumeInfo
;
261 EFI_PEI_FV_FIND_SECTION FindSectionByType
;
264 extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid
;