]>
Commit | Line | Data |
---|---|---|
9da91aea BJ |
1 | /** @file\r |
2 | The internal header file of FvSimpleFileSystem driver.\r | |
3 | \r | |
4 | Copyright (c) 2014, ARM Limited. All rights reserved.\r | |
d1102dba | 5 | Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9da91aea | 6 | \r |
9d510e61 | 7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
9da91aea BJ |
8 | \r |
9 | **/\r | |
10 | \r | |
11 | #ifndef __FVFS_INTERNAL_H__\r | |
12 | #define __FVFS_INTERNAL_H__\r | |
13 | \r | |
14 | #include <Uefi.h>\r | |
15 | #include <PiDxe.h>\r | |
16 | \r | |
17 | #include <Library/BaseLib.h>\r | |
18 | #include <Library/BaseMemoryLib.h>\r | |
19 | #include <Library/DebugLib.h>\r | |
20 | #include <Library/DevicePathLib.h>\r | |
21 | #include <Library/MemoryAllocationLib.h>\r | |
22 | #include <Library/PrintLib.h>\r | |
23 | #include <Library/UefiBootServicesTableLib.h>\r | |
24 | #include <Library/UefiLib.h>\r | |
25 | \r | |
26 | #include <Protocol/DriverBinding.h>\r | |
27 | #include <Protocol/FirmwareVolume2.h>\r | |
28 | #include <Protocol/SimpleFileSystem.h>\r | |
29 | #include <Protocol/UnicodeCollation.h>\r | |
30 | \r | |
31 | #include <Guid/FileSystemInfo.h>\r | |
32 | #include <Guid/FileInfo.h>\r | |
33 | #include <Guid/FileSystemVolumeLabelInfo.h>\r | |
34 | \r | |
35 | typedef struct _FV_FILESYSTEM_FILE FV_FILESYSTEM_FILE;\r | |
36 | typedef struct _FV_FILESYSTEM_FILE_INFO FV_FILESYSTEM_FILE_INFO;\r | |
37 | typedef struct _FV_FILESYSTEM_INSTANCE FV_FILESYSTEM_INSTANCE;\r | |
38 | \r | |
39 | //\r | |
40 | // Struct representing an instance of the "filesystem". There will be one of\r | |
41 | // these structs per FV.\r | |
42 | //\r | |
43 | struct _FV_FILESYSTEM_INSTANCE {\r | |
44 | UINT32 Signature;\r | |
45 | LIST_ENTRY FileInfoHead;\r | |
46 | LIST_ENTRY FileHead;\r | |
47 | EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;\r | |
48 | EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol;\r | |
49 | EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFs;\r | |
50 | FV_FILESYSTEM_FILE *Root;\r | |
51 | CHAR16 *VolumeLabel;\r | |
52 | };\r | |
53 | \r | |
54 | //\r | |
d1102dba | 55 | // Struct representing a opening file. Each opening operation on file will\r |
9da91aea BJ |
56 | // create such an instance except for the "root directory", which will only\r |
57 | // be created once for each FV.\r | |
58 | //\r | |
59 | struct _FV_FILESYSTEM_FILE {\r | |
60 | UINT32 Signature;\r | |
61 | LIST_ENTRY Link;\r | |
62 | FV_FILESYSTEM_FILE_INFO *DirReadNext;\r | |
63 | FV_FILESYSTEM_INSTANCE *Instance;\r | |
64 | EFI_FILE_PROTOCOL FileProtocol;\r | |
65 | FV_FILESYSTEM_FILE_INFO *FvFileInfo;\r | |
66 | UINT64 Position;\r | |
67 | };\r | |
68 | \r | |
69 | //\r | |
70 | // Struct representing the info of a file.\r | |
71 | //\r | |
72 | struct _FV_FILESYSTEM_FILE_INFO {\r | |
73 | UINT32 Signature;\r | |
74 | LIST_ENTRY Link;\r | |
75 | EFI_GUID NameGuid;\r | |
76 | EFI_FV_FILETYPE Type;\r | |
77 | EFI_FILE_INFO FileInfo;\r | |
78 | };\r | |
79 | \r | |
80 | #define FVFS_FILE_SIGNATURE SIGNATURE_32 ('f', 'v', 'f', 'i')\r | |
81 | #define FVFS_FILE_INFO_SIGNATURE SIGNATURE_32 ('f', 'v', 'i', 'n')\r | |
82 | #define FVFS_INSTANCE_SIGNATURE SIGNATURE_32 ('f', 'v', 'f', 's')\r | |
83 | \r | |
84 | #define FVFS_INSTANCE_FROM_SIMPLE_FS_THIS(This) CR ( \\r | |
85 | This, \\r | |
86 | FV_FILESYSTEM_INSTANCE, \\r | |
87 | SimpleFs, \\r | |
88 | FVFS_INSTANCE_SIGNATURE \\r | |
89 | )\r | |
90 | \r | |
91 | #define FVFS_FILE_FROM_FILE_THIS(This) CR ( \\r | |
92 | This, \\r | |
93 | FV_FILESYSTEM_FILE, \\r | |
94 | FileProtocol, \\r | |
95 | FVFS_FILE_SIGNATURE \\r | |
96 | )\r | |
97 | \r | |
98 | #define FVFS_FILE_INFO_FROM_LINK(This) CR ( \\r | |
99 | This, \\r | |
100 | FV_FILESYSTEM_FILE_INFO, \\r | |
101 | Link, \\r | |
102 | FVFS_FILE_INFO_SIGNATURE \\r | |
103 | )\r | |
104 | \r | |
105 | #define FVFS_FILE_FROM_LINK(FileLink) CR (FileLink, FV_FILESYSTEM_FILE, Link, FVFS_FILE_SIGNATURE)\r | |
106 | \r | |
107 | #define FVFS_GET_FIRST_FILE(Instance) FVFS_FILE_FROM_LINK (GetFirstNode (&Instance->FileHead))\r | |
108 | \r | |
109 | #define FVFS_GET_FIRST_FILE_INFO(Instance) FVFS_FILE_INFO_FROM_LINK (GetFirstNode (&Instance->FileInfoHead))\r | |
110 | \r | |
111 | \r | |
112 | #define FV_FILETYPE_IS_EXECUTABLE(Type) ((Type) == EFI_FV_FILETYPE_PEIM || \\r | |
113 | (Type) == EFI_FV_FILETYPE_DRIVER || \\r | |
114 | (Type) == EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER || \\r | |
115 | (Type) == EFI_FV_FILETYPE_APPLICATION)\r | |
116 | \r | |
117 | /**\r | |
118 | Open the root directory on a volume.\r | |
119 | \r | |
120 | @param This A pointer to the volume to open the root directory.\r | |
121 | @param RootFile A pointer to the location to return the opened file handle for the\r | |
122 | root directory.\r | |
123 | \r | |
124 | @retval EFI_SUCCESS The device was opened.\r | |
125 | @retval EFI_UNSUPPORTED This volume does not support the requested file system type.\r | |
126 | @retval EFI_NO_MEDIA The device has no medium.\r | |
127 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
128 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
129 | @retval EFI_ACCESS_DENIED The service denied access to the file.\r | |
130 | @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.\r | |
131 | @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no\r | |
132 | longer supported. Any existing file handles for this volume are\r | |
133 | no longer valid. To access the files on the new medium, the\r | |
134 | volume must be reopened with OpenVolume().\r | |
135 | \r | |
136 | **/\r | |
137 | EFI_STATUS\r | |
138 | EFIAPI\r | |
139 | FvSimpleFileSystemOpenVolume (\r | |
140 | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,\r | |
141 | OUT EFI_FILE_PROTOCOL **RootFile\r | |
142 | );\r | |
143 | \r | |
144 | /**\r | |
145 | Test to see if this driver supports ControllerHandle.\r | |
146 | \r | |
147 | @param DriverBinding Protocol instance pointer.\r | |
148 | @param ControllerHandle Handle of device to test\r | |
149 | @param RemainingDevicePath Optional parameter use to pick a specific child\r | |
150 | device to start.\r | |
151 | \r | |
152 | @retval EFI_SUCCESS This driver supports this device\r | |
153 | @retval EFI_ALREADY_STARTED This driver is already running on this device\r | |
154 | @retval other This driver does not support this device\r | |
155 | \r | |
156 | **/\r | |
157 | EFI_STATUS\r | |
158 | EFIAPI\r | |
159 | FvSimpleFileSystemDriverSupported (\r | |
160 | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r | |
161 | IN EFI_HANDLE ControllerHandle,\r | |
162 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
163 | );\r | |
164 | \r | |
165 | /**\r | |
166 | Start this driver on ControllerHandle by opening a FV protocol and\r | |
167 | installing a SimpleFileSystem protocol on ControllerHandle.\r | |
168 | \r | |
169 | @param DriverBinding Protocol instance pointer.\r | |
170 | @param ControllerHandle Handle of device to bind driver to\r | |
171 | @param RemainingDevicePath Optional parameter use to pick a specific child\r | |
172 | device to start.\r | |
173 | \r | |
174 | @retval EFI_SUCCESS This driver is added to ControllerHandle\r | |
175 | @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r | |
176 | @retval other This driver does not support this device\r | |
177 | \r | |
178 | **/\r | |
179 | EFI_STATUS\r | |
180 | EFIAPI\r | |
181 | FvSimpleFileSystemDriverStart (\r | |
182 | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r | |
183 | IN EFI_HANDLE ControllerHandle,\r | |
184 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
185 | );\r | |
186 | \r | |
187 | /**\r | |
188 | Stop this driver on ControllerHandle by removing SimpleFileSystem protocol and closing\r | |
189 | the FV protocol on ControllerHandle.\r | |
190 | \r | |
191 | @param DriverBinding Protocol instance pointer.\r | |
192 | @param ControllerHandle Handle of device to stop driver on\r | |
193 | @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r | |
194 | children is zero stop the entire bus driver.\r | |
195 | @param ChildHandleBuffer List of Child Handles to Stop.\r | |
196 | \r | |
197 | @retval EFI_SUCCESS This driver is removed ControllerHandle\r | |
198 | @retval other This driver was not removed from this device\r | |
199 | \r | |
200 | **/\r | |
201 | EFI_STATUS\r | |
202 | EFIAPI\r | |
203 | FvSimpleFileSystemDriverStop (\r | |
204 | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r | |
205 | IN EFI_HANDLE ControllerHandle,\r | |
206 | IN UINTN NumberOfChildren,\r | |
207 | IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r | |
208 | );\r | |
209 | \r | |
210 | /**\r | |
211 | Opens a new file relative to the source file's location.\r | |
212 | \r | |
213 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
214 | handle to the source location. This would typically be an open\r | |
215 | handle to a directory.\r | |
216 | @param NewHandle A pointer to the location to return the opened handle for the new\r | |
217 | file.\r | |
218 | @param FileName The Null-terminated string of the name of the file to be opened.\r | |
219 | The file name may contain the following path modifiers: "\", ".",\r | |
220 | and "..".\r | |
221 | @param OpenMode The mode to open the file. The only valid combinations that the\r | |
222 | file may be opened with are: Read, Read/Write, or Create/Read/Write.\r | |
223 | @param Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the\r | |
224 | attribute bits for the newly created file.\r | |
225 | \r | |
226 | @retval EFI_SUCCESS The file was opened.\r | |
227 | @retval EFI_NOT_FOUND The specified file could not be found on the device.\r | |
228 | @retval EFI_NO_MEDIA The device has no medium.\r | |
229 | @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no\r | |
230 | longer supported.\r | |
231 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
232 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
233 | @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write\r | |
234 | when the media is write-protected.\r | |
235 | @retval EFI_ACCESS_DENIED The service denied access to the file.\r | |
236 | @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.\r | |
237 | @retval EFI_VOLUME_FULL The volume is full.\r | |
238 | \r | |
239 | **/\r | |
240 | EFI_STATUS\r | |
241 | EFIAPI\r | |
242 | FvSimpleFileSystemOpen (\r | |
243 | IN EFI_FILE_PROTOCOL *This,\r | |
244 | OUT EFI_FILE_PROTOCOL **NewHandle,\r | |
245 | IN CHAR16 *FileName,\r | |
246 | IN UINT64 OpenMode,\r | |
247 | IN UINT64 Attributes\r | |
248 | );\r | |
249 | \r | |
250 | /**\r | |
251 | Closes a specified file handle.\r | |
252 | \r | |
253 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
254 | handle to close.\r | |
255 | \r | |
256 | @retval EFI_SUCCESS The file was closed.\r | |
257 | \r | |
258 | **/\r | |
259 | EFI_STATUS\r | |
260 | EFIAPI\r | |
261 | FvSimpleFileSystemClose (\r | |
262 | IN EFI_FILE_PROTOCOL *This\r | |
263 | );\r | |
264 | \r | |
265 | /**\r | |
266 | Reads data from a file.\r | |
267 | \r | |
268 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
269 | handle to read data from.\r | |
270 | @param BufferSize On input, the size of the Buffer. On output, the amount of data\r | |
271 | returned in Buffer. In both cases, the size is measured in bytes.\r | |
272 | @param Buffer The buffer into which the data is read.\r | |
273 | \r | |
274 | @retval EFI_SUCCESS Data was read.\r | |
275 | @retval EFI_NO_MEDIA The device has no medium.\r | |
276 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
277 | @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file.\r | |
278 | @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file.\r | |
279 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
280 | @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory\r | |
281 | entry. BufferSize has been updated with the size\r | |
282 | needed to complete the request.\r | |
283 | \r | |
284 | **/\r | |
285 | EFI_STATUS\r | |
286 | EFIAPI\r | |
287 | FvSimpleFileSystemRead (\r | |
288 | IN EFI_FILE_PROTOCOL *This,\r | |
289 | IN OUT UINTN *BufferSize,\r | |
290 | OUT VOID *Buffer\r | |
291 | );\r | |
292 | \r | |
293 | /**\r | |
294 | Writes data to a file.\r | |
295 | \r | |
296 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
297 | handle to write data to.\r | |
298 | @param BufferSize On input, the size of the Buffer. On output, the amount of data\r | |
299 | actually written. In both cases, the size is measured in bytes.\r | |
300 | @param Buffer The buffer of data to write.\r | |
301 | \r | |
302 | @retval EFI_SUCCESS Data was written.\r | |
303 | @retval EFI_UNSUPPORTED Writes to open directory files are not supported.\r | |
304 | @retval EFI_NO_MEDIA The device has no medium.\r | |
305 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
306 | @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.\r | |
307 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
308 | @retval EFI_WRITE_PROTECTED The file or medium is write-protected.\r | |
309 | @retval EFI_ACCESS_DENIED The file was opened read only.\r | |
310 | @retval EFI_VOLUME_FULL The volume is full.\r | |
311 | \r | |
312 | **/\r | |
313 | EFI_STATUS\r | |
314 | EFIAPI\r | |
315 | FvSimpleFileSystemWrite (\r | |
316 | IN EFI_FILE_PROTOCOL *This,\r | |
317 | IN OUT UINTN *BufferSize,\r | |
318 | IN VOID *Buffer\r | |
319 | );\r | |
320 | \r | |
321 | /**\r | |
322 | Returns a file's current position.\r | |
323 | \r | |
324 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
325 | handle to get the current position on.\r | |
326 | @param Position The address to return the file's current position value.\r | |
327 | \r | |
328 | @retval EFI_SUCCESS The position was returned.\r | |
329 | @retval EFI_UNSUPPORTED The request is not valid on open directories.\r | |
330 | @retval EFI_DEVICE_ERROR An attempt was made to get the position from a deleted file.\r | |
331 | \r | |
332 | **/\r | |
333 | EFI_STATUS\r | |
334 | EFIAPI\r | |
335 | FvSimpleFileSystemGetPosition (\r | |
336 | IN EFI_FILE_PROTOCOL *This,\r | |
337 | OUT UINT64 *Position\r | |
338 | );\r | |
339 | \r | |
340 | /**\r | |
341 | Sets a file's current position.\r | |
342 | \r | |
343 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the\r | |
344 | file handle to set the requested position on.\r | |
345 | @param Position The byte position from the start of the file to set.\r | |
346 | \r | |
347 | @retval EFI_SUCCESS The position was set.\r | |
348 | @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open\r | |
349 | directories.\r | |
350 | @retval EFI_DEVICE_ERROR An attempt was made to set the position of a deleted file.\r | |
351 | \r | |
352 | **/\r | |
353 | EFI_STATUS\r | |
354 | EFIAPI\r | |
355 | FvSimpleFileSystemSetPosition (\r | |
356 | IN EFI_FILE_PROTOCOL *This,\r | |
357 | IN UINT64 Position\r | |
358 | );\r | |
359 | \r | |
360 | /**\r | |
361 | Flushes all modified data associated with a file to a device.\r | |
362 | \r | |
363 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
364 | handle to flush.\r | |
365 | \r | |
366 | @retval EFI_SUCCESS The data was flushed.\r | |
367 | @retval EFI_NO_MEDIA The device has no medium.\r | |
368 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
369 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
370 | @retval EFI_WRITE_PROTECTED The file or medium is write-protected.\r | |
371 | @retval EFI_ACCESS_DENIED The file was opened read-only.\r | |
372 | @retval EFI_VOLUME_FULL The volume is full.\r | |
373 | \r | |
374 | **/\r | |
375 | EFI_STATUS\r | |
376 | EFIAPI\r | |
377 | FvSimpleFileSystemFlush (\r | |
378 | IN EFI_FILE_PROTOCOL *This\r | |
379 | );\r | |
380 | \r | |
381 | /**\r | |
382 | Close and delete the file handle.\r | |
383 | \r | |
384 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the\r | |
385 | handle to the file to delete.\r | |
386 | \r | |
387 | @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.\r | |
388 | @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not deleted.\r | |
389 | \r | |
390 | **/\r | |
391 | EFI_STATUS\r | |
392 | EFIAPI\r | |
393 | FvSimpleFileSystemDelete (\r | |
394 | IN EFI_FILE_PROTOCOL *This\r | |
395 | );\r | |
396 | \r | |
397 | /**\r | |
398 | Returns information about a file.\r | |
399 | \r | |
400 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
401 | handle the requested information is for.\r | |
402 | @param InformationType The type identifier for the information being requested.\r | |
403 | @param BufferSize On input, the size of Buffer. On output, the amount of data\r | |
404 | returned in Buffer. In both cases, the size is measured in bytes.\r | |
405 | @param Buffer A pointer to the data buffer to return. The buffer's type is\r | |
406 | indicated by InformationType.\r | |
407 | \r | |
408 | @retval EFI_SUCCESS The information was returned.\r | |
409 | @retval EFI_UNSUPPORTED The InformationType is not known.\r | |
410 | @retval EFI_NO_MEDIA The device has no medium.\r | |
411 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
412 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
413 | @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.\r | |
414 | BufferSize has been updated with the size needed to complete\r | |
415 | the request.\r | |
416 | **/\r | |
417 | EFI_STATUS\r | |
418 | EFIAPI\r | |
419 | FvSimpleFileSystemGetInfo (\r | |
420 | IN EFI_FILE_PROTOCOL *This,\r | |
421 | IN EFI_GUID *InformationType,\r | |
422 | IN OUT UINTN *BufferSize,\r | |
423 | OUT VOID *Buffer\r | |
424 | );\r | |
425 | \r | |
426 | /**\r | |
427 | Sets information about a file.\r | |
428 | \r | |
429 | @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r | |
430 | handle the information is for.\r | |
431 | @param InformationType The type identifier for the information being set.\r | |
432 | @param BufferSize The size, in bytes, of Buffer.\r | |
433 | @param Buffer A pointer to the data buffer to write. The buffer's type is\r | |
434 | indicated by InformationType.\r | |
435 | \r | |
436 | @retval EFI_SUCCESS The information was set.\r | |
437 | @retval EFI_UNSUPPORTED The InformationType is not known.\r | |
438 | @retval EFI_NO_MEDIA The device has no medium.\r | |
439 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
440 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
441 | @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_INFO_ID and the media is\r | |
442 | read-only.\r | |
443 | @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_PROTOCOL_SYSTEM_INFO_ID\r | |
444 | and the media is read only.\r | |
445 | @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_SYSTEM_VOLUME_LABEL_ID\r | |
446 | and the media is read-only.\r | |
447 | @retval EFI_ACCESS_DENIED An attempt is made to change the name of a file to a\r | |
448 | file that is already present.\r | |
449 | @retval EFI_ACCESS_DENIED An attempt is being made to change the EFI_FILE_DIRECTORY\r | |
450 | Attribute.\r | |
451 | @retval EFI_ACCESS_DENIED An attempt is being made to change the size of a directory.\r | |
452 | @retval EFI_ACCESS_DENIED InformationType is EFI_FILE_INFO_ID and the file was opened\r | |
453 | read-only and an attempt is being made to modify a field\r | |
454 | other than Attribute.\r | |
455 | @retval EFI_VOLUME_FULL The volume is full.\r | |
456 | @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of the type indicated\r | |
457 | by InformationType.\r | |
458 | \r | |
459 | **/\r | |
460 | EFI_STATUS\r | |
461 | EFIAPI\r | |
462 | FvSimpleFileSystemSetInfo (\r | |
463 | IN EFI_FILE_PROTOCOL *This,\r | |
464 | IN EFI_GUID *InformationType,\r | |
465 | IN UINTN BufferSize,\r | |
466 | IN VOID *Buffer\r | |
467 | );\r | |
468 | \r | |
469 | /**\r | |
470 | Get the size of the buffer that will be returned by FvFsReadFile.\r | |
471 | \r | |
472 | @param FvProtocol A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.\r | |
473 | @param FvFileInfo A pointer to the FV_FILESYSTEM_FILE_INFO instance that is a struct\r | |
474 | representing a file's info.\r | |
475 | \r | |
476 | @retval EFI_SUCCESS The file size was gotten correctly.\r | |
477 | @retval Others The file size wasn't gotten correctly.\r | |
478 | \r | |
479 | **/\r | |
480 | EFI_STATUS\r | |
481 | FvFsGetFileSize (\r | |
482 | IN EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol,\r | |
483 | IN OUT FV_FILESYSTEM_FILE_INFO *FvFileInfo\r | |
484 | );\r | |
485 | \r | |
486 | /**\r | |
487 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
488 | \r | |
489 | This function retrieves the user readable name of a driver in the form of a\r | |
490 | Unicode string. If the driver specified by This has a user readable name in\r | |
491 | the language specified by Language, then a pointer to the driver name is\r | |
492 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
493 | by This does not support the language specified by Language,\r | |
494 | then EFI_UNSUPPORTED is returned.\r | |
495 | \r | |
496 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
497 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
498 | \r | |
499 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
500 | array indicating the language. This is the\r | |
501 | language of the driver name that the caller is\r | |
502 | requesting, and it must match one of the\r | |
503 | languages specified in SupportedLanguages. The\r | |
504 | number of languages supported by a driver is up\r | |
505 | to the driver writer. Language is specified\r | |
506 | in RFC 4646 or ISO 639-2 language code format.\r | |
507 | \r | |
508 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
509 | This Unicode string is the name of the\r | |
510 | driver specified by This in the language\r | |
511 | specified by Language.\r | |
512 | \r | |
513 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
514 | This and the language specified by Language was\r | |
515 | returned in DriverName.\r | |
516 | \r | |
517 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
518 | \r | |
519 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
520 | \r | |
521 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
522 | the language specified by Language.\r | |
523 | \r | |
524 | **/\r | |
525 | EFI_STATUS\r | |
526 | EFIAPI\r | |
527 | FvSimpleFileSystemComponentNameGetDriverName (\r | |
528 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
529 | IN CHAR8 *Language,\r | |
530 | OUT CHAR16 **DriverName\r | |
531 | );\r | |
532 | \r | |
533 | /**\r | |
534 | Retrieves a Unicode string that is the user readable name of the controller\r | |
535 | that is being managed by a driver.\r | |
536 | \r | |
537 | This function retrieves the user readable name of the controller specified by\r | |
538 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
539 | driver specified by This has a user readable name in the language specified by\r | |
540 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
541 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
542 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
543 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
544 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
545 | \r | |
546 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
547 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
548 | \r | |
549 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
550 | specified by This is managing. This handle\r | |
551 | specifies the controller whose name is to be\r | |
552 | returned.\r | |
553 | \r | |
554 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
555 | the name of. This is an optional parameter that\r | |
556 | may be NULL. It will be NULL for device\r | |
557 | drivers. It will also be NULL for a bus drivers\r | |
558 | that wish to retrieve the name of the bus\r | |
559 | controller. It will not be NULL for a bus\r | |
560 | driver that wishes to retrieve the name of a\r | |
561 | child controller.\r | |
562 | \r | |
563 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
564 | array indicating the language. This is the\r | |
565 | language of the driver name that the caller is\r | |
566 | requesting, and it must match one of the\r | |
567 | languages specified in SupportedLanguages. The\r | |
568 | number of languages supported by a driver is up\r | |
569 | to the driver writer. Language is specified in\r | |
570 | RFC 4646 or ISO 639-2 language code format.\r | |
571 | \r | |
572 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
573 | This Unicode string is the name of the\r | |
574 | controller specified by ControllerHandle and\r | |
575 | ChildHandle in the language specified by\r | |
576 | Language from the point of view of the driver\r | |
577 | specified by This.\r | |
578 | \r | |
579 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
580 | the language specified by Language for the\r | |
581 | driver specified by This was returned in\r | |
582 | DriverName.\r | |
583 | \r | |
584 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r | |
585 | \r | |
586 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
587 | EFI_HANDLE.\r | |
588 | \r | |
589 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
590 | \r | |
591 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
592 | \r | |
593 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
594 | managing the controller specified by\r | |
595 | ControllerHandle and ChildHandle.\r | |
596 | \r | |
597 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
598 | the language specified by Language.\r | |
599 | \r | |
600 | **/\r | |
601 | EFI_STATUS\r | |
602 | EFIAPI\r | |
603 | FvSimpleFileSystemComponentNameGetControllerName (\r | |
604 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
605 | IN EFI_HANDLE ControllerHandle,\r | |
606 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
607 | IN CHAR8 *Language,\r | |
608 | OUT CHAR16 **ControllerName\r | |
609 | );\r | |
610 | \r | |
611 | extern EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollation;\r | |
612 | extern EFI_FILE_PROTOCOL mFileSystemTemplate;\r | |
613 | extern EFI_COMPONENT_NAME_PROTOCOL gFvSimpleFileSystemComponentName;\r | |
614 | extern EFI_COMPONENT_NAME2_PROTOCOL gFvSimpleFileSystemComponentName2;\r | |
615 | \r | |
92141e17 | 616 | #endif\r |