]>
Commit | Line | Data |
---|---|---|
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 - 2008, 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 | |
13 | @par Revision Reference:\r | |
14 | This PPI is from PI Version 1.0 errata.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __FIRMWARE_VOLUME_PPI_H__\r | |
19 | #define __FIRMWARE_VOLUME_PPI_H__\r | |
20 | \r | |
21 | ///\r | |
22 | /// The GUID for this PPI is the same as the firmware volume format GUID.\r | |
23 | /// The FV format can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for a user-defined\r | |
24 | /// format. The EFI_FIRMWARE_FILE_SYSTEM2_GUID is the PI Firmware Volume format.\r | |
25 | /// \r | |
26 | typedef struct _EFI_PEI_FIRMWARE_VOLUME_PPI EFI_PEI_FIRMWARE_VOLUME_PPI;\r | |
27 | \r | |
28 | \r | |
29 | /**\r | |
30 | Process a firmware volume and create a volume handle.\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 | |
41 | @param This Points to this instance of the\r | |
42 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
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 | |
46 | handle. The firmware volume handle must\r | |
47 | be unique within the system. \r | |
48 | \r | |
49 | @retval EFI_SUCCESS Firmware volume handle created.\r | |
50 | @retval EFI_VOLUME_CORRUPTED Volume was corrupt.\r | |
51 | \r | |
52 | **/\r | |
53 | typedef\r | |
54 | EFI_STATUS\r | |
55 | (EFIAPI *EFI_PEI_FV_PROCESS_FV)(\r | |
56 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r | |
57 | IN VOID *Buffer,\r | |
58 | IN UINTN BufferSize,\r | |
59 | OUT EFI_PEI_FV_HANDLE *FvHandle\r | |
60 | );\r | |
61 | \r | |
62 | /**\r | |
63 | Finds the next file of the specified type.\r | |
64 | \r | |
65 | This service enables PEI modules to discover additional firmware files. \r | |
66 | The FileHandle must be unique within the system.\r | |
67 | \r | |
68 | @param This Points to this instance of the\r | |
69 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
70 | @param SearchType A filter to find only files of this type. Type\r | |
71 | EFI_FV_FILETYPE_ALL causes no filtering to be\r | |
72 | done.\r | |
73 | @param FvHandle Handle of firmware volume in which to\r | |
74 | search.\r | |
75 | @param FileHandle Points to the current handle from which to\r | |
76 | begin searching or NULL to start at the\r | |
77 | beginning of the firmware volume. Updated\r | |
78 | upon return to reflect the file found.\r | |
79 | \r | |
80 | @retval EFI_SUCCESS The file was found.\r | |
81 | @retval EFI_NOT_FOUND The file was not found. FileHandle contains NULL.\r | |
82 | \r | |
83 | **/ \r | |
84 | typedef\r | |
85 | EFI_STATUS\r | |
86 | (EFIAPI *EFI_PEI_FV_FIND_FILE_TYPE)( \r | |
87 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r | |
88 | IN EFI_FV_FILETYPE SearchType, \r | |
89 | IN EFI_PEI_FV_HANDLE FvHandle,\r | |
90 | IN OUT EFI_PEI_FILE_HANDLE *FileHandle \r | |
91 | );\r | |
92 | \r | |
93 | \r | |
94 | /**\r | |
95 | Find a file within a volume by its name. \r | |
96 | \r | |
97 | This service searches for files with a specific name, within\r | |
98 | either the specified firmware volume or all firmware volumes.\r | |
99 | \r | |
100 | @param This Points to this instance of the\r | |
101 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
102 | @param FileName A pointer to the name of the file to find\r | |
103 | within the firmware volume.\r | |
104 | @param FvHandle Upon entry, the pointer to the firmware\r | |
105 | volume to search or NULL if all firmware\r | |
106 | volumes should be searched. Upon exit, the\r | |
107 | actual firmware volume in which the file was\r | |
108 | found.\r | |
109 | @param FileHandle Upon exit, points to the found file's\r | |
110 | handle or NULL if it could not be found.\r | |
111 | \r | |
112 | @retval EFI_SUCCESS File was found.\r | |
113 | @retval EFI_NOT_FOUND File was not found.\r | |
114 | @retval EFI_INVALID_PARAMETER FvHandle or FileHandle or\r | |
115 | FileName was NULL.\r | |
116 | \r | |
117 | \r | |
118 | **/\r | |
119 | typedef\r | |
120 | EFI_STATUS\r | |
121 | (EFIAPI *EFI_PEI_FV_FIND_FILE_NAME)(\r | |
122 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r | |
123 | IN CONST EFI_GUID *FileName,\r | |
124 | IN EFI_PEI_FV_HANDLE *FvHandle,\r | |
125 | OUT EFI_PEI_FILE_HANDLE *FileHandle\r | |
126 | );\r | |
127 | \r | |
128 | \r | |
129 | /**\r | |
130 | Returns information about a specific file.\r | |
131 | \r | |
132 | This function returns information about a specific\r | |
133 | file, including its file name, type, attributes, starting\r | |
134 | address and size. \r | |
135 | \r | |
136 | @param This Points to this instance of the\r | |
137 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
138 | @param FileHandle Handle of the file.\r | |
139 | @param FileInfo Upon exit, points to the file's\r | |
140 | information.\r | |
141 | \r | |
142 | @retval EFI_SUCCESS File information returned.\r | |
143 | @retval EFI_INVALID_PARAMETER If FileHandle does not\r | |
144 | represent a valid file.\r | |
145 | @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r | |
146 | \r | |
147 | **/ \r | |
148 | typedef\r | |
149 | EFI_STATUS\r | |
150 | (EFIAPI *EFI_PEI_FV_GET_FILE_INFO)(\r | |
151 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r | |
152 | IN EFI_PEI_FILE_HANDLE FileHandle, \r | |
153 | OUT EFI_FV_FILE_INFO *FileInfo\r | |
154 | );\r | |
155 | \r | |
156 | /**\r | |
157 | This function returns information about the firmware volume.\r | |
158 | \r | |
159 | @param This Points to this instance of the\r | |
160 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
161 | @param FvHandle Handle to the firmware handle.\r | |
162 | @param VolumeInfo Points to the returned firmware volume\r | |
163 | information.\r | |
164 | \r | |
165 | @retval EFI_SUCCESS Information returned successfully.\r | |
166 | @retval EFI_INVALID_PARAMETER FvHandle does not indicate a valid\r | |
167 | firmware volume or VolumeInfo is NULL.\r | |
168 | \r | |
169 | **/ \r | |
170 | typedef\r | |
171 | EFI_STATUS\r | |
172 | (EFIAPI *EFI_PEI_FV_GET_INFO)(\r | |
173 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, \r | |
174 | IN EFI_PEI_FV_HANDLE FvHandle, \r | |
175 | OUT EFI_FV_INFO *VolumeInfo\r | |
176 | );\r | |
177 | \r | |
178 | /**\r | |
179 | Find the next matching section in the firmware file.\r | |
180 | \r | |
181 | This service enables PEI modules to discover sections\r | |
182 | of a given type within a valid file.\r | |
183 | \r | |
184 | @param This Points to this instance of the\r | |
185 | EFI_PEI_FIRMWARE_VOLUME_PPI.\r | |
186 | @param SearchType A filter to find only sections of this\r | |
187 | type.\r | |
188 | @param FileHandle Handle of firmware file in which to\r | |
189 | search.\r | |
190 | @param SectionData Updated upon return to point to the\r | |
191 | section found.\r | |
192 | \r | |
193 | @retval EFI_SUCCESS Section was found.\r | |
194 | @retval EFI_NOT_FOUND Section of the specified type was not\r | |
195 | found. SectionData contains NULL.\r | |
196 | **/\r | |
197 | typedef\r | |
198 | EFI_STATUS\r | |
199 | (EFIAPI *EFI_PEI_FV_FIND_SECTION)(\r | |
200 | IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,\r | |
201 | IN EFI_SECTION_TYPE SearchType,\r | |
202 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
203 | OUT VOID **SectionData\r | |
204 | );\r | |
205 | \r | |
206 | ///\r | |
207 | /// This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.\r | |
208 | ///\r | |
209 | struct _EFI_PEI_FIRMWARE_VOLUME_PPI {\r | |
210 | EFI_PEI_FV_PROCESS_FV ProcessVolume;\r | |
211 | EFI_PEI_FV_FIND_FILE_TYPE FindFileByType;\r | |
212 | EFI_PEI_FV_FIND_FILE_NAME FindFileByName;\r | |
213 | EFI_PEI_FV_GET_FILE_INFO GetFileInfo;\r | |
214 | EFI_PEI_FV_GET_INFO GetVolumeInfo;\r | |
215 | EFI_PEI_FV_FIND_SECTION FindSectionByType;\r | |
216 | };\r | |
217 | \r | |
218 | extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid;\r | |
219 | \r | |
220 | #endif \r |