]>
Commit | Line | Data |
---|---|---|
3e5b4527 | 1 | /**\r |
2 | Module produce FV2 on top of FV.\r | |
3 | \r | |
4 | UEFI PI specification supersedes Inte's Framework Specification.\r | |
5 | EFI_FIRMWARE_VOLUME_PROTOCOL defined in Intel Framework Pkg is replaced by\r | |
6 | EFI_FIRMWARE_VOLUME2_PROTOCOL in MdePkg.\r | |
7 | This module produces FV2 on top of FV. This module is used on platform when both of\r | |
8 | these two conditions are true:\r | |
9 | 1) Framework module producing FV is present\r | |
10 | 2) And the rest of modules on the platform consume FV2\r | |
4259256b | 11 | \r |
12 | Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r | |
13 | All rights reserved. This program and the accompanying materials\r | |
14 | are licensed and made available under the terms and conditions of the BSD License\r | |
15 | which accompanies this distribution. The full text of the license may be found at\r | |
16 | http://opensource.org/licenses/bsd-license.php\r | |
17 | \r | |
18 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
19 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
20 | Module Name:\r | |
21 | \r | |
3e5b4527 | 22 | **/\r |
4259256b | 23 | \r |
24 | #include <PiDxe.h>\r | |
25 | #include <Protocol/FirmwareVolume2.h>\r | |
26 | #include <Protocol/FirmwareVolume.h>\r | |
27 | #include <Library/BaseLib.h>\r | |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/UefiBootServicesTableLib.h>\r | |
30 | #include <Library/UefiDriverEntryPoint.h>\r | |
31 | #include <Library/UefiLib.h>\r | |
32 | #include <Library/MemoryAllocationLib.h>\r | |
33 | \r | |
34 | /**\r | |
35 | \r | |
36 | Because of constraints imposed by the underlying firmware\r | |
37 | storage, an instance of the Firmware Volume Protocol may not\r | |
38 | be to able to support all possible variations of this\r | |
39 | architecture. These constraints and the current state of the\r | |
40 | firmware volume are exposed to the caller using the\r | |
41 | GetVolumeAttributes() function. GetVolumeAttributes() is\r | |
42 | callable only from TPL_NOTIFY and below. Behavior of\r | |
43 | GetVolumeAttributes() at any EFI_TPL above TPL_NOTIFY is\r | |
44 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI\r | |
45 | 2.0 specification.\r | |
46 | \r | |
47 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
48 | instance.\r | |
49 | \r | |
50 | @param FvAttributes Pointer to an EFI_FV_ATTRIBUTES in which\r | |
51 | the attributes and current settings are\r | |
52 | returned.\r | |
53 | \r | |
54 | \r | |
55 | @retval EFI_SUCCESS The firmware volume attributes were\r | |
56 | returned.\r | |
57 | \r | |
58 | **/\r | |
59 | EFI_STATUS\r | |
60 | EFIAPI\r | |
61 | Fv2GetVolumeAttributes (\r | |
62 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
63 | OUT EFI_FV_ATTRIBUTES *FvAttributes\r | |
64 | );\r | |
65 | \r | |
66 | \r | |
67 | /**\r | |
68 | The SetVolumeAttributes() function is used to set configurable\r | |
69 | firmware volume attributes. Only EFI_FV_READ_STATUS,\r | |
70 | EFI_FV_WRITE_STATUS, and EFI_FV_LOCK_STATUS may be modified, and\r | |
71 | then only in accordance with the declared capabilities. All\r | |
72 | other bits of FvAttributes are ignored on input. On successful\r | |
73 | return, all bits of *FvAttributes are valid and it contains the\r | |
74 | completed EFI_FV_ATTRIBUTES for the volume. To modify an\r | |
75 | attribute, the corresponding status bit in the EFI_FV_ATTRIBUTES\r | |
76 | is set to the desired value on input. The EFI_FV_LOCK_STATUS bit\r | |
77 | does not affect the ability to read or write the firmware\r | |
78 | volume. Rather, once the EFI_FV_LOCK_STATUS bit is set, it\r | |
79 | prevents further modification to all the attribute bits.\r | |
80 | SetVolumeAttributes() is callable only from TPL_NOTIFY and\r | |
81 | below. Behavior of SetVolumeAttributes() at any EFI_TPL above\r | |
82 | TPL_NOTIFY is undefined. Type EFI_TPL is defined in\r | |
83 | RaiseTPL() in the UEFI 2.0 specification.\r | |
84 | \r | |
85 | \r | |
86 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
87 | instance.\r | |
88 | \r | |
89 | @param FvAttributes On input, FvAttributes is a pointer to\r | |
90 | an EFI_FV_ATTRIBUTES containing the\r | |
91 | desired firmware volume settings. On\r | |
92 | successful return, it contains the new\r | |
93 | settings of the firmware volume. On\r | |
94 | unsuccessful return, FvAttributes is not\r | |
95 | modified and the firmware volume\r | |
96 | settings are not changed.\r | |
97 | \r | |
98 | @retval EFI_SUCCESS The requested firmware volume attributes\r | |
99 | were set and the resulting\r | |
100 | EFI_FV_ATTRIBUTES is returned in\r | |
101 | FvAttributes.\r | |
102 | \r | |
103 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS\r | |
104 | is set to 1 on input, but the\r | |
105 | device does not support enabling\r | |
106 | reads\r | |
107 | (FvAttributes:EFI_FV_READ_ENABLE\r | |
108 | is clear on return from\r | |
109 | GetVolumeAttributes()). Actual\r | |
110 | volume attributes are unchanged.\r | |
111 | \r | |
112 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS\r | |
113 | is cleared to 0 on input, but\r | |
114 | the device does not support\r | |
115 | disabling reads\r | |
116 | (FvAttributes:EFI_FV_READ_DISABL\r | |
117 | is clear on return from\r | |
118 | GetVolumeAttributes()). Actual\r | |
119 | volume attributes are unchanged.\r | |
120 | \r | |
121 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS\r | |
122 | is set to 1 on input, but the\r | |
123 | device does not support enabling\r | |
124 | writes\r | |
125 | (FvAttributes:EFI_FV_WRITE_ENABL\r | |
126 | is clear on return from\r | |
127 | GetVolumeAttributes()). Actual\r | |
128 | volume attributes are unchanged.\r | |
129 | \r | |
130 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS\r | |
131 | is cleared to 0 on input, but\r | |
132 | the device does not support\r | |
133 | disabling writes\r | |
134 | (FvAttributes:EFI_FV_WRITE_DISAB\r | |
135 | is clear on return from\r | |
136 | GetVolumeAttributes()). Actual\r | |
137 | volume attributes are unchanged.\r | |
138 | \r | |
139 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_LOCK_STATUS\r | |
140 | is set on input, but the device\r | |
141 | does not support locking\r | |
142 | (FvAttributes:EFI_FV_LOCK_CAP is\r | |
143 | clear on return from\r | |
144 | GetVolumeAttributes()). Actual\r | |
145 | volume attributes are unchanged.\r | |
146 | \r | |
147 | @retval EFI_ACCESS_DENIED Device is locked and does not\r | |
148 | allow attribute modification\r | |
149 | (FvAttributes:EFI_FV_LOCK_STATUS\r | |
150 | is set on return from\r | |
151 | GetVolumeAttributes()). Actual\r | |
152 | volume attributes are unchanged.\r | |
153 | \r | |
154 | **/\r | |
155 | EFI_STATUS\r | |
156 | EFIAPI\r | |
157 | Fv2SetVolumeAttributes (\r | |
158 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
159 | IN OUT EFI_FV_ATTRIBUTES *FvAttributes\r | |
160 | );\r | |
161 | \r | |
162 | \r | |
163 | /**\r | |
164 | ReadFile() is used to retrieve any file from a firmware volume\r | |
165 | during the DXE phase. The actual binary encoding of the file in\r | |
166 | the firmware volume media may be in any arbitrary format as long\r | |
167 | as it does the following: ?It is accessed using the Firmware\r | |
168 | Volume Protocol. ?The image that is returned follows the image\r | |
169 | format defined in Code Definitions: PI Firmware File Format.\r | |
170 | If the input value of Buffer==NULL, it indicates the caller is\r | |
171 | requesting only that the type, attributes, and size of the\r | |
172 | file be returned and that there is no output buffer. In this\r | |
173 | case, the following occurs:\r | |
174 | - BufferSize is returned with the size that is required to\r | |
175 | successfully complete the read.\r | |
176 | - The output parameters FoundType and *FileAttributes are\r | |
177 | returned with valid values.\r | |
178 | - The returned value of *AuthenticationStatus is undefined.\r | |
179 | \r | |
180 | If the input value of Buffer!=NULL, the output buffer is\r | |
181 | specified by a double indirection of the Buffer parameter. The\r | |
182 | input value of *Buffer is used to determine if the output\r | |
183 | buffer is caller allocated or is dynamically allocated by\r | |
184 | ReadFile(). If the input value of *Buffer!=NULL, it indicates\r | |
185 | the output buffer is caller allocated. In this case, the input\r | |
186 | value of *BufferSize indicates the size of the\r | |
187 | caller-allocated output buffer. If the output buffer is not\r | |
188 | large enough to contain the entire requested output, it is\r | |
189 | filled up to the point that the output buffer is exhausted and\r | |
190 | EFI_WARN_BUFFER_TOO_SMALL is returned, and then BufferSize is\r | |
191 | returned with the size required to successfully complete the\r | |
192 | read. All other output parameters are returned with valid\r | |
193 | values. If the input value of *Buffer==NULL, it indicates the\r | |
194 | output buffer is to be allocated by ReadFile(). In this case,\r | |
195 | ReadFile() will allocate an appropriately sized buffer from\r | |
196 | boot services pool memory, which will be returned in Buffer.\r | |
197 | The size of the new buffer is returned in BufferSize and all\r | |
198 | other output parameters are returned with valid values.\r | |
199 | ReadFile() is callable only from TPL_NOTIFY and below.\r | |
200 | Behavior of ReadFile() at any EFI_TPL above TPL_NOTIFY is\r | |
201 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI\r | |
202 | 2.0 specification.\r | |
203 | \r | |
204 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
205 | instance.\r | |
206 | \r | |
207 | @param NameGuid Pointer to an EFI_GUID, which is the file\r | |
208 | name. All firmware file names are EFI_GUIDs.\r | |
209 | A single firmware volume must not have two\r | |
210 | valid files with the same file name\r | |
211 | EFI_GUID.\r | |
212 | \r | |
213 | @param Buffer Pointer to a pointer to a buffer in which the\r | |
214 | file contents are returned, not including the\r | |
215 | file header.\r | |
216 | @param BufferSize Pointer to a caller-allocated UINTN. It\r | |
217 | indicates the size of the memory\r | |
218 | represented by Buffer.\r | |
219 | \r | |
220 | @param FoundType Pointer to a caller-allocated\r | |
221 | EFI_FV_FILETYPE.\r | |
222 | \r | |
223 | @param FileAttributes Pointer to a caller-allocated\r | |
224 | EFI_FV_FILE_ATTRIBUTES.\r | |
225 | \r | |
226 | @param AuthenticationStatus Pointer to a caller-allocated\r | |
227 | UINT32 in which the\r | |
228 | authentication status is\r | |
229 | returned.\r | |
230 | \r | |
231 | @retval EFI_SUCCESS The call completed successfully.\r | |
232 | \r | |
233 | @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to\r | |
234 | contain the requested\r | |
235 | output. The buffer is\r | |
236 | filled and the output is\r | |
237 | truncated.\r | |
238 | \r | |
239 | @retval EFI_OUT_OF_RESOURCES An allocation failure occurred.\r | |
240 | \r | |
241 | @retavl EFI_NOT_FOUND Name was not found in the firmware\r | |
242 | volume.\r | |
243 | \r | |
244 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
245 | attempting to access the firmware\r | |
246 | volume.\r | |
247 | \r | |
248 | @retval EFI_ACCESS_DENIED The firmware volume is configured to\r | |
249 | isallow reads.\r | |
250 | \r | |
251 | **/\r | |
252 | EFI_STATUS\r | |
253 | EFIAPI\r | |
254 | Fv2ReadFile (\r | |
255 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
256 | IN CONST EFI_GUID *NameGuid,\r | |
257 | IN OUT VOID **Buffer,\r | |
258 | IN OUT UINTN *BufferSize,\r | |
259 | OUT EFI_FV_FILETYPE *FoundType,\r | |
260 | OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,\r | |
261 | OUT UINT32 *AuthenticationStatus\r | |
262 | );\r | |
263 | \r | |
264 | /**\r | |
265 | ReadSection() is used to retrieve a specific section from a file\r | |
266 | within a firmware volume. The section returned is determined\r | |
267 | using a depth-first, left-to-right search algorithm through all\r | |
268 | sections found in the specified file. See\r | |
269 | ????Firmware File Sections???? on page 9 for more details about\r | |
270 | sections. The output buffer is specified by a double indirection\r | |
271 | of the Buffer parameter. The input value of Buffer is used to\r | |
272 | determine if the output buffer is caller allocated or is\r | |
273 | dynamically allocated by ReadSection(). If the input value of\r | |
274 | Buffer!=NULL, it indicates that the output buffer is caller\r | |
275 | allocated. In this case, the input value of *BufferSize\r | |
276 | indicates the size of the caller-allocated output buffer. If\r | |
277 | the output buffer is not large enough to contain the entire\r | |
278 | requested output, it is filled up to the point that the output\r | |
279 | buffer is exhausted and EFI_WARN_BUFFER_TOO_SMALL is returned,\r | |
280 | and then BufferSize is returned with the size that is required\r | |
281 | to successfully complete the read. All other\r | |
282 | output parameters are returned with valid values. If the input\r | |
283 | value of *Buffer==NULL, it indicates the output buffer is to\r | |
284 | be allocated by ReadSection(). In this case, ReadSection()\r | |
285 | will allocate an appropriately sized buffer from boot services\r | |
286 | pool memory, which will be returned in *Buffer. The size of\r | |
287 | the new buffer is returned in *BufferSize and all other output\r | |
288 | parameters are returned with valid values. ReadSection() is\r | |
289 | callable only from TPL_NOTIFY and below. Behavior of\r | |
290 | ReadSection() at any EFI_TPL above TPL_NOTIFY is\r | |
291 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI\r | |
292 | 2.0 specification.\r | |
293 | \r | |
294 | \r | |
295 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
296 | instance.\r | |
297 | \r | |
298 | @param NameGuid Pointer to an EFI_GUID, which indicates the\r | |
299 | file name from which the requested section\r | |
300 | will be read.\r | |
301 | \r | |
302 | @param SectionType Indicates the section type to return.\r | |
303 | SectionType in conjunction with\r | |
304 | SectionInstance indicates which section to\r | |
305 | return.\r | |
306 | \r | |
307 | @param SectionInstance Indicates which instance of sections\r | |
308 | with a type of SectionType to return.\r | |
309 | SectionType in conjunction with\r | |
310 | SectionInstance indicates which\r | |
311 | section to return. SectionInstance is\r | |
312 | zero based.\r | |
313 | \r | |
314 | @param Buffer Pointer to a pointer to a buffer in which the\r | |
315 | section contents are returned, not including\r | |
316 | the section header.\r | |
317 | \r | |
318 | @param BufferSize Pointer to a caller-allocated UINTN. It\r | |
319 | indicates the size of the memory\r | |
320 | represented by Buffer.\r | |
321 | \r | |
322 | @param AuthenticationStatus Pointer to a caller-allocated\r | |
323 | UINT32 in which the authentication\r | |
324 | status is returned.\r | |
325 | \r | |
326 | \r | |
327 | @retval EFI_SUCCESS The call completed successfully.\r | |
328 | \r | |
329 | @retval EFI_WARN_BUFFER_TOO_SMALL The caller-allocated\r | |
330 | buffer is too small to\r | |
331 | contain the requested\r | |
332 | output. The buffer is\r | |
333 | filled and the output is\r | |
334 | truncated.\r | |
335 | \r | |
336 | @retval EFI_OUT_OF_RESOURCES An allocation failure occurred.\r | |
337 | \r | |
338 | @retval EFI_NOT_FOUND The requested file was not found in\r | |
339 | the firmware volume. EFI_NOT_FOUND The\r | |
340 | requested section was not found in the\r | |
341 | specified file.\r | |
342 | \r | |
343 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
344 | attempting to access the firmware\r | |
345 | volume.\r | |
346 | \r | |
347 | @retval EFI_ACCESS_DENIED The firmware volume is configured to\r | |
348 | disallow reads. EFI_PROTOCOL_ERROR\r | |
349 | The requested section was not found,\r | |
350 | but the file could not be fully\r | |
351 | parsed because a required\r | |
352 | GUIDED_SECTION_EXTRACTION_PROTOCOL\r | |
353 | was not found. It is possible the\r | |
354 | requested section exists within the\r | |
355 | file and could be successfully\r | |
356 | extracted once the required\r | |
357 | GUIDED_SECTION_EXTRACTION_PROTOCOL\r | |
358 | is published.\r | |
359 | \r | |
360 | **/\r | |
361 | EFI_STATUS\r | |
362 | EFIAPI\r | |
363 | Fv2ReadSection (\r | |
364 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
365 | IN CONST EFI_GUID *NameGuid,\r | |
366 | IN EFI_SECTION_TYPE SectionType,\r | |
367 | IN UINTN SectionInstance,\r | |
368 | IN OUT VOID **Buffer,\r | |
369 | IN OUT UINTN *BufferSize,\r | |
370 | OUT UINT32 *AuthenticationStatus\r | |
371 | );\r | |
372 | \r | |
373 | /**\r | |
374 | WriteFile() is used to write one or more files to a firmware\r | |
375 | volume. Each file to be written is described by an\r | |
376 | EFI_FV_WRITE_FILE_DATA structure. The caller must ensure that\r | |
377 | any required alignment for all files listed in the FileData\r | |
378 | array is compatible with the firmware volume. Firmware volume\r | |
379 | capabilities can be determined using the GetVolumeAttributes()\r | |
380 | call. Similarly, if the WritePolicy is set to\r | |
381 | EFI_FV_RELIABLE_WRITE, the caller must check the firmware volume\r | |
382 | capabilities to ensure EFI_FV_RELIABLE_WRITE is supported by the\r | |
383 | firmware volume. EFI_FV_UNRELIABLE_WRITE must always be\r | |
384 | supported. Writing a file with a size of zero\r | |
385 | (FileData[n].BufferSize == 0) deletes the file from the firmware\r | |
386 | volume if it exists. Deleting a file must be done one at a time.\r | |
387 | Deleting a file as part of a multiple file write is not allowed.\r | |
388 | Platform Initialization Specification VOLUME 3 Shared\r | |
389 | Architectural Elements 84 August 21, 2006 Version 1.0\r | |
390 | WriteFile() is callable only from TPL_NOTIFY and below.\r | |
391 | Behavior of WriteFile() at any EFI_TPL above TPL_NOTIFY is\r | |
392 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI 2.0\r | |
393 | specification.\r | |
394 | \r | |
395 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
396 | instance. NumberOfFiles Indicates the number of\r | |
397 | elements in the array pointed to by FileData.\r | |
398 | \r | |
399 | \r | |
400 | @param WritePolicy Indicates the level of reliability for the\r | |
401 | write in the event of a power failure or\r | |
402 | other system failure during the write\r | |
403 | operation.\r | |
404 | \r | |
405 | @param FileData Pointer to an array of\r | |
406 | EFI_FV_WRITE_FILE_DATA. Each element of\r | |
407 | FileData[] represents a file to be written.\r | |
408 | \r | |
409 | \r | |
410 | @retval EFI_SUCCESS The write completed successfully.\r | |
411 | \r | |
412 | @retval EFI_OUT_OF_RESOURCES The firmware volume does not\r | |
413 | have enough free space to\r | |
414 | storefile(s).\r | |
415 | \r | |
416 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
417 | attempting to access the firmware volume.\r | |
418 | \r | |
419 | @retval EFI_WRITE_PROTECTED The firmware volume is\r | |
420 | configured to disallow writes.\r | |
421 | \r | |
422 | @retval EFI_NOT_FOUND A delete was requested, but the\r | |
423 | requested file was not found in the\r | |
424 | firmware volume.\r | |
425 | \r | |
426 | @retval EFI_INVALID_PARAMETER A delete was requested with a\r | |
427 | multiple file write.\r | |
428 | \r | |
429 | @retval EFI_INVALID_PARAMETER An unsupported WritePolicy was\r | |
430 | requested.\r | |
431 | \r | |
432 | @retval EFI_INVALID_PARAMETER An unknown file type was\r | |
433 | specified.\r | |
434 | \r | |
435 | @retval EFI_INVALID_PARAMETER A file system specific error\r | |
436 | has occurred.\r | |
437 | \r | |
438 | **/\r | |
439 | EFI_STATUS \r | |
440 | EFIAPI\r | |
441 | Fv2WriteFile (\r | |
442 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
443 | IN UINT32 NumberOfFiles,\r | |
444 | IN EFI_FV_WRITE_POLICY WritePolicy,\r | |
445 | IN EFI_FV_WRITE_FILE_DATA *FileData\r | |
446 | );\r | |
447 | \r | |
448 | /**\r | |
449 | GetNextFile() is the interface that is used to search a firmware\r | |
450 | volume for a particular file. It is called successively until\r | |
451 | the desired file is located or the function returns\r | |
452 | EFI_NOT_FOUND. To filter uninteresting files from the output,\r | |
453 | the type of file to search for may be specified in FileType. For\r | |
454 | example, if *FileType is EFI_FV_FILETYPE_DRIVER, only files of\r | |
455 | this type will be returned in the output. If *FileType is\r | |
456 | EFI_FV_FILETYPE_ALL, no filtering of file types is done. The Key\r | |
457 | parameter is used to indicate a starting point of the search. If\r | |
458 | the buffer *Key is completely initialized to zero, the search\r | |
459 | re-initialized and starts at the beginning. Subsequent calls to\r | |
460 | GetNextFile() must maintain the value of *Key returned by the\r | |
461 | immediately previous call. The actual contents of *Key are\r | |
462 | implementation specific and no semantic content is implied.\r | |
463 | GetNextFile() is callable only from TPL_NOTIFY and below.\r | |
464 | Behavior of GetNextFile() at any EFI_TPL above TPL_NOTIFY is\r | |
465 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI 2.0\r | |
466 | specification. Status Codes Returned\r | |
467 | \r | |
468 | \r | |
469 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
470 | instance. Key Pointer to a caller-allocated buffer\r | |
471 | that contains implementation-specific data that is\r | |
472 | used to track where to begin the search for the\r | |
473 | next file. The size of the buffer must be at least\r | |
474 | This->KeySize bytes long. To re-initialize the\r | |
475 | search and begin from the beginning of the\r | |
476 | firmware volume, the entire buffer must be cleared\r | |
477 | to zero. Other than clearing the buffer to\r | |
478 | initiate a new search, the caller must not modify\r | |
479 | the data in the buffer between calls to\r | |
480 | GetNextFile().\r | |
481 | \r | |
482 | @param FileType Pointer to a caller-allocated\r | |
483 | EFI_FV_FILETYPE. The GetNextFile() API can\r | |
484 | filter its search for files based on the\r | |
485 | value of the FileType input. A *FileType\r | |
486 | input of EFI_FV_FILETYPE_ALL causes\r | |
487 | GetNextFile() to search for files of all\r | |
488 | types. If a file is found, the file's type\r | |
489 | is returned in FileType. *FileType is not\r | |
490 | modified if no file is found.\r | |
491 | \r | |
492 | @param NameGuid Pointer to a caller-allocated EFI_GUID. If a\r | |
493 | matching file is found, the file's name is\r | |
494 | returned in NameGuid. If no matching file is\r | |
495 | found, *NameGuid is not modified.\r | |
496 | \r | |
497 | @param Attributes Pointer to a caller-allocated\r | |
498 | EFI_FV_FILE_ATTRIBUTES. If a matching file\r | |
499 | is found, the file's attributes are returned\r | |
500 | in Attributes. If no matching file is found,\r | |
501 | Attributes is not modified. Type\r | |
502 | EFI_FV_FILE_ATTRIBUTES is defined in\r | |
503 | ReadFile().\r | |
504 | \r | |
505 | @param Size Pointer to a caller-allocated UINTN. If a\r | |
506 | matching file is found, the file's size is\r | |
507 | returned in *Size. If no matching file is found,\r | |
508 | Size is not modified.\r | |
509 | \r | |
510 | @retval EFI_SUCCESS The output parameters are filled with data\r | |
511 | obtained from the first matching file that\r | |
512 | was found.\r | |
513 | \r | |
514 | @retval FI_NOT_FOUND No files of type FileType were found.\r | |
515 | \r | |
516 | \r | |
517 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
518 | attempting to access the firmware\r | |
519 | volume.\r | |
520 | \r | |
521 | @retval EFI_ACCESS_DENIED The firmware volume is configured to\r | |
522 | disallow reads.\r | |
523 | \r | |
524 | \r | |
525 | **/\r | |
526 | EFI_STATUS\r | |
527 | EFIAPI\r | |
528 | Fv2GetNextFile (\r | |
529 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
530 | IN OUT VOID *Key,\r | |
531 | IN OUT EFI_FV_FILETYPE *FileType,\r | |
532 | OUT EFI_GUID *NameGuid,\r | |
533 | OUT EFI_FV_FILE_ATTRIBUTES *Attributes,\r | |
534 | OUT UINTN *Size\r | |
535 | );\r | |
536 | \r | |
537 | /**\r | |
538 | The GetInfo() function returns information of type\r | |
539 | InformationType for the requested firmware volume. If the volume\r | |
540 | does not support the requested information type, then\r | |
541 | EFI_UNSUPPORTED is returned. If the buffer is not large enough\r | |
542 | to hold the requested structure, EFI_BUFFER_TOO_SMALL is\r | |
543 | returned and the BufferSize is set to the size of buffer that is\r | |
544 | required to make the request. The information types defined by\r | |
545 | this specification are required information types that all file\r | |
546 | systems must support.\r | |
547 | \r | |
548 | @param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
549 | instance that is the file handle the requested\r | |
550 | information is for.\r | |
551 | \r | |
552 | @param InformationType The type identifier for the\r | |
553 | information being requested.\r | |
554 | \r | |
555 | @param BufferSize On input, the size of Buffer. On output,\r | |
556 | the amount of data returned in Buffer. In\r | |
557 | both cases, the size is measured in bytes.\r | |
558 | \r | |
559 | @param Buffer A pointer to the data buffer to return. The\r | |
560 | buffer's type is indicated by InformationType.\r | |
561 | \r | |
562 | \r | |
563 | @retval EFI_SUCCESS The information was retrieved.\r | |
564 | \r | |
565 | @retval EFI_UNSUPPORTED The InformationType is not known.\r | |
566 | \r | |
567 | @retval EFI_NO_MEDIA The device has no medium.\r | |
568 | \r | |
569 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
570 | \r | |
571 | @retval EFI_VOLUME_CORRUPTED The file system structures are\r | |
572 | corrupted.\r | |
573 | \r | |
574 | @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to\r | |
575 | read the current directory\r | |
576 | entry. BufferSize has been\r | |
577 | updated with the size needed to\r | |
578 | complete the request.\r | |
579 | \r | |
580 | \r | |
581 | **/\r | |
582 | EFI_STATUS\r | |
583 | EFIAPI\r | |
584 | Fv2GetInfo (\r | |
585 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
586 | IN CONST EFI_GUID *InformationType,\r | |
587 | IN OUT UINTN *BufferSize,\r | |
588 | OUT VOID *Buffer\r | |
589 | );\r | |
590 | \r | |
591 | /**\r | |
592 | \r | |
593 | The SetInfo() function sets information of type InformationType\r | |
594 | on the requested firmware volume.\r | |
595 | \r | |
596 | \r | |
597 | @param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
598 | instance that is the file handle the information\r | |
599 | is for.\r | |
600 | \r | |
601 | @param InformationType The type identifier for the\r | |
602 | information being set.\r | |
603 | \r | |
604 | @param BufferSize The size, in bytes, of Buffer.\r | |
605 | \r | |
606 | @param Buffer A pointer to the data buffer to write. The\r | |
607 | buffer's type is indicated by InformationType.\r | |
608 | \r | |
609 | @retval EFI_SUCCESS The information was set.\r | |
610 | \r | |
611 | @retval EFI_UNSUPPORTED The InformationType is not known.\r | |
612 | \r | |
613 | @retval EFI_NO_MEDIA The device has no medium.\r | |
614 | \r | |
615 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
616 | \r | |
617 | @retval EFI_VOLUME_CORRUPTED The file system structures are\r | |
618 | corrupted.\r | |
619 | \r | |
620 | \r | |
621 | @retval EFI_WRITE_PROTECTED The media is read only.\r | |
622 | \r | |
623 | @retval EFI_VOLUME_FULL The volume is full.\r | |
624 | \r | |
625 | @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the\r | |
626 | size of the type indicated by\r | |
627 | InformationType.\r | |
628 | \r | |
629 | **/\r | |
630 | EFI_STATUS\r | |
631 | EFIAPI\r | |
632 | Fv2SetInfo (\r | |
633 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
634 | IN CONST EFI_GUID *InformationType,\r | |
635 | IN UINTN BufferSize,\r | |
636 | IN CONST VOID *Buffer\r | |
637 | );\r | |
638 | \r | |
639 | //\r | |
640 | //\r | |
641 | //\r | |
642 | #define FIRMWARE_VOLUME2_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('f', 'v', '2', 't')\r | |
643 | \r | |
644 | typedef struct {\r | |
645 | UINTN Signature;\r | |
646 | EFI_FIRMWARE_VOLUME2_PROTOCOL FirmwareVolume2;\r | |
647 | EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;\r | |
648 | } FIRMWARE_VOLUME2_PRIVATE_DATA;\r | |
649 | \r | |
650 | #define FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS(a) CR (a, FIRMWARE_VOLUME2_PRIVATE_DATA, FirmwareVolume2, FIRMWARE_VOLUME2_PRIVATE_DATA_SIGNATURE)\r | |
651 | \r | |
652 | //\r | |
653 | // Firmware Volume Protocol template\r | |
654 | //\r | |
655 | EFI_EVENT mFv2Registration;\r | |
656 | \r | |
657 | FIRMWARE_VOLUME2_PRIVATE_DATA gFirmwareVolume2PrivateDataTemplate = {\r | |
658 | FIRMWARE_VOLUME2_PRIVATE_DATA_SIGNATURE,\r | |
659 | {\r | |
660 | Fv2GetVolumeAttributes,\r | |
661 | Fv2SetVolumeAttributes,\r | |
662 | Fv2ReadFile,\r | |
663 | Fv2ReadSection,\r | |
664 | Fv2WriteFile,\r | |
665 | Fv2GetNextFile,\r | |
666 | 0,\r | |
667 | NULL,\r | |
668 | Fv2GetInfo,\r | |
669 | Fv2SetInfo\r | |
670 | },\r | |
671 | NULL\r | |
672 | };\r | |
673 | \r | |
674 | //\r | |
675 | // Module globals\r | |
676 | //\r | |
677 | \r | |
678 | VOID\r | |
679 | EFIAPI\r | |
680 | Fv2NotificationEvent (\r | |
681 | IN EFI_EVENT Event,\r | |
682 | IN VOID *Context\r | |
683 | )\r | |
684 | {\r | |
685 | EFI_STATUS Status;\r | |
686 | UINTN BufferSize;\r | |
687 | EFI_HANDLE Handle;\r | |
688 | FIRMWARE_VOLUME2_PRIVATE_DATA *Private;\r | |
689 | EFI_FIRMWARE_VOLUME2_PROTOCOL *FirmwareVolume2;\r | |
690 | \r | |
691 | while (TRUE) {\r | |
692 | BufferSize = sizeof (Handle);\r | |
693 | Status = gBS->LocateHandle (\r | |
694 | ByRegisterNotify,\r | |
695 | &gEfiFirmwareVolumeProtocolGuid,\r | |
696 | mFv2Registration,\r | |
697 | &BufferSize,\r | |
698 | &Handle\r | |
699 | );\r | |
700 | if (EFI_ERROR (Status)) {\r | |
701 | //\r | |
702 | // Exit Path of While Loop....\r | |
703 | //\r | |
704 | break;\r | |
705 | }\r | |
706 | \r | |
707 | //\r | |
708 | // Skip this handle if the Firmware Volume Protocol is already installed\r | |
709 | //\r | |
710 | Status = gBS->HandleProtocol (\r | |
711 | Handle,\r | |
712 | &gEfiFirmwareVolume2ProtocolGuid,\r | |
713 | (VOID **)&FirmwareVolume2\r | |
714 | );\r | |
715 | if (!EFI_ERROR (Status)) {\r | |
716 | continue;\r | |
717 | }\r | |
718 | \r | |
719 | //\r | |
720 | // Allocate private data structure\r | |
721 | //\r | |
722 | Private = AllocateCopyPool (sizeof (FIRMWARE_VOLUME2_PRIVATE_DATA), &gFirmwareVolume2PrivateDataTemplate);\r | |
723 | if (Private == NULL) {\r | |
724 | continue;\r | |
725 | }\r | |
726 | \r | |
727 | //\r | |
728 | // Retrieve the Firmware Volume2 Protocol\r | |
729 | //\r | |
730 | Status = gBS->HandleProtocol (\r | |
731 | Handle,\r | |
732 | &gEfiFirmwareVolumeProtocolGuid,\r | |
733 | (VOID **)&Private->FirmwareVolume\r | |
734 | );\r | |
735 | ASSERT_EFI_ERROR (Status);\r | |
736 | \r | |
737 | //\r | |
738 | // Fill in rest of private data structure\r | |
739 | //\r | |
740 | Private->FirmwareVolume2.KeySize = Private->FirmwareVolume->KeySize;\r | |
741 | Private->FirmwareVolume2.ParentHandle = Private->FirmwareVolume->ParentHandle;\r | |
742 | \r | |
743 | //\r | |
744 | // Install Firmware Volume Protocol onto same handle\r | |
745 | //\r | |
746 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
747 | &Handle,\r | |
748 | &gEfiFirmwareVolume2ProtocolGuid,\r | |
749 | &Private->FirmwareVolume2,\r | |
750 | NULL\r | |
751 | );\r | |
752 | ASSERT_EFI_ERROR (Status);\r | |
753 | }\r | |
754 | }\r | |
755 | \r | |
756 | \r | |
757 | /**\r | |
758 | The user Entry Point for DXE driver. The user code starts with this function\r | |
759 | as the real entry point for the image goes into a library that calls this \r | |
760 | function.\r | |
761 | \r | |
762 | @param[in] ImageHandle The firmware allocated handle for the EFI image. \r | |
763 | @param[in] SystemTable A pointer to the EFI System Table.\r | |
764 | \r | |
765 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
766 | @retval other Some error occurs when executing this entry point.\r | |
767 | \r | |
768 | **/\r | |
769 | EFI_STATUS\r | |
770 | EFIAPI\r | |
771 | InitializeFirmwareVolume (\r | |
772 | IN EFI_HANDLE ImageHandle,\r | |
773 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
774 | )\r | |
775 | {\r | |
776 | EfiCreateProtocolNotifyEvent (\r | |
777 | &gEfiFirmwareVolumeProtocolGuid,\r | |
778 | TPL_CALLBACK,\r | |
779 | Fv2NotificationEvent,\r | |
780 | NULL,\r | |
781 | &mFv2Registration\r | |
782 | );\r | |
783 | return EFI_SUCCESS;\r | |
784 | }\r | |
785 | \r | |
786 | /**\r | |
787 | \r | |
788 | Because of constraints imposed by the underlying firmware\r | |
789 | storage, an instance of the Firmware Volume Protocol may not\r | |
790 | be to able to support all possible variations of this\r | |
791 | architecture. These constraints and the current state of the\r | |
792 | firmware volume are exposed to the caller using the\r | |
793 | GetVolumeAttributes() function. GetVolumeAttributes() is\r | |
794 | callable only from TPL_NOTIFY and below. Behavior of\r | |
795 | GetVolumeAttributes() at any EFI_TPL above TPL_NOTIFY is\r | |
796 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI\r | |
797 | 2.0 specification.\r | |
798 | \r | |
799 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
800 | instance.\r | |
801 | \r | |
802 | @param FvAttributes Pointer to an EFI_FV_ATTRIBUTES in which\r | |
803 | the attributes and current settings are\r | |
804 | returned.\r | |
805 | \r | |
806 | \r | |
807 | @retval EFI_SUCCESS The firmware volume attributes were\r | |
808 | returned.\r | |
809 | \r | |
810 | **/\r | |
811 | EFI_STATUS\r | |
812 | EFIAPI\r | |
813 | Fv2GetVolumeAttributes (\r | |
814 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
815 | OUT EFI_FV_ATTRIBUTES *FvAttributes\r | |
816 | )\r | |
817 | {\r | |
818 | EFI_STATUS Status;\r | |
819 | FIRMWARE_VOLUME2_PRIVATE_DATA *Private;\r | |
820 | EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;\r | |
821 | INTN Alignment;\r | |
822 | \r | |
823 | Private = FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS (This);\r | |
824 | FirmwareVolume = Private->FirmwareVolume;\r | |
825 | Status = FirmwareVolume->GetVolumeAttributes (\r | |
826 | FirmwareVolume,\r | |
827 | (FRAMEWORK_EFI_FV_ATTRIBUTES *)FvAttributes\r | |
828 | );\r | |
829 | if (!EFI_ERROR (Status)) {\r | |
830 | Alignment = LowBitSet64 (RShiftU64 (*FvAttributes, 16) & 0xffff);\r | |
831 | if (Alignment != -1) {\r | |
832 | Alignment = Alignment << 16;\r | |
833 | } else {\r | |
834 | Alignment = 0;\r | |
835 | }\r | |
836 | *FvAttributes = (*FvAttributes & 0x1ff) | Alignment;\r | |
837 | }\r | |
838 | return Status;\r | |
839 | }\r | |
840 | \r | |
841 | /**\r | |
842 | The SetVolumeAttributes() function is used to set configurable\r | |
843 | firmware volume attributes. Only EFI_FV_READ_STATUS,\r | |
844 | EFI_FV_WRITE_STATUS, and EFI_FV_LOCK_STATUS may be modified, and\r | |
845 | then only in accordance with the declared capabilities. All\r | |
846 | other bits of FvAttributes are ignored on input. On successful\r | |
847 | return, all bits of *FvAttributes are valid and it contains the\r | |
848 | completed EFI_FV_ATTRIBUTES for the volume. To modify an\r | |
849 | attribute, the corresponding status bit in the EFI_FV_ATTRIBUTES\r | |
850 | is set to the desired value on input. The EFI_FV_LOCK_STATUS bit\r | |
851 | does not affect the ability to read or write the firmware\r | |
852 | volume. Rather, once the EFI_FV_LOCK_STATUS bit is set, it\r | |
853 | prevents further modification to all the attribute bits.\r | |
854 | SetVolumeAttributes() is callable only from TPL_NOTIFY and\r | |
855 | below. Behavior of SetVolumeAttributes() at any EFI_TPL above\r | |
856 | TPL_NOTIFY is undefined. Type EFI_TPL is defined in\r | |
857 | RaiseTPL() in the UEFI 2.0 specification.\r | |
858 | \r | |
859 | \r | |
860 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
861 | instance.\r | |
862 | \r | |
863 | @param FvAttributes On input, FvAttributes is a pointer to\r | |
864 | an EFI_FV_ATTRIBUTES containing the\r | |
865 | desired firmware volume settings. On\r | |
866 | successful return, it contains the new\r | |
867 | settings of the firmware volume. On\r | |
868 | unsuccessful return, FvAttributes is not\r | |
869 | modified and the firmware volume\r | |
870 | settings are not changed.\r | |
871 | \r | |
872 | @retval EFI_SUCCESS The requested firmware volume attributes\r | |
873 | were set and the resulting\r | |
874 | EFI_FV_ATTRIBUTES is returned in\r | |
875 | FvAttributes.\r | |
876 | \r | |
877 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS\r | |
878 | is set to 1 on input, but the\r | |
879 | device does not support enabling\r | |
880 | reads\r | |
881 | (FvAttributes:EFI_FV_READ_ENABLE\r | |
882 | is clear on return from\r | |
883 | GetVolumeAttributes()). Actual\r | |
884 | volume attributes are unchanged.\r | |
885 | \r | |
886 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_READ_STATUS\r | |
887 | is cleared to 0 on input, but\r | |
888 | the device does not support\r | |
889 | disabling reads\r | |
890 | (FvAttributes:EFI_FV_READ_DISABL\r | |
891 | is clear on return from\r | |
892 | GetVolumeAttributes()). Actual\r | |
893 | volume attributes are unchanged.\r | |
894 | \r | |
895 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS\r | |
896 | is set to 1 on input, but the\r | |
897 | device does not support enabling\r | |
898 | writes\r | |
899 | (FvAttributes:EFI_FV_WRITE_ENABL\r | |
900 | is clear on return from\r | |
901 | GetVolumeAttributes()). Actual\r | |
902 | volume attributes are unchanged.\r | |
903 | \r | |
904 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_WRITE_STATUS\r | |
905 | is cleared to 0 on input, but\r | |
906 | the device does not support\r | |
907 | disabling writes\r | |
908 | (FvAttributes:EFI_FV_WRITE_DISAB\r | |
909 | is clear on return from\r | |
910 | GetVolumeAttributes()). Actual\r | |
911 | volume attributes are unchanged.\r | |
912 | \r | |
913 | @retval EFI_INVALID_PARAMETER FvAttributes:EFI_FV_LOCK_STATUS\r | |
914 | is set on input, but the device\r | |
915 | does not support locking\r | |
916 | (FvAttributes:EFI_FV_LOCK_CAP is\r | |
917 | clear on return from\r | |
918 | GetVolumeAttributes()). Actual\r | |
919 | volume attributes are unchanged.\r | |
920 | \r | |
921 | @retval EFI_ACCESS_DENIED Device is locked and does not\r | |
922 | allow attribute modification\r | |
923 | (FvAttributes:EFI_FV_LOCK_STATUS\r | |
924 | is set on return from\r | |
925 | GetVolumeAttributes()). Actual\r | |
926 | volume attributes are unchanged.\r | |
927 | \r | |
928 | **/\r | |
929 | EFI_STATUS\r | |
930 | EFIAPI\r | |
931 | Fv2SetVolumeAttributes (\r | |
932 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
933 | IN OUT EFI_FV_ATTRIBUTES *FvAttributes\r | |
934 | )\r | |
935 | {\r | |
936 | FIRMWARE_VOLUME2_PRIVATE_DATA *Private;\r | |
937 | EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;\r | |
938 | FRAMEWORK_EFI_FV_ATTRIBUTES FrameworkFvAttributes; \r | |
3e5b4527 | 939 | UINTN Shift;\r |
4259256b | 940 | \r |
941 | Private = FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS (This);\r | |
942 | FirmwareVolume = Private->FirmwareVolume;\r | |
943 | \r | |
3e5b4527 | 944 | FrameworkFvAttributes = (*FvAttributes & 0x1ff);\r |
945 | Shift = (UINTN) RShiftU64(*FvAttributes & EFI_FV2_ALIGNMENT, 16);\r | |
946 | FrameworkFvAttributes = FrameworkFvAttributes | LShiftU64 (EFI_FV_ALIGNMENT_2, Shift);\r | |
4259256b | 947 | \r |
948 | return FirmwareVolume->SetVolumeAttributes (\r | |
949 | FirmwareVolume,\r | |
950 | &FrameworkFvAttributes\r | |
951 | );\r | |
952 | }\r | |
953 | \r | |
954 | /**\r | |
955 | ReadFile() is used to retrieve any file from a firmware volume\r | |
956 | during the DXE phase. The actual binary encoding of the file in\r | |
957 | the firmware volume media may be in any arbitrary format as long\r | |
958 | as it does the following: ?It is accessed using the Firmware\r | |
959 | Volume Protocol. ?The image that is returned follows the image\r | |
960 | format defined in Code Definitions: PI Firmware File Format.\r | |
961 | If the input value of Buffer==NULL, it indicates the caller is\r | |
962 | requesting only that the type, attributes, and size of the\r | |
963 | file be returned and that there is no output buffer. In this\r | |
964 | case, the following occurs:\r | |
965 | - BufferSize is returned with the size that is required to\r | |
966 | successfully complete the read.\r | |
967 | - The output parameters FoundType and *FileAttributes are\r | |
968 | returned with valid values.\r | |
969 | - The returned value of *AuthenticationStatus is undefined.\r | |
970 | \r | |
971 | If the input value of Buffer!=NULL, the output buffer is\r | |
972 | specified by a double indirection of the Buffer parameter. The\r | |
973 | input value of *Buffer is used to determine if the output\r | |
974 | buffer is caller allocated or is dynamically allocated by\r | |
975 | ReadFile(). If the input value of *Buffer!=NULL, it indicates\r | |
976 | the output buffer is caller allocated. In this case, the input\r | |
977 | value of *BufferSize indicates the size of the\r | |
978 | caller-allocated output buffer. If the output buffer is not\r | |
979 | large enough to contain the entire requested output, it is\r | |
980 | filled up to the point that the output buffer is exhausted and\r | |
981 | EFI_WARN_BUFFER_TOO_SMALL is returned, and then BufferSize is\r | |
982 | returned with the size required to successfully complete the\r | |
983 | read. All other output parameters are returned with valid\r | |
984 | values. If the input value of *Buffer==NULL, it indicates the\r | |
985 | output buffer is to be allocated by ReadFile(). In this case,\r | |
986 | ReadFile() will allocate an appropriately sized buffer from\r | |
987 | boot services pool memory, which will be returned in Buffer.\r | |
988 | The size of the new buffer is returned in BufferSize and all\r | |
989 | other output parameters are returned with valid values.\r | |
990 | ReadFile() is callable only from TPL_NOTIFY and below.\r | |
991 | Behavior of ReadFile() at any EFI_TPL above TPL_NOTIFY is\r | |
992 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI\r | |
993 | 2.0 specification.\r | |
994 | \r | |
995 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
996 | instance.\r | |
997 | \r | |
998 | @param NameGuid Pointer to an EFI_GUID, which is the file\r | |
999 | name. All firmware file names are EFI_GUIDs.\r | |
1000 | A single firmware volume must not have two\r | |
1001 | valid files with the same file name\r | |
1002 | EFI_GUID.\r | |
1003 | \r | |
1004 | @param Buffer Pointer to a pointer to a buffer in which the\r | |
1005 | file contents are returned, not including the\r | |
1006 | file header.\r | |
1007 | @param BufferSize Pointer to a caller-allocated UINTN. It\r | |
1008 | indicates the size of the memory\r | |
1009 | represented by Buffer.\r | |
1010 | \r | |
1011 | @param FoundType Pointer to a caller-allocated\r | |
1012 | EFI_FV_FILETYPE.\r | |
1013 | \r | |
1014 | @param FileAttributes Pointer to a caller-allocated\r | |
1015 | EFI_FV_FILE_ATTRIBUTES.\r | |
1016 | \r | |
1017 | @param AuthenticationStatus Pointer to a caller-allocated\r | |
1018 | UINT32 in which the\r | |
1019 | authentication status is\r | |
1020 | returned.\r | |
1021 | \r | |
1022 | @retval EFI_SUCCESS The call completed successfully.\r | |
1023 | \r | |
1024 | @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to\r | |
1025 | contain the requested\r | |
1026 | output. The buffer is\r | |
1027 | filled and the output is\r | |
1028 | truncated.\r | |
1029 | \r | |
1030 | @retval EFI_OUT_OF_RESOURCES An allocation failure occurred.\r | |
1031 | \r | |
1032 | @retavl EFI_NOT_FOUND Name was not found in the firmware\r | |
1033 | volume.\r | |
1034 | \r | |
1035 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
1036 | attempting to access the firmware\r | |
1037 | volume.\r | |
1038 | \r | |
1039 | @retval EFI_ACCESS_DENIED The firmware volume is configured to\r | |
1040 | isallow reads.\r | |
1041 | \r | |
1042 | **/\r | |
1043 | EFI_STATUS\r | |
1044 | EFIAPI\r | |
1045 | Fv2ReadFile (\r | |
1046 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
1047 | IN CONST EFI_GUID *NameGuid,\r | |
1048 | IN OUT VOID **Buffer,\r | |
1049 | IN OUT UINTN *BufferSize,\r | |
1050 | OUT EFI_FV_FILETYPE *FoundType,\r | |
1051 | OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,\r | |
1052 | OUT UINT32 *AuthenticationStatus\r | |
1053 | )\r | |
1054 | {\r | |
1055 | FIRMWARE_VOLUME2_PRIVATE_DATA *Private;\r | |
1056 | EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;\r | |
1057 | \r | |
1058 | Private = FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS (This);\r | |
1059 | FirmwareVolume = Private->FirmwareVolume;\r | |
1060 | \r | |
1061 | return FirmwareVolume->ReadFile (\r | |
1062 | FirmwareVolume,\r | |
1063 | (EFI_GUID *)NameGuid,\r | |
1064 | Buffer,\r | |
1065 | BufferSize,\r | |
1066 | FoundType,\r | |
1067 | FileAttributes,\r | |
1068 | AuthenticationStatus\r | |
1069 | );\r | |
1070 | }\r | |
1071 | \r | |
1072 | /**\r | |
1073 | ReadSection() is used to retrieve a specific section from a file\r | |
1074 | within a firmware volume. The section returned is determined\r | |
1075 | using a depth-first, left-to-right search algorithm through all\r | |
1076 | sections found in the specified file. See\r | |
1077 | ????Firmware File Sections???? on page 9 for more details about\r | |
1078 | sections. The output buffer is specified by a double indirection\r | |
1079 | of the Buffer parameter. The input value of Buffer is used to\r | |
1080 | determine if the output buffer is caller allocated or is\r | |
1081 | dynamically allocated by ReadSection(). If the input value of\r | |
1082 | Buffer!=NULL, it indicates that the output buffer is caller\r | |
1083 | allocated. In this case, the input value of *BufferSize\r | |
1084 | indicates the size of the caller-allocated output buffer. If\r | |
1085 | the output buffer is not large enough to contain the entire\r | |
1086 | requested output, it is filled up to the point that the output\r | |
1087 | buffer is exhausted and EFI_WARN_BUFFER_TOO_SMALL is returned,\r | |
1088 | and then BufferSize is returned with the size that is required\r | |
1089 | to successfully complete the read. All other\r | |
1090 | output parameters are returned with valid values. If the input\r | |
1091 | value of *Buffer==NULL, it indicates the output buffer is to\r | |
1092 | be allocated by ReadSection(). In this case, ReadSection()\r | |
1093 | will allocate an appropriately sized buffer from boot services\r | |
1094 | pool memory, which will be returned in *Buffer. The size of\r | |
1095 | the new buffer is returned in *BufferSize and all other output\r | |
1096 | parameters are returned with valid values. ReadSection() is\r | |
1097 | callable only from TPL_NOTIFY and below. Behavior of\r | |
1098 | ReadSection() at any EFI_TPL above TPL_NOTIFY is\r | |
1099 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI\r | |
1100 | 2.0 specification.\r | |
1101 | \r | |
1102 | \r | |
1103 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
1104 | instance.\r | |
1105 | \r | |
1106 | @param NameGuid Pointer to an EFI_GUID, which indicates the\r | |
1107 | file name from which the requested section\r | |
1108 | will be read.\r | |
1109 | \r | |
1110 | @param SectionType Indicates the section type to return.\r | |
1111 | SectionType in conjunction with\r | |
1112 | SectionInstance indicates which section to\r | |
1113 | return.\r | |
1114 | \r | |
1115 | @param SectionInstance Indicates which instance of sections\r | |
1116 | with a type of SectionType to return.\r | |
1117 | SectionType in conjunction with\r | |
1118 | SectionInstance indicates which\r | |
1119 | section to return. SectionInstance is\r | |
1120 | zero based.\r | |
1121 | \r | |
1122 | @param Buffer Pointer to a pointer to a buffer in which the\r | |
1123 | section contents are returned, not including\r | |
1124 | the section header.\r | |
1125 | \r | |
1126 | @param BufferSize Pointer to a caller-allocated UINTN. It\r | |
1127 | indicates the size of the memory\r | |
1128 | represented by Buffer.\r | |
1129 | \r | |
1130 | @param AuthenticationStatus Pointer to a caller-allocated\r | |
1131 | UINT32 in which the authentication\r | |
1132 | status is returned.\r | |
1133 | \r | |
1134 | \r | |
1135 | @retval EFI_SUCCESS The call completed successfully.\r | |
1136 | \r | |
1137 | @retval EFI_WARN_BUFFER_TOO_SMALL The caller-allocated\r | |
1138 | buffer is too small to\r | |
1139 | contain the requested\r | |
1140 | output. The buffer is\r | |
1141 | filled and the output is\r | |
1142 | truncated.\r | |
1143 | \r | |
1144 | @retval EFI_OUT_OF_RESOURCES An allocation failure occurred.\r | |
1145 | \r | |
1146 | @retval EFI_NOT_FOUND The requested file was not found in\r | |
1147 | the firmware volume. EFI_NOT_FOUND The\r | |
1148 | requested section was not found in the\r | |
1149 | specified file.\r | |
1150 | \r | |
1151 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
1152 | attempting to access the firmware\r | |
1153 | volume.\r | |
1154 | \r | |
1155 | @retval EFI_ACCESS_DENIED The firmware volume is configured to\r | |
1156 | disallow reads. EFI_PROTOCOL_ERROR\r | |
1157 | The requested section was not found,\r | |
1158 | but the file could not be fully\r | |
1159 | parsed because a required\r | |
1160 | GUIDED_SECTION_EXTRACTION_PROTOCOL\r | |
1161 | was not found. It is possible the\r | |
1162 | requested section exists within the\r | |
1163 | file and could be successfully\r | |
1164 | extracted once the required\r | |
1165 | GUIDED_SECTION_EXTRACTION_PROTOCOL\r | |
1166 | is published.\r | |
1167 | \r | |
1168 | **/\r | |
1169 | EFI_STATUS\r | |
1170 | EFIAPI\r | |
1171 | Fv2ReadSection (\r | |
1172 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
1173 | IN CONST EFI_GUID *NameGuid,\r | |
1174 | IN EFI_SECTION_TYPE SectionType,\r | |
1175 | IN UINTN SectionInstance,\r | |
1176 | IN OUT VOID **Buffer,\r | |
1177 | IN OUT UINTN *BufferSize,\r | |
1178 | OUT UINT32 *AuthenticationStatus\r | |
1179 | )\r | |
1180 | {\r | |
1181 | FIRMWARE_VOLUME2_PRIVATE_DATA *Private;\r | |
1182 | EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;\r | |
1183 | \r | |
1184 | Private = FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS (This);\r | |
1185 | FirmwareVolume = Private->FirmwareVolume;\r | |
1186 | \r | |
1187 | return FirmwareVolume->ReadSection (\r | |
1188 | FirmwareVolume,\r | |
1189 | (EFI_GUID *)NameGuid,\r | |
1190 | SectionType,\r | |
1191 | SectionInstance,\r | |
1192 | Buffer,\r | |
1193 | BufferSize,\r | |
1194 | AuthenticationStatus\r | |
1195 | );\r | |
1196 | }\r | |
1197 | \r | |
1198 | /**\r | |
1199 | WriteFile() is used to write one or more files to a firmware\r | |
1200 | volume. Each file to be written is described by an\r | |
1201 | EFI_FV_WRITE_FILE_DATA structure. The caller must ensure that\r | |
1202 | any required alignment for all files listed in the FileData\r | |
1203 | array is compatible with the firmware volume. Firmware volume\r | |
1204 | capabilities can be determined using the GetVolumeAttributes()\r | |
1205 | call. Similarly, if the WritePolicy is set to\r | |
1206 | EFI_FV_RELIABLE_WRITE, the caller must check the firmware volume\r | |
1207 | capabilities to ensure EFI_FV_RELIABLE_WRITE is supported by the\r | |
1208 | firmware volume. EFI_FV_UNRELIABLE_WRITE must always be\r | |
1209 | supported. Writing a file with a size of zero\r | |
1210 | (FileData[n].BufferSize == 0) deletes the file from the firmware\r | |
1211 | volume if it exists. Deleting a file must be done one at a time.\r | |
1212 | Deleting a file as part of a multiple file write is not allowed.\r | |
1213 | Platform Initialization Specification VOLUME 3 Shared\r | |
1214 | Architectural Elements 84 August 21, 2006 Version 1.0\r | |
1215 | WriteFile() is callable only from TPL_NOTIFY and below.\r | |
1216 | Behavior of WriteFile() at any EFI_TPL above TPL_NOTIFY is\r | |
1217 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI 2.0\r | |
1218 | specification.\r | |
1219 | \r | |
1220 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
1221 | instance. NumberOfFiles Indicates the number of\r | |
1222 | elements in the array pointed to by FileData.\r | |
1223 | \r | |
1224 | \r | |
1225 | @param WritePolicy Indicates the level of reliability for the\r | |
1226 | write in the event of a power failure or\r | |
1227 | other system failure during the write\r | |
1228 | operation.\r | |
1229 | \r | |
1230 | @param FileData Pointer to an array of\r | |
1231 | EFI_FV_WRITE_FILE_DATA. Each element of\r | |
1232 | FileData[] represents a file to be written.\r | |
1233 | \r | |
1234 | \r | |
1235 | @retval EFI_SUCCESS The write completed successfully.\r | |
1236 | \r | |
1237 | @retval EFI_OUT_OF_RESOURCES The firmware volume does not\r | |
1238 | have enough free space to\r | |
1239 | storefile(s).\r | |
1240 | \r | |
1241 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
1242 | attempting to access the firmware volume.\r | |
1243 | \r | |
1244 | @retval EFI_WRITE_PROTECTED The firmware volume is\r | |
1245 | configured to disallow writes.\r | |
1246 | \r | |
1247 | @retval EFI_NOT_FOUND A delete was requested, but the\r | |
1248 | requested file was not found in the\r | |
1249 | firmware volume.\r | |
1250 | \r | |
1251 | @retval EFI_INVALID_PARAMETER A delete was requested with a\r | |
1252 | multiple file write.\r | |
1253 | \r | |
1254 | @retval EFI_INVALID_PARAMETER An unsupported WritePolicy was\r | |
1255 | requested.\r | |
1256 | \r | |
1257 | @retval EFI_INVALID_PARAMETER An unknown file type was\r | |
1258 | specified.\r | |
1259 | \r | |
1260 | @retval EFI_INVALID_PARAMETER A file system specific error\r | |
1261 | has occurred.\r | |
1262 | \r | |
1263 | **/\r | |
1264 | EFI_STATUS \r | |
1265 | EFIAPI\r | |
1266 | Fv2WriteFile (\r | |
1267 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
1268 | IN UINT32 NumberOfFiles,\r | |
1269 | IN EFI_FV_WRITE_POLICY WritePolicy,\r | |
1270 | IN EFI_FV_WRITE_FILE_DATA *FileData\r | |
1271 | )\r | |
1272 | {\r | |
1273 | FIRMWARE_VOLUME2_PRIVATE_DATA *Private;\r | |
1274 | EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;\r | |
1275 | \r | |
1276 | Private = FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS (This);\r | |
1277 | FirmwareVolume = Private->FirmwareVolume;\r | |
1278 | \r | |
1279 | return FirmwareVolume->WriteFile (\r | |
1280 | FirmwareVolume,\r | |
1281 | NumberOfFiles,\r | |
1282 | WritePolicy,\r | |
1283 | (FRAMEWORK_EFI_FV_WRITE_FILE_DATA *)FileData\r | |
1284 | );\r | |
1285 | }\r | |
1286 | \r | |
1287 | /**\r | |
1288 | GetNextFile() is the interface that is used to search a firmware\r | |
1289 | volume for a particular file. It is called successively until\r | |
1290 | the desired file is located or the function returns\r | |
1291 | EFI_NOT_FOUND. To filter uninteresting files from the output,\r | |
1292 | the type of file to search for may be specified in FileType. For\r | |
1293 | example, if *FileType is EFI_FV_FILETYPE_DRIVER, only files of\r | |
1294 | this type will be returned in the output. If *FileType is\r | |
1295 | EFI_FV_FILETYPE_ALL, no filtering of file types is done. The Key\r | |
1296 | parameter is used to indicate a starting point of the search. If\r | |
1297 | the buffer *Key is completely initialized to zero, the search\r | |
1298 | re-initialized and starts at the beginning. Subsequent calls to\r | |
1299 | GetNextFile() must maintain the value of *Key returned by the\r | |
1300 | immediately previous call. The actual contents of *Key are\r | |
1301 | implementation specific and no semantic content is implied.\r | |
1302 | GetNextFile() is callable only from TPL_NOTIFY and below.\r | |
1303 | Behavior of GetNextFile() at any EFI_TPL above TPL_NOTIFY is\r | |
1304 | undefined. Type EFI_TPL is defined in RaiseTPL() in the UEFI 2.0\r | |
1305 | specification. Status Codes Returned\r | |
1306 | \r | |
1307 | \r | |
1308 | @param This Indicates the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
1309 | instance. Key Pointer to a caller-allocated buffer\r | |
1310 | that contains implementation-specific data that is\r | |
1311 | used to track where to begin the search for the\r | |
1312 | next file. The size of the buffer must be at least\r | |
1313 | This->KeySize bytes long. To re-initialize the\r | |
1314 | search and begin from the beginning of the\r | |
1315 | firmware volume, the entire buffer must be cleared\r | |
1316 | to zero. Other than clearing the buffer to\r | |
1317 | initiate a new search, the caller must not modify\r | |
1318 | the data in the buffer between calls to\r | |
1319 | GetNextFile().\r | |
1320 | \r | |
1321 | @param FileType Pointer to a caller-allocated\r | |
1322 | EFI_FV_FILETYPE. The GetNextFile() API can\r | |
1323 | filter its search for files based on the\r | |
1324 | value of the FileType input. A *FileType\r | |
1325 | input of EFI_FV_FILETYPE_ALL causes\r | |
1326 | GetNextFile() to search for files of all\r | |
1327 | types. If a file is found, the file's type\r | |
1328 | is returned in FileType. *FileType is not\r | |
1329 | modified if no file is found.\r | |
1330 | \r | |
1331 | @param NameGuid Pointer to a caller-allocated EFI_GUID. If a\r | |
1332 | matching file is found, the file's name is\r | |
1333 | returned in NameGuid. If no matching file is\r | |
1334 | found, *NameGuid is not modified.\r | |
1335 | \r | |
1336 | @param Attributes Pointer to a caller-allocated\r | |
1337 | EFI_FV_FILE_ATTRIBUTES. If a matching file\r | |
1338 | is found, the file's attributes are returned\r | |
1339 | in Attributes. If no matching file is found,\r | |
1340 | Attributes is not modified. Type\r | |
1341 | EFI_FV_FILE_ATTRIBUTES is defined in\r | |
1342 | ReadFile().\r | |
1343 | \r | |
1344 | @param Size Pointer to a caller-allocated UINTN. If a\r | |
1345 | matching file is found, the file's size is\r | |
1346 | returned in *Size. If no matching file is found,\r | |
1347 | Size is not modified.\r | |
1348 | \r | |
1349 | @retval EFI_SUCCESS The output parameters are filled with data\r | |
1350 | obtained from the first matching file that\r | |
1351 | was found.\r | |
1352 | \r | |
1353 | @retval FI_NOT_FOUND No files of type FileType were found.\r | |
1354 | \r | |
1355 | \r | |
1356 | @retval EFI_DEVICE_ERROR A hardware error occurred when\r | |
1357 | attempting to access the firmware\r | |
1358 | volume.\r | |
1359 | \r | |
1360 | @retval EFI_ACCESS_DENIED The firmware volume is configured to\r | |
1361 | disallow reads.\r | |
1362 | \r | |
1363 | \r | |
1364 | **/\r | |
1365 | EFI_STATUS\r | |
1366 | EFIAPI\r | |
1367 | Fv2GetNextFile (\r | |
1368 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
1369 | IN OUT VOID *Key,\r | |
1370 | IN OUT EFI_FV_FILETYPE *FileType,\r | |
1371 | OUT EFI_GUID *NameGuid,\r | |
1372 | OUT EFI_FV_FILE_ATTRIBUTES *Attributes,\r | |
1373 | OUT UINTN *Size\r | |
1374 | )\r | |
1375 | {\r | |
1376 | FIRMWARE_VOLUME2_PRIVATE_DATA *Private;\r | |
1377 | EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume;\r | |
1378 | \r | |
1379 | Private = FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS (This);\r | |
1380 | FirmwareVolume = Private->FirmwareVolume;\r | |
1381 | \r | |
1382 | return FirmwareVolume->GetNextFile (\r | |
1383 | FirmwareVolume,\r | |
1384 | Key,\r | |
1385 | FileType,\r | |
1386 | NameGuid,\r | |
1387 | Attributes,\r | |
1388 | Size\r | |
1389 | );\r | |
1390 | }\r | |
1391 | \r | |
1392 | /**\r | |
1393 | The GetInfo() function returns information of type\r | |
1394 | InformationType for the requested firmware volume. If the volume\r | |
1395 | does not support the requested information type, then\r | |
1396 | EFI_UNSUPPORTED is returned. If the buffer is not large enough\r | |
1397 | to hold the requested structure, EFI_BUFFER_TOO_SMALL is\r | |
1398 | returned and the BufferSize is set to the size of buffer that is\r | |
1399 | required to make the request. The information types defined by\r | |
1400 | this specification are required information types that all file\r | |
1401 | systems must support.\r | |
1402 | \r | |
1403 | @param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
1404 | instance that is the file handle the requested\r | |
1405 | information is for.\r | |
1406 | \r | |
1407 | @param InformationType The type identifier for the\r | |
1408 | information being requested.\r | |
1409 | \r | |
1410 | @param BufferSize On input, the size of Buffer. On output,\r | |
1411 | the amount of data returned in Buffer. In\r | |
1412 | both cases, the size is measured in bytes.\r | |
1413 | \r | |
1414 | @param Buffer A pointer to the data buffer to return. The\r | |
1415 | buffer's type is indicated by InformationType.\r | |
1416 | \r | |
1417 | \r | |
1418 | @retval EFI_SUCCESS The information was retrieved.\r | |
1419 | \r | |
1420 | @retval EFI_UNSUPPORTED The InformationType is not known.\r | |
1421 | \r | |
1422 | @retval EFI_NO_MEDIA The device has no medium.\r | |
1423 | \r | |
1424 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
1425 | \r | |
1426 | @retval EFI_VOLUME_CORRUPTED The file system structures are\r | |
1427 | corrupted.\r | |
1428 | \r | |
1429 | @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to\r | |
1430 | read the current directory\r | |
1431 | entry. BufferSize has been\r | |
1432 | updated with the size needed to\r | |
1433 | complete the request.\r | |
1434 | \r | |
1435 | \r | |
1436 | **/\r | |
1437 | EFI_STATUS\r | |
1438 | EFIAPI\r | |
1439 | Fv2GetInfo (\r | |
1440 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
1441 | IN CONST EFI_GUID *InformationType,\r | |
1442 | IN OUT UINTN *BufferSize,\r | |
1443 | OUT VOID *Buffer\r | |
1444 | )\r | |
1445 | {\r | |
1446 | return EFI_UNSUPPORTED;\r | |
1447 | }\r | |
1448 | \r | |
1449 | /**\r | |
1450 | \r | |
1451 | The SetInfo() function sets information of type InformationType\r | |
1452 | on the requested firmware volume.\r | |
1453 | \r | |
1454 | \r | |
1455 | @param This A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL\r | |
1456 | instance that is the file handle the information\r | |
1457 | is for.\r | |
1458 | \r | |
1459 | @param InformationType The type identifier for the\r | |
1460 | information being set.\r | |
1461 | \r | |
1462 | @param BufferSize The size, in bytes, of Buffer.\r | |
1463 | \r | |
1464 | @param Buffer A pointer to the data buffer to write. The\r | |
1465 | buffer's type is indicated by InformationType.\r | |
1466 | \r | |
1467 | @retval EFI_SUCCESS The information was set.\r | |
1468 | \r | |
1469 | @retval EFI_UNSUPPORTED The InformationType is not known.\r | |
1470 | \r | |
1471 | @retval EFI_NO_MEDIA The device has no medium.\r | |
1472 | \r | |
1473 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
1474 | \r | |
1475 | @retval EFI_VOLUME_CORRUPTED The file system structures are\r | |
1476 | corrupted.\r | |
1477 | \r | |
1478 | \r | |
1479 | @retval EFI_WRITE_PROTECTED The media is read only.\r | |
1480 | \r | |
1481 | @retval EFI_VOLUME_FULL The volume is full.\r | |
1482 | \r | |
1483 | @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the\r | |
1484 | size of the type indicated by\r | |
1485 | InformationType.\r | |
1486 | \r | |
1487 | **/\r | |
1488 | EFI_STATUS\r | |
1489 | EFIAPI\r | |
1490 | Fv2SetInfo (\r | |
1491 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
1492 | IN CONST EFI_GUID *InformationType,\r | |
1493 | IN UINTN BufferSize,\r | |
1494 | IN CONST VOID *Buffer\r | |
1495 | )\r | |
1496 | {\r | |
1497 | return EFI_UNSUPPORTED;\r | |
1498 | }\r |