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