]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/FirmwareVolume.h
Updated headers to follow coding standard
[mirror_edk2.git] / MdePkg / Include / Ppi / FirmwareVolume.h
CommitLineData
5879b875 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 - 2007, Intel Corporation \r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
5879b875 13 @par Revision Reference:\r
14 This PPI is defined in PI.\r
15 Version 1.00\r
16\r
17**/\r
18\r
19#ifndef __FIRMWARE_VOLUME_PPI_H__\r
20#define __FIRMWARE_VOLUME_PPI_H__\r
21\r
22//\r
23// The GUID for this PPI is the same as the firmware volume format GUID.\r
24// can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for a user-defined format. The\r
25// EFI_FIRMWARE_FILE_SYSTEM2_GUID is the PI Firmware Volume format.\r
26// \r
27\r
00edb218 28typedef struct _EFI_PEI_FIRMWARE_VOLUME_PPI EFI_PEI_FIRMWARE_VOLUME_PPI;\r
5879b875 29\r
30\r
31/**\r
32 Create a volume handle from the information in the buffer. For\r
33 memory-mapped firmware volumes, Buffer and BufferSize refer to\r
34 the start of the firmware volume and the firmware volume size.\r
35 For non memory-mapped firmware volumes, this points to a\r
36 buffer which contains the necessary information for creating\r
37 the firmware volume handle. Normally, these values are derived\r
38 from the EFI_FIRMWARE_VOLUME_INFO_PPI.\r
39 \r
40 \r
00edb218 41 @param This Points to this instance of the\r
5879b875 42 EFI_PEI_FIRMWARE_VOLUME_PPI\r
00edb218
A
43 @param Buffer Points to the start of the buffer.\r
44 @param BufferSize Size of the buffer.\r
45 @param FvHandle Points to the returned firmware volume\r
5879b875 46 handle. The firmware volume handle must\r
47 be unique within the system. \r
48\r
49\r
00edb218
A
50 @retval EFI_SUCCESS Firmware volume handle.\r
51 @retval EFI_VOLUME_CORRUPTED Volume was corrupt.\r
5879b875 52\r
53**/\r
54typedef\r
55EFI_STATUS\r
56(EFIAPI *EFI_PEI_FV_PROCESS_FV) (\r
00edb218
A
57 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
58 IN CONST VOID *Buffer,\r
59 IN CONST UINTN BufferSize,\r
60 OUT EFI_PEI_FV_HANDLE *FvHandle\r
5879b875 61);\r
62\r
63\r
64/**\r
65 Create a volume handle from the information in the buffer. For\r
66 memory-mapped firmware volumes, Buffer and BufferSize refer to\r
67 the start of the firmware volume and the firmware volume size.\r
68 For non memory-mapped firmware volumes, this points to a\r
69 buffer which contains the necessary information for creating\r
70 the firmware volume handle. Normally, these values are derived\r
71 from the EFI_FIRMWARE_VOLUME_INFO_PPI.\r
72 \r
73 \r
00edb218 74 @param This Points to this instance of the\r
5879b875 75 EFI_PEI_FIRMWARE_VOLUME_PPI\r
00edb218
A
76 @param Buffer Points to the start of the buffer.\r
77 @param BufferSize Size of the buffer.\r
78 @param FvHandle Points to the returned firmware volume\r
5879b875 79 handle. The firmware volume handle must\r
80 be unique within the system. \r
81\r
82\r
00edb218
A
83 @retval EFI_SUCCESS Firmware volume handle.\r
84 @retval EFI_VOLUME_CORRUPTED Volume was corrupt.\r
5879b875 85\r
86**/\r
87\r
88/**\r
89 This service enables PEI modules to discover additional firmware files. The FileHandle must be\r
00edb218 90 unique within the system.\r
5879b875 91\r
00edb218
A
92 @param This Points to this instance of the\r
93 EFI_PEI_FIRMWARE_VOLUME_PPI. SearchType A filter\r
94 to find only files of this type. Type\r
95 EFI_FV_FILETYPE_ALL causes no filtering to be\r
96 done.\r
97 @param FvHandle Handle of firmware volume in which to\r
98 search.\r
5879b875 99\r
00edb218 100 @param FileHandle Points to the current handle from which to\r
5879b875 101 begin searching or NULL to start at the\r
102 beginning of the firmware volume. Updated\r
103 upon return to reflect the file found.\r
104\r
105\r
00edb218 106 @retval EFI_SUCCESS The file was found.\r
5879b875 107 @retval EFI_NOT_FOUND The file was not found. FileHandle\r
00edb218 108 contains NULL.\r
5879b875 109**/ \r
110typedef EFI_STATUS\r
111(EFIAPI *EFI_PEI_FV_FIND_FILE_TYPE) ( \r
00edb218
A
112 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r
113 IN CONST EFI_FV_FILETYPE SearchType, \r
114 IN CONST EFI_PEI_FV_HANDLE FvHandle,\r
115 IN OUT EFI_PEI_FILE_HANDLE *FileHandle \r
5879b875 116);\r
117\r
118\r
119/**\r
120 \r
00edb218
A
121 This service searches for files with a specific name, within\r
122 either the specified firmware volume or all firmware volumes.\r
5879b875 123\r
124 @param This Points to this instance of the\r
125 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
126\r
00edb218 127 @param FileName A pointer to the name of the file to find\r
5879b875 128 within the firmware volume.\r
129\r
00edb218 130 @param FvHandle Upon entry, the pointer to the firmware\r
5879b875 131 volume to search or NULL if all firmware\r
132 volumes should be searched. Upon exit, the\r
133 actual firmware volume in which the file was\r
134 found.\r
135\r
00edb218 136 @param FileHandle Upon exit, points to the found file's\r
5879b875 137 handle or NULL if it could not be found.\r
138\r
00edb218 139 @retval EFI_SUCCESS File was found.\r
5879b875 140\r
00edb218 141 @param EFI_NOT_FOUND File was not found.\r
5879b875 142\r
00edb218 143 @param EFI_INVALID_PARAMETER FvHandle or FileHandle or\r
5879b875 144 FileName was NULL.\r
145\r
146\r
147**/\r
148typedef\r
149EFI_STATUS\r
150(EFIAPI *EFI_PEI_FV_FIND_FILE_NAME) (\r
00edb218
A
151 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
152 IN CONST EFI_GUID *FileName,\r
153 IN CONST EFI_PEI_FV_HANDLE FvHandle,\r
154 OUT EFI_PEI_FILE_HANDLE *FileHandle\r
5879b875 155);\r
156\r
157\r
158/**\r
159 This function returns information about a specific\r
00edb218 160 file, including its file name, type, attributes, starting\r
5879b875 161 address and size. \r
162 \r
00edb218
A
163 @param This Points to this instance of the\r
164 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
5879b875 165\r
166 @param FileHandle Handle of the file.\r
167\r
00edb218
A
168 @param FileInfo Upon exit, points to the file????s\r
169 information.\r
5879b875 170\r
00edb218 171 @retval EFI_SUCCESS File information returned.\r
5879b875 172 \r
00edb218 173 @retval EFI_INVALID_PARAMETER If FileHandle does not\r
5879b875 174 represent a valid file.\r
175 EFI_INVALID_PARAMETER If\r
176 FileInfo is NULL\r
177 \r
178**/ \r
179\r
180typedef\r
181EFI_STATUS (EFIAPI *EFI_PEI_FV_GET_FILE_INFO) (\r
00edb218
A
182 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r
183 IN CONST EFI_PEI_FILE_HANDLE FileHandle, \r
184 OUT EFI_FV_FILE_INFO *FileInfo\r
5879b875 185);\r
186\r
187/**\r
00edb218 188 This function returns information about the firmware\r
5879b875 189 volume.\r
190 \r
00edb218
A
191 @param This Points to this instance of the\r
192 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
5879b875 193 \r
00edb218 194 @param FvHandle Handle to the firmware handle.\r
5879b875 195 \r
196 @param VolumeInfo Points to the returned firmware volume\r
197 information.\r
198 \r
199 \r
00edb218 200 @retval EFI_SUCCESS Information returned\r
5879b875 201 successfully.\r
202 \r
00edb218
A
203 @retval EFI_INVALID_PARAMETER FvHandle does not indicate a\r
204 valid firmware volume or VolumeInfo is NULL\r
5879b875 205**/ \r
206typedef\r
207EFI_STATUS (EFIAPI *EFI_PEI_FV_GET_INFO)(\r
00edb218
A
208 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r
209 IN CONST EFI_PEI_FV_HANDLE FvHandle, \r
210 OUT EFI_FV_INFO *VolumeInfo\r
5879b875 211);\r
212\r
213/**\r
214 This service enables PEI modules to discover sections of a given type within a valid file.\r
215 \r
00edb218 216 @param This Points to this instance of the\r
5879b875 217 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
218 \r
00edb218 219 @param SearchType A filter to find only sections of this\r
5879b875 220 type.\r
221 \r
00edb218 222 @param FileHandle Handle of firmware file in which to\r
5879b875 223 search.\r
224 \r
225 @param SectionData Updated upon return to point to the\r
226 section found.\r
227 \r
00edb218 228 @retval EFI_SUCCESS Section was found.\r
5879b875 229 \r
00edb218
A
230 @retval EFI_NOT_FOUND Section of the specified type was not\r
231 found. SectionData contains NULL.\r
5879b875 232**/\r
233typedef\r
234EFI_STATUS\r
235(EFIAPI *EFI_PEI_FV_FIND_SECTION) (\r
00edb218
A
236 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
237 IN CONST EFI_SECTION_TYPE SearchType,\r
238 IN CONST EFI_PEI_FILE_HANDLE FileHandle,\r
239 OUT VOID **SectionData\r
5879b875 240);\r
241\r
242\r
243\r
244/*\r
00edb218 245 This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.\r
5879b875 246\r
00edb218
A
247 @param ProcessVolume Process a firmware volume and create a volume handle.\r
248 @param FindFileByType Find all files of a specific type.\r
249 @param FindFileByName Find the file with a specific name.\r
250 @param GetFileInfo Return the information about a specific file\r
251 @param GetVolumeInfo Return the firmware volume attributes.\r
252 @param FindSectionByType Find all sections of a specific type.\r
5879b875 253\r
254**/\r
255struct _EFI_PEI_FIRMWARE_VOLUME_PPI {\r
00edb218
A
256 EFI_PEI_FV_PROCESS_FV ProcessVolume;\r
257 EFI_PEI_FV_FIND_FILE_TYPE FindFileByType;\r
258 EFI_PEI_FV_FIND_FILE_NAME FindFileByName;\r
259 EFI_PEI_FV_GET_FILE_INFO GetFileInfo;\r
260 EFI_PEI_FV_GET_INFO GetVolumeInfo;\r
261 EFI_PEI_FV_FIND_SECTION FindSectionByType;\r
5879b875 262} ;\r
263\r
00edb218 264extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid;\r
5879b875 265\r
266#endif \r