]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/FirmwareVolume.h
Code Scrub for header files in MdePkg/Include/Ppi and Uefi directory.
[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
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
d7132512
LG
32 Process a firmware volume and create a volume handle.\r
33\r
5879b875 34 Create a volume handle from the information in the buffer. For\r
35 memory-mapped firmware volumes, Buffer and BufferSize refer to\r
36 the start of the firmware volume and the firmware volume size.\r
37 For non memory-mapped firmware volumes, this points to a\r
38 buffer which contains the necessary information for creating\r
39 the firmware volume handle. Normally, these values are derived\r
40 from the EFI_FIRMWARE_VOLUME_INFO_PPI.\r
41 \r
42 \r
00edb218 43 @param This Points to this instance of the\r
5879b875 44 EFI_PEI_FIRMWARE_VOLUME_PPI\r
00edb218
A
45 @param Buffer Points to the start of the buffer.\r
46 @param BufferSize Size of the buffer.\r
47 @param FvHandle Points to the returned firmware volume\r
5879b875 48 handle. The firmware volume handle must\r
49 be unique within the system. \r
50\r
51\r
00edb218
A
52 @retval EFI_SUCCESS Firmware volume handle.\r
53 @retval EFI_VOLUME_CORRUPTED Volume was corrupt.\r
5879b875 54\r
55**/\r
56typedef\r
57EFI_STATUS\r
8b13229b 58(EFIAPI *EFI_PEI_FV_PROCESS_FV)(\r
00edb218
A
59 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
60 IN CONST VOID *Buffer,\r
61 IN CONST UINTN BufferSize,\r
62 OUT EFI_PEI_FV_HANDLE *FvHandle\r
5879b875 63);\r
64\r
5879b875 65/**\r
d7132512 66 Finds the next file of the specified type.\r
5879b875 67\r
d7132512
LG
68 This service enables PEI modules to discover additional firmware files. \r
69 The FileHandle must be unique within the system.\r
5879b875 70\r
00edb218
A
71 @param This Points to this instance of the\r
72 EFI_PEI_FIRMWARE_VOLUME_PPI. SearchType A filter\r
73 to find only files of this type. Type\r
74 EFI_FV_FILETYPE_ALL causes no filtering to be\r
75 done.\r
76 @param FvHandle Handle of firmware volume in which to\r
77 search.\r
5879b875 78\r
00edb218 79 @param FileHandle Points to the current handle from which to\r
5879b875 80 begin searching or NULL to start at the\r
81 beginning of the firmware volume. Updated\r
82 upon return to reflect the file found.\r
83\r
84\r
00edb218 85 @retval EFI_SUCCESS The file was found.\r
d7132512 86 @retval EFI_NOT_FOUND The file was not found. FileHandle contains NULL.\r
5879b875 87**/ \r
88typedef EFI_STATUS\r
8b13229b 89(EFIAPI *EFI_PEI_FV_FIND_FILE_TYPE)( \r
00edb218
A
90 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r
91 IN CONST EFI_FV_FILETYPE SearchType, \r
92 IN CONST EFI_PEI_FV_HANDLE FvHandle,\r
93 IN OUT EFI_PEI_FILE_HANDLE *FileHandle \r
5879b875 94);\r
95\r
96\r
97/**\r
d7132512
LG
98 Find a file within a volume by its name. \r
99 \r
00edb218
A
100 This service searches for files with a specific name, within\r
101 either the specified firmware volume or all firmware volumes.\r
5879b875 102\r
103 @param This Points to this instance of the\r
104 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
105\r
00edb218 106 @param FileName A pointer to the name of the file to find\r
5879b875 107 within the firmware volume.\r
108\r
00edb218 109 @param FvHandle Upon entry, the pointer to the firmware\r
5879b875 110 volume to search or NULL if all firmware\r
111 volumes should be searched. Upon exit, the\r
112 actual firmware volume in which the file was\r
113 found.\r
114\r
00edb218 115 @param FileHandle Upon exit, points to the found file's\r
5879b875 116 handle or NULL if it could not be found.\r
117\r
00edb218 118 @retval EFI_SUCCESS File was found.\r
5879b875 119\r
00edb218 120 @param EFI_NOT_FOUND File was not found.\r
5879b875 121\r
00edb218 122 @param EFI_INVALID_PARAMETER FvHandle or FileHandle or\r
5879b875 123 FileName was NULL.\r
124\r
125\r
126**/\r
127typedef\r
128EFI_STATUS\r
8b13229b 129(EFIAPI *EFI_PEI_FV_FIND_FILE_NAME)(\r
00edb218
A
130 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
131 IN CONST EFI_GUID *FileName,\r
132 IN CONST EFI_PEI_FV_HANDLE FvHandle,\r
133 OUT EFI_PEI_FILE_HANDLE *FileHandle\r
5879b875 134);\r
135\r
136\r
137/**\r
d7132512
LG
138 Returns information about a specific file.\r
139\r
5879b875 140 This function returns information about a specific\r
00edb218 141 file, including its file name, type, attributes, starting\r
5879b875 142 address and size. \r
143 \r
00edb218
A
144 @param This Points to this instance of the\r
145 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
5879b875 146\r
147 @param FileHandle Handle of the file.\r
148\r
00edb218
A
149 @param FileInfo Upon exit, points to the file????s\r
150 information.\r
5879b875 151\r
00edb218 152 @retval EFI_SUCCESS File information returned.\r
5879b875 153 \r
00edb218 154 @retval EFI_INVALID_PARAMETER If FileHandle does not\r
5879b875 155 represent a valid file.\r
156 EFI_INVALID_PARAMETER If\r
157 FileInfo is NULL\r
158 \r
159**/ \r
160\r
161typedef\r
8b13229b 162EFI_STATUS (EFIAPI *EFI_PEI_FV_GET_FILE_INFO)(\r
00edb218
A
163 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r
164 IN CONST EFI_PEI_FILE_HANDLE FileHandle, \r
165 OUT EFI_FV_FILE_INFO *FileInfo\r
5879b875 166);\r
167\r
168/**\r
00edb218 169 This function returns information about the firmware\r
5879b875 170 volume.\r
171 \r
00edb218
A
172 @param This Points to this instance of the\r
173 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
5879b875 174 \r
00edb218 175 @param FvHandle Handle to the firmware handle.\r
5879b875 176 \r
177 @param VolumeInfo Points to the returned firmware volume\r
178 information.\r
179 \r
180 \r
00edb218 181 @retval EFI_SUCCESS Information returned\r
5879b875 182 successfully.\r
183 \r
00edb218
A
184 @retval EFI_INVALID_PARAMETER FvHandle does not indicate a\r
185 valid firmware volume or VolumeInfo is NULL\r
5879b875 186**/ \r
187typedef\r
188EFI_STATUS (EFIAPI *EFI_PEI_FV_GET_INFO)(\r
00edb218
A
189 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r
190 IN CONST EFI_PEI_FV_HANDLE FvHandle, \r
191 OUT EFI_FV_INFO *VolumeInfo\r
5879b875 192);\r
193\r
194/**\r
d7132512
LG
195 Find the next matching section in the firmware file.\r
196 \r
5879b875 197 This service enables PEI modules to discover sections of a given type within a valid file.\r
198 \r
00edb218 199 @param This Points to this instance of the\r
5879b875 200 EFI_PEI_FIRMWARE_VOLUME_PPI.\r
201 \r
00edb218 202 @param SearchType A filter to find only sections of this\r
5879b875 203 type.\r
204 \r
00edb218 205 @param FileHandle Handle of firmware file in which to\r
5879b875 206 search.\r
207 \r
208 @param SectionData Updated upon return to point to the\r
209 section found.\r
210 \r
00edb218 211 @retval EFI_SUCCESS Section was found.\r
5879b875 212 \r
00edb218
A
213 @retval EFI_NOT_FOUND Section of the specified type was not\r
214 found. SectionData contains NULL.\r
5879b875 215**/\r
216typedef\r
217EFI_STATUS\r
8b13229b 218(EFIAPI *EFI_PEI_FV_FIND_SECTION)(\r
00edb218
A
219 IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r
220 IN CONST EFI_SECTION_TYPE SearchType,\r
221 IN CONST EFI_PEI_FILE_HANDLE FileHandle,\r
222 OUT VOID **SectionData\r
5879b875 223);\r
224\r
225\r
226\r
227/*\r
00edb218 228 This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.\r
5879b875 229\r
00edb218
A
230 @param ProcessVolume Process a firmware volume and create a volume handle.\r
231 @param FindFileByType Find all files of a specific type.\r
232 @param FindFileByName Find the file with a specific name.\r
233 @param GetFileInfo Return the information about a specific file\r
234 @param GetVolumeInfo Return the firmware volume attributes.\r
235 @param FindSectionByType Find all sections of a specific type.\r
5879b875 236\r
237**/\r
238struct _EFI_PEI_FIRMWARE_VOLUME_PPI {\r
00edb218
A
239 EFI_PEI_FV_PROCESS_FV ProcessVolume;\r
240 EFI_PEI_FV_FIND_FILE_TYPE FindFileByType;\r
241 EFI_PEI_FV_FIND_FILE_NAME FindFileByName;\r
242 EFI_PEI_FV_GET_FILE_INFO GetFileInfo;\r
243 EFI_PEI_FV_GET_INFO GetVolumeInfo;\r
244 EFI_PEI_FV_FIND_SECTION FindSectionByType;\r
5879b875 245} ;\r
246\r
00edb218 247extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid;\r
5879b875 248\r
249#endif \r