]>
Commit | Line | Data |
---|---|---|
1 | /*++\r | |
2 | \r | |
3 | Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r | |
4 | This program and the accompanying materials are licensed and made available\r | |
5 | under the terms and conditions of the BSD License which accompanies this\r | |
6 | distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | Fat.h\r | |
16 | \r | |
17 | Abstract:\r | |
18 | \r | |
19 | Main header file for EFI FAT file system driver\r | |
20 | \r | |
21 | Revision History\r | |
22 | \r | |
23 | --*/\r | |
24 | \r | |
25 | #ifndef _FAT_H_\r | |
26 | #define _FAT_H_\r | |
27 | \r | |
28 | #include <Uefi.h>\r | |
29 | \r | |
30 | #include <Guid/FileInfo.h>\r | |
31 | #include <Guid/FileSystemInfo.h>\r | |
32 | #include <Guid/FileSystemVolumeLabelInfo.h>\r | |
33 | #include <Protocol/BlockIo.h>\r | |
34 | #include <Protocol/DiskIo.h>\r | |
35 | #include <Protocol/DiskIo2.h>\r | |
36 | #include <Protocol/SimpleFileSystem.h>\r | |
37 | #include <Protocol/UnicodeCollation.h>\r | |
38 | \r | |
39 | #include <Library/PcdLib.h>\r | |
40 | #include <Library/DebugLib.h>\r | |
41 | #include <Library/UefiLib.h>\r | |
42 | #include <Library/BaseLib.h>\r | |
43 | #include <Library/BaseMemoryLib.h>\r | |
44 | #include <Library/MemoryAllocationLib.h>\r | |
45 | #include <Library/UefiDriverEntryPoint.h>\r | |
46 | #include <Library/UefiBootServicesTableLib.h>\r | |
47 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
48 | \r | |
49 | #include "FatFileSystem.h"\r | |
50 | \r | |
51 | //\r | |
52 | // The FAT signature\r | |
53 | //\r | |
54 | #define FAT_VOLUME_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'v')\r | |
55 | #define FAT_IFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'i')\r | |
56 | #define FAT_ODIR_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'd')\r | |
57 | #define FAT_DIRENT_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'e')\r | |
58 | #define FAT_OFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'o')\r | |
59 | #define FAT_TASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'T')\r | |
60 | #define FAT_SUBTASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'S')\r | |
61 | \r | |
62 | #define ASSERT_VOLUME_LOCKED(a) ASSERT_LOCKED (&FatFsLock)\r | |
63 | \r | |
64 | #define IFILE_FROM_FHAND(a) CR (a, FAT_IFILE, Handle, FAT_IFILE_SIGNATURE)\r | |
65 | \r | |
66 | #define DIRENT_FROM_LINK(a) CR (a, FAT_DIRENT, Link, FAT_DIRENT_SIGNATURE)\r | |
67 | \r | |
68 | #define VOLUME_FROM_ROOT_DIRENT(a) CR (a, FAT_VOLUME, RootDirEnt, FAT_VOLUME_SIGNATURE)\r | |
69 | \r | |
70 | #define VOLUME_FROM_VOL_INTERFACE(a) CR (a, FAT_VOLUME, VolumeInterface, FAT_VOLUME_SIGNATURE);\r | |
71 | \r | |
72 | #define ODIR_FROM_DIRCACHELINK(a) CR (a, FAT_ODIR, DirCacheLink, FAT_ODIR_SIGNATURE)\r | |
73 | \r | |
74 | #define OFILE_FROM_CHECKLINK(a) CR (a, FAT_OFILE, CheckLink, FAT_OFILE_SIGNATURE)\r | |
75 | \r | |
76 | #define OFILE_FROM_CHILDLINK(a) CR (a, FAT_OFILE, ChildLink, FAT_OFILE_SIGNATURE)\r | |
77 | \r | |
78 | //\r | |
79 | // Minimum sector size is 512B, Maximum sector size is 4096B\r | |
80 | // Max sectors per cluster is 128\r | |
81 | //\r | |
82 | #define MAX_BLOCK_ALIGNMENT 12\r | |
83 | #define MIN_BLOCK_ALIGNMENT 9\r | |
84 | #define MAX_SECTORS_PER_CLUSTER_ALIGNMENT 7\r | |
85 | \r | |
86 | //\r | |
87 | // Efi Time Definition\r | |
88 | //\r | |
89 | #define IS_LEAP_YEAR(a) (((a) % 4 == 0) && (((a) % 100 != 0) || ((a) % 400 == 0)))\r | |
90 | \r | |
91 | //\r | |
92 | // Minimum fat page size is 8K, maximum fat page alignment is 32K\r | |
93 | // Minimum data page size is 8K, maximum fat page alignment is 64K\r | |
94 | //\r | |
95 | #define FAT_FATCACHE_PAGE_MIN_ALIGNMENT 13\r | |
96 | #define FAT_FATCACHE_PAGE_MAX_ALIGNMENT 15\r | |
97 | #define FAT_DATACACHE_PAGE_MIN_ALIGNMENT 13\r | |
98 | #define FAT_DATACACHE_PAGE_MAX_ALIGNMENT 16\r | |
99 | #define FAT_DATACACHE_GROUP_COUNT 64\r | |
100 | #define FAT_FATCACHE_GROUP_MIN_COUNT 1\r | |
101 | #define FAT_FATCACHE_GROUP_MAX_COUNT 16\r | |
102 | \r | |
103 | //\r | |
104 | // Used in 8.3 generation algorithm\r | |
105 | //\r | |
106 | #define MAX_SPEC_RETRY 4\r | |
107 | #define SPEC_BASE_TAG_LEN 6\r | |
108 | #define HASH_BASE_TAG_LEN 2\r | |
109 | #define HASH_VALUE_TAG_LEN (SPEC_BASE_TAG_LEN - HASH_BASE_TAG_LEN)\r | |
110 | \r | |
111 | //\r | |
112 | // Path name separator is back slash\r | |
113 | //\r | |
114 | #define PATH_NAME_SEPARATOR L'\\'\r | |
115 | \r | |
116 | \r | |
117 | #define EFI_PATH_STRING_LENGTH 260\r | |
118 | #define EFI_FILE_STRING_LENGTH 255\r | |
119 | #define FAT_MAX_ALLOCATE_SIZE 0xA00000\r | |
120 | #define LC_ISO_639_2_ENTRY_SIZE 3\r | |
121 | #define MAX_LANG_CODE_SIZE 100\r | |
122 | \r | |
123 | #define FAT_MAX_DIR_CACHE_COUNT 8\r | |
124 | #define FAT_MAX_DIRENTRY_COUNT 0xFFFF\r | |
125 | typedef CHAR8 LC_ISO_639_2;\r | |
126 | \r | |
127 | //\r | |
128 | // The fat types we support\r | |
129 | //\r | |
130 | typedef enum {\r | |
131 | FAT12,\r | |
132 | FAT16,\r | |
133 | FAT32,\r | |
134 | FatUndefined\r | |
135 | } FAT_VOLUME_TYPE;\r | |
136 | \r | |
137 | typedef enum {\r | |
138 | CACHE_FAT,\r | |
139 | CACHE_DATA,\r | |
140 | CACHE_MAX_TYPE\r | |
141 | } CACHE_DATA_TYPE;\r | |
142 | \r | |
143 | //\r | |
144 | // Used in FatDiskIo\r | |
145 | //\r | |
146 | typedef enum {\r | |
147 | READ_DISK = 0, // raw disk read\r | |
148 | WRITE_DISK = 1, // raw disk write\r | |
149 | READ_FAT = 2, // read fat cache\r | |
150 | WRITE_FAT = 3, // write fat cache\r | |
151 | READ_DATA = 6, // read data cache\r | |
152 | WRITE_DATA = 7 // write data cache\r | |
153 | } IO_MODE;\r | |
154 | \r | |
155 | #define CACHE_ENABLED(a) ((a) >= 2)\r | |
156 | #define RAW_ACCESS(a) ((IO_MODE)((a) & 0x1))\r | |
157 | #define CACHE_TYPE(a) ((CACHE_DATA_TYPE)((a) >> 2))\r | |
158 | \r | |
159 | //\r | |
160 | // Disk cache tag\r | |
161 | //\r | |
162 | typedef struct {\r | |
163 | UINTN PageNo;\r | |
164 | UINTN RealSize;\r | |
165 | BOOLEAN Dirty;\r | |
166 | } CACHE_TAG;\r | |
167 | \r | |
168 | typedef struct {\r | |
169 | UINT64 BaseAddress;\r | |
170 | UINT64 LimitAddress;\r | |
171 | UINT8 *CacheBase;\r | |
172 | BOOLEAN Dirty;\r | |
173 | UINT8 PageAlignment;\r | |
174 | UINTN GroupMask;\r | |
175 | CACHE_TAG CacheTag[FAT_DATACACHE_GROUP_COUNT];\r | |
176 | } DISK_CACHE;\r | |
177 | \r | |
178 | //\r | |
179 | // Hash table size\r | |
180 | //\r | |
181 | #define HASH_TABLE_SIZE 0x400\r | |
182 | #define HASH_TABLE_MASK (HASH_TABLE_SIZE - 1)\r | |
183 | \r | |
184 | //\r | |
185 | // The directory entry for opened directory\r | |
186 | //\r | |
187 | typedef struct _FAT_DIRENT {\r | |
188 | UINTN Signature;\r | |
189 | UINT16 EntryPos; // The position of this directory entry in the parent directory file\r | |
190 | UINT8 EntryCount; // The count of the directory entry in the parent directory file\r | |
191 | BOOLEAN Invalid; // Indicate whether this directory entry is valid\r | |
192 | CHAR16 *FileString; // The unicode long file name for this directory entry\r | |
193 | struct _FAT_OFILE *OFile; // The OFile of the corresponding directory entry\r | |
194 | struct _FAT_DIRENT *ShortNameForwardLink; // Hash successor link for short filename\r | |
195 | struct _FAT_DIRENT *LongNameForwardLink; // Hash successor link for long filename\r | |
196 | LIST_ENTRY Link; // Connection of every directory entry\r | |
197 | FAT_DIRECTORY_ENTRY Entry; // The physical directory entry stored in disk\r | |
198 | } FAT_DIRENT;\r | |
199 | \r | |
200 | typedef struct _FAT_ODIR {\r | |
201 | UINTN Signature;\r | |
202 | UINT32 CurrentEndPos; // Current end position of the directory\r | |
203 | UINT32 CurrentPos; // Current position of the directory\r | |
204 | LIST_ENTRY *CurrentCursor; // Current directory entry pointer\r | |
205 | LIST_ENTRY ChildList; // List of all directory entries\r | |
206 | BOOLEAN EndOfDir; // Indicate whether we have reached the end of the directory\r | |
207 | LIST_ENTRY DirCacheLink; // Linked in Volume->DirCacheList when discarded\r | |
208 | UINTN DirCacheTag; // The identification of the directory when in directory cache\r | |
209 | FAT_DIRENT *LongNameHashTable[HASH_TABLE_SIZE];\r | |
210 | FAT_DIRENT *ShortNameHashTable[HASH_TABLE_SIZE];\r | |
211 | } FAT_ODIR;\r | |
212 | \r | |
213 | typedef struct {\r | |
214 | UINTN Signature;\r | |
215 | EFI_FILE_PROTOCOL Handle;\r | |
216 | UINT64 Position;\r | |
217 | BOOLEAN ReadOnly;\r | |
218 | struct _FAT_OFILE *OFile;\r | |
219 | LIST_ENTRY Tasks; // List of all FAT_TASKs\r | |
220 | LIST_ENTRY Link; // Link to other IFiles\r | |
221 | } FAT_IFILE;\r | |
222 | \r | |
223 | typedef struct {\r | |
224 | UINTN Signature;\r | |
225 | EFI_FILE_IO_TOKEN *FileIoToken;\r | |
226 | FAT_IFILE *IFile;\r | |
227 | LIST_ENTRY Subtasks; // List of all FAT_SUBTASKs\r | |
228 | LIST_ENTRY Link; // Link to other FAT_TASKs\r | |
229 | } FAT_TASK;\r | |
230 | \r | |
231 | typedef struct {\r | |
232 | UINTN Signature;\r | |
233 | EFI_DISK_IO2_TOKEN DiskIo2Token;\r | |
234 | FAT_TASK *Task;\r | |
235 | BOOLEAN Write;\r | |
236 | UINT64 Offset;\r | |
237 | VOID *Buffer;\r | |
238 | UINTN BufferSize;\r | |
239 | LIST_ENTRY Link;\r | |
240 | } FAT_SUBTASK;\r | |
241 | \r | |
242 | //\r | |
243 | // FAT_OFILE - Each opened file\r | |
244 | //\r | |
245 | typedef struct _FAT_OFILE {\r | |
246 | UINTN Signature;\r | |
247 | struct _FAT_VOLUME *Volume;\r | |
248 | //\r | |
249 | // A permanant error code to return to all accesses to\r | |
250 | // this opened file\r | |
251 | //\r | |
252 | EFI_STATUS Error;\r | |
253 | //\r | |
254 | // A list of the IFILE instances for this OFile\r | |
255 | //\r | |
256 | LIST_ENTRY Opens;\r | |
257 | \r | |
258 | //\r | |
259 | // The dynamic infomation\r | |
260 | //\r | |
261 | UINTN FileSize;\r | |
262 | UINTN FileCluster;\r | |
263 | UINTN FileCurrentCluster;\r | |
264 | UINTN FileLastCluster;\r | |
265 | \r | |
266 | //\r | |
267 | // Dirty is set if there have been any updates to the\r | |
268 | // file\r | |
269 | // Archive is set if the archive attribute in the file's\r | |
270 | // directory entry needs to be set when performing flush\r | |
271 | // PreserveLastMod is set if the last modification of the\r | |
272 | // file is specified by SetInfo API\r | |
273 | //\r | |
274 | BOOLEAN Dirty;\r | |
275 | BOOLEAN IsFixedRootDir;\r | |
276 | BOOLEAN PreserveLastModification;\r | |
277 | BOOLEAN Archive;\r | |
278 | //\r | |
279 | // Set by an OFile SetPosition\r | |
280 | //\r | |
281 | UINTN Position; // within file\r | |
282 | UINT64 PosDisk; // on the disk\r | |
283 | UINTN PosRem; // remaining in this disk run\r | |
284 | //\r | |
285 | // The opened parent, full path length and currently opened child files\r | |
286 | //\r | |
287 | struct _FAT_OFILE *Parent;\r | |
288 | UINTN FullPathLen;\r | |
289 | LIST_ENTRY ChildHead;\r | |
290 | LIST_ENTRY ChildLink;\r | |
291 | \r | |
292 | //\r | |
293 | // The opened directory structure for a directory; if this\r | |
294 | // OFile represents a file, then ODir = NULL\r | |
295 | //\r | |
296 | FAT_ODIR *ODir;\r | |
297 | //\r | |
298 | // The directory entry for the Ofile\r | |
299 | //\r | |
300 | FAT_DIRENT *DirEnt;\r | |
301 | \r | |
302 | //\r | |
303 | // Link in Volume's reference list\r | |
304 | //\r | |
305 | LIST_ENTRY CheckLink;\r | |
306 | } FAT_OFILE;\r | |
307 | \r | |
308 | typedef struct _FAT_VOLUME {\r | |
309 | UINTN Signature;\r | |
310 | \r | |
311 | EFI_HANDLE Handle;\r | |
312 | BOOLEAN Valid;\r | |
313 | BOOLEAN DiskError;\r | |
314 | \r | |
315 | EFI_SIMPLE_FILE_SYSTEM_PROTOCOL VolumeInterface;\r | |
316 | \r | |
317 | //\r | |
318 | // If opened, the parent handle and BlockIo interface\r | |
319 | //\r | |
320 | EFI_BLOCK_IO_PROTOCOL *BlockIo;\r | |
321 | EFI_DISK_IO_PROTOCOL *DiskIo;\r | |
322 | EFI_DISK_IO2_PROTOCOL *DiskIo2;\r | |
323 | UINT32 MediaId;\r | |
324 | BOOLEAN ReadOnly;\r | |
325 | \r | |
326 | //\r | |
327 | // Computed values from fat bpb info\r | |
328 | //\r | |
329 | UINT64 VolumeSize;\r | |
330 | UINT64 FatPos; // Disk pos of fat tables\r | |
331 | UINT64 RootPos; // Disk pos of root directory\r | |
332 | UINT64 FirstClusterPos; // Disk pos of first cluster\r | |
333 | UINTN FatSize; // Number of bytes in each fat\r | |
334 | UINTN MaxCluster; // Max cluster number\r | |
335 | UINTN ClusterSize; // Cluster size of fat partition\r | |
336 | UINT8 ClusterAlignment; // Equal to log_2 (clustersize);\r | |
337 | FAT_VOLUME_TYPE FatType;\r | |
338 | \r | |
339 | //\r | |
340 | // Current part of fat table that's present\r | |
341 | //\r | |
342 | UINT64 FatEntryPos; // Location of buffer\r | |
343 | UINTN FatEntrySize; // Size of buffer\r | |
344 | UINT32 FatEntryBuffer; // The buffer\r | |
345 | FAT_INFO_SECTOR FatInfoSector; // Free cluster info\r | |
346 | UINTN FreeInfoPos; // Pos with the free cluster info\r | |
347 | BOOLEAN FreeInfoValid; // If free cluster info is valid\r | |
348 | //\r | |
349 | // Unpacked Fat BPB info\r | |
350 | //\r | |
351 | UINTN NumFats;\r | |
352 | UINTN RootEntries; // < FAT32, root dir is fixed size\r | |
353 | UINTN RootCluster; // >= FAT32, root cluster chain head\r | |
354 | //\r | |
355 | // info for marking the volume dirty or not\r | |
356 | //\r | |
357 | BOOLEAN FatDirty; // If fat-entries have been updated\r | |
358 | UINT32 DirtyValue;\r | |
359 | UINT32 NotDirtyValue;\r | |
360 | \r | |
361 | //\r | |
362 | // The root directory entry and opened root file\r | |
363 | //\r | |
364 | FAT_DIRENT RootDirEnt;\r | |
365 | //\r | |
366 | // File Name of root OFile, it is empty string\r | |
367 | //\r | |
368 | CHAR16 RootFileString[1];\r | |
369 | struct _FAT_OFILE *Root;\r | |
370 | \r | |
371 | //\r | |
372 | // New OFiles are added to this list so they\r | |
373 | // can be cleaned up if they aren't referenced.\r | |
374 | //\r | |
375 | LIST_ENTRY CheckRef;\r | |
376 | \r | |
377 | //\r | |
378 | // Directory cache List\r | |
379 | //\r | |
380 | LIST_ENTRY DirCacheList;\r | |
381 | UINTN DirCacheCount;\r | |
382 | \r | |
383 | //\r | |
384 | // Disk Cache for this volume\r | |
385 | //\r | |
386 | VOID *CacheBuffer;\r | |
387 | DISK_CACHE DiskCache[CACHE_MAX_TYPE];\r | |
388 | } FAT_VOLUME;\r | |
389 | \r | |
390 | //\r | |
391 | // Function Prototypes\r | |
392 | //\r | |
393 | EFI_STATUS\r | |
394 | EFIAPI\r | |
395 | FatOpen (\r | |
396 | IN EFI_FILE_PROTOCOL *FHand,\r | |
397 | OUT EFI_FILE_PROTOCOL **NewHandle,\r | |
398 | IN CHAR16 *FileName,\r | |
399 | IN UINT64 OpenMode,\r | |
400 | IN UINT64 Attributes\r | |
401 | )\r | |
402 | /*++\r | |
403 | Routine Description:\r | |
404 | \r | |
405 | Implements Open() of Simple File System Protocol.\r | |
406 | \r | |
407 | Arguments:\r | |
408 | \r | |
409 | FHand - File handle of the file serves as a starting reference point.\r | |
410 | NewHandle - Handle of the file that is newly opened.\r | |
411 | FileName - File name relative to FHand.\r | |
412 | OpenMode - Open mode.\r | |
413 | Attributes - Attributes to set if the file is created.\r | |
414 | \r | |
415 | Returns:\r | |
416 | \r | |
417 | EFI_INVALID_PARAMETER - The FileName is NULL or the file string is empty.\r | |
418 | The OpenMode is not supported.\r | |
419 | The Attributes is not the valid attributes.\r | |
420 | EFI_OUT_OF_RESOURCES - Can not allocate the memory for file string.\r | |
421 | EFI_SUCCESS - Open the file successfully.\r | |
422 | Others - The status of open file.\r | |
423 | \r | |
424 | --*/\r | |
425 | ;\r | |
426 | \r | |
427 | EFI_STATUS\r | |
428 | EFIAPI\r | |
429 | FatOpenEx (\r | |
430 | IN EFI_FILE_PROTOCOL *FHand,\r | |
431 | OUT EFI_FILE_PROTOCOL **NewHandle,\r | |
432 | IN CHAR16 *FileName,\r | |
433 | IN UINT64 OpenMode,\r | |
434 | IN UINT64 Attributes,\r | |
435 | IN OUT EFI_FILE_IO_TOKEN *Token\r | |
436 | )\r | |
437 | /*++\r | |
438 | Routine Description:\r | |
439 | \r | |
440 | Implements OpenEx() of Simple File System Protocol.\r | |
441 | \r | |
442 | Arguments:\r | |
443 | \r | |
444 | FHand - File handle of the file serves as a starting reference point.\r | |
445 | NewHandle - Handle of the file that is newly opened.\r | |
446 | FileName - File name relative to FHand.\r | |
447 | OpenMode - Open mode.\r | |
448 | Attributes - Attributes to set if the file is created.\r | |
449 | Token - A pointer to the token associated with the transaction.\r | |
450 | \r | |
451 | Returns:\r | |
452 | \r | |
453 | EFI_INVALID_PARAMETER - The FileName is NULL or the file string is empty.\r | |
454 | The OpenMode is not supported.\r | |
455 | The Attributes is not the valid attributes.\r | |
456 | EFI_OUT_OF_RESOURCES - Can not allocate the memory for file string.\r | |
457 | EFI_SUCCESS - Open the file successfully.\r | |
458 | Others - The status of open file.\r | |
459 | \r | |
460 | --*/\r | |
461 | ;\r | |
462 | \r | |
463 | EFI_STATUS\r | |
464 | EFIAPI\r | |
465 | FatGetPosition (\r | |
466 | IN EFI_FILE_PROTOCOL *FHand,\r | |
467 | OUT UINT64 *Position\r | |
468 | )\r | |
469 | /*++\r | |
470 | \r | |
471 | Routine Description:\r | |
472 | \r | |
473 | Get the file's position of the file\r | |
474 | \r | |
475 | Arguments:\r | |
476 | \r | |
477 | FHand - The handle of file.\r | |
478 | Position - The file's position of the file.\r | |
479 | \r | |
480 | Returns:\r | |
481 | \r | |
482 | EFI_SUCCESS - Get the info successfully.\r | |
483 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
484 | EFI_UNSUPPORTED - The open file is not a file.\r | |
485 | \r | |
486 | --*/\r | |
487 | ;\r | |
488 | \r | |
489 | EFI_STATUS\r | |
490 | EFIAPI\r | |
491 | FatGetInfo (\r | |
492 | IN EFI_FILE_PROTOCOL *FHand,\r | |
493 | IN EFI_GUID *Type,\r | |
494 | IN OUT UINTN *BufferSize,\r | |
495 | OUT VOID *Buffer\r | |
496 | )\r | |
497 | /*++\r | |
498 | \r | |
499 | Routine Description:\r | |
500 | \r | |
501 | Get the some types info of the file into Buffer\r | |
502 | \r | |
503 | Arguments:\r | |
504 | \r | |
505 | FHand - The handle of file.\r | |
506 | Type - The type of the info.\r | |
507 | BufferSize - Size of Buffer.\r | |
508 | Buffer - Buffer containing volume info.\r | |
509 | \r | |
510 | Returns:\r | |
511 | \r | |
512 | EFI_SUCCESS - Get the info successfully.\r | |
513 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
514 | \r | |
515 | --*/\r | |
516 | ;\r | |
517 | \r | |
518 | EFI_STATUS\r | |
519 | EFIAPI\r | |
520 | FatSetInfo (\r | |
521 | IN EFI_FILE_PROTOCOL *FHand,\r | |
522 | IN EFI_GUID *Type,\r | |
523 | IN UINTN BufferSize,\r | |
524 | IN VOID *Buffer\r | |
525 | )\r | |
526 | /*++\r | |
527 | \r | |
528 | Routine Description:\r | |
529 | \r | |
530 | Set the some types info of the file into Buffer\r | |
531 | \r | |
532 | Arguments:\r | |
533 | \r | |
534 | FHand - The handle of file.\r | |
535 | Type - The type of the info.\r | |
536 | BufferSize - Size of Buffer.\r | |
537 | Buffer - Buffer containing volume info.\r | |
538 | \r | |
539 | Returns:\r | |
540 | \r | |
541 | EFI_SUCCESS - Set the info successfully.\r | |
542 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
543 | \r | |
544 | --*/\r | |
545 | ;\r | |
546 | \r | |
547 | EFI_STATUS\r | |
548 | EFIAPI\r | |
549 | FatFlush (\r | |
550 | IN EFI_FILE_PROTOCOL *FHand\r | |
551 | )\r | |
552 | /*++\r | |
553 | \r | |
554 | Routine Description:\r | |
555 | \r | |
556 | Flushes all data associated with the file handle\r | |
557 | \r | |
558 | Arguments:\r | |
559 | \r | |
560 | FHand - Handle to file to flush\r | |
561 | \r | |
562 | Returns:\r | |
563 | \r | |
564 | EFI_SUCCESS - Flushed the file successfully\r | |
565 | EFI_WRITE_PROTECTED - The volume is read only\r | |
566 | EFI_ACCESS_DENIED - The volume is not read only\r | |
567 | but the file is read only\r | |
568 | Others - Flushing of the file is failed\r | |
569 | \r | |
570 | --*/\r | |
571 | ;\r | |
572 | \r | |
573 | EFI_STATUS\r | |
574 | EFIAPI\r | |
575 | FatFlushEx (\r | |
576 | IN EFI_FILE_PROTOCOL *FHand,\r | |
577 | IN EFI_FILE_IO_TOKEN *Token\r | |
578 | )\r | |
579 | /*++\r | |
580 | \r | |
581 | Routine Description:\r | |
582 | \r | |
583 | Flushes all data associated with the file handle.\r | |
584 | \r | |
585 | Arguments:\r | |
586 | \r | |
587 | FHand - Handle to file to flush.\r | |
588 | Token - A pointer to the token associated with the transaction.\r | |
589 | \r | |
590 | Returns:\r | |
591 | \r | |
592 | EFI_SUCCESS - Flushed the file successfully.\r | |
593 | EFI_WRITE_PROTECTED - The volume is read only.\r | |
594 | EFI_ACCESS_DENIED - The file is read only.\r | |
595 | Others - Flushing of the file failed.\r | |
596 | \r | |
597 | --*/\r | |
598 | ;\r | |
599 | \r | |
600 | EFI_STATUS\r | |
601 | EFIAPI\r | |
602 | FatClose (\r | |
603 | IN EFI_FILE_PROTOCOL *FHand\r | |
604 | )\r | |
605 | /*++\r | |
606 | \r | |
607 | Routine Description:\r | |
608 | \r | |
609 | Flushes & Closes the file handle.\r | |
610 | \r | |
611 | Arguments:\r | |
612 | \r | |
613 | FHand - Handle to the file to delete.\r | |
614 | \r | |
615 | Returns:\r | |
616 | \r | |
617 | EFI_SUCCESS - Closed the file successfully.\r | |
618 | \r | |
619 | --*/\r | |
620 | ;\r | |
621 | \r | |
622 | EFI_STATUS\r | |
623 | EFIAPI\r | |
624 | FatDelete (\r | |
625 | IN EFI_FILE_PROTOCOL *FHand\r | |
626 | )\r | |
627 | /*++\r | |
628 | \r | |
629 | Routine Description:\r | |
630 | \r | |
631 | Deletes the file & Closes the file handle.\r | |
632 | \r | |
633 | Arguments:\r | |
634 | \r | |
635 | FHand - Handle to the file to delete.\r | |
636 | \r | |
637 | Returns:\r | |
638 | \r | |
639 | EFI_SUCCESS - Delete the file successfully.\r | |
640 | EFI_WARN_DELETE_FAILURE - Fail to delete the file.\r | |
641 | \r | |
642 | --*/\r | |
643 | ;\r | |
644 | \r | |
645 | EFI_STATUS\r | |
646 | EFIAPI\r | |
647 | FatSetPosition (\r | |
648 | IN EFI_FILE_PROTOCOL *FHand,\r | |
649 | IN UINT64 Position\r | |
650 | )\r | |
651 | /*++\r | |
652 | \r | |
653 | Routine Description:\r | |
654 | \r | |
655 | Set the file's position of the file\r | |
656 | \r | |
657 | Arguments:\r | |
658 | \r | |
659 | FHand - The handle of file\r | |
660 | Position - The file's position of the file\r | |
661 | \r | |
662 | Returns:\r | |
663 | \r | |
664 | EFI_SUCCESS - Set the info successfully\r | |
665 | EFI_DEVICE_ERROR - Can not find the OFile for the file\r | |
666 | EFI_UNSUPPORTED - Set a directory with a not-zero position\r | |
667 | \r | |
668 | --*/\r | |
669 | ;\r | |
670 | \r | |
671 | EFI_STATUS\r | |
672 | EFIAPI\r | |
673 | FatRead (\r | |
674 | IN EFI_FILE_PROTOCOL *FHand,\r | |
675 | IN OUT UINTN *BufferSize,\r | |
676 | OUT VOID *Buffer\r | |
677 | )\r | |
678 | /*++\r | |
679 | \r | |
680 | Routine Description:\r | |
681 | \r | |
682 | Get the file info.\r | |
683 | \r | |
684 | Arguments:\r | |
685 | \r | |
686 | FHand - The handle of the file.\r | |
687 | BufferSize - Size of Buffer.\r | |
688 | Buffer - Buffer containing read data.\r | |
689 | \r | |
690 | Returns:\r | |
691 | \r | |
692 | EFI_SUCCESS - Get the file info successfully.\r | |
693 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
694 | EFI_VOLUME_CORRUPTED - The file type of open file is error.\r | |
695 | other - An error occurred when operation the disk.\r | |
696 | \r | |
697 | --*/\r | |
698 | ;\r | |
699 | \r | |
700 | EFI_STATUS\r | |
701 | EFIAPI\r | |
702 | FatReadEx (\r | |
703 | IN EFI_FILE_PROTOCOL *FHand,\r | |
704 | IN OUT EFI_FILE_IO_TOKEN *Token\r | |
705 | )\r | |
706 | /*++\r | |
707 | \r | |
708 | Routine Description:\r | |
709 | \r | |
710 | Get the file info.\r | |
711 | \r | |
712 | Arguments:\r | |
713 | \r | |
714 | FHand - The handle of the file.\r | |
715 | Token - A pointer to the token associated with the transaction.\r | |
716 | \r | |
717 | Returns:\r | |
718 | \r | |
719 | EFI_SUCCESS - Get the file info successfully.\r | |
720 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
721 | EFI_VOLUME_CORRUPTED - The file type of open file is error.\r | |
722 | other - An error occurred when operation the disk.\r | |
723 | \r | |
724 | --*/\r | |
725 | ;\r | |
726 | \r | |
727 | EFI_STATUS\r | |
728 | EFIAPI\r | |
729 | FatWrite (\r | |
730 | IN EFI_FILE_PROTOCOL *FHand,\r | |
731 | IN OUT UINTN *BufferSize,\r | |
732 | IN VOID *Buffer\r | |
733 | )\r | |
734 | /*++\r | |
735 | \r | |
736 | Routine Description:\r | |
737 | \r | |
738 | Set the file info.\r | |
739 | \r | |
740 | Arguments:\r | |
741 | \r | |
742 | FHand - The handle of the file.\r | |
743 | BufferSize - Size of Buffer.\r | |
744 | Buffer - Buffer containing write data.\r | |
745 | \r | |
746 | Returns:\r | |
747 | \r | |
748 | EFI_SUCCESS - Set the file info successfully.\r | |
749 | EFI_WRITE_PROTECTED - The disk is write protected.\r | |
750 | EFI_ACCESS_DENIED - The file is read-only.\r | |
751 | EFI_DEVICE_ERROR - The OFile is not valid.\r | |
752 | EFI_UNSUPPORTED - The open file is not a file.\r | |
753 | - The writing file size is larger than 4GB.\r | |
754 | other - An error occurred when operation the disk.\r | |
755 | \r | |
756 | --*/\r | |
757 | ;\r | |
758 | \r | |
759 | EFI_STATUS\r | |
760 | EFIAPI\r | |
761 | FatWriteEx (\r | |
762 | IN EFI_FILE_PROTOCOL *FHand,\r | |
763 | IN OUT EFI_FILE_IO_TOKEN *Token\r | |
764 | )\r | |
765 | /*++\r | |
766 | \r | |
767 | Routine Description:\r | |
768 | \r | |
769 | Get the file info.\r | |
770 | \r | |
771 | Arguments:\r | |
772 | \r | |
773 | FHand - The handle of the file.\r | |
774 | Token - A pointer to the token associated with the transaction.\r | |
775 | \r | |
776 | Returns:\r | |
777 | \r | |
778 | EFI_SUCCESS - Get the file info successfully.\r | |
779 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
780 | EFI_VOLUME_CORRUPTED - The file type of open file is error.\r | |
781 | other - An error occurred when operation the disk.\r | |
782 | \r | |
783 | --*/\r | |
784 | ;\r | |
785 | \r | |
786 | //\r | |
787 | // DiskCache.c\r | |
788 | //\r | |
789 | EFI_STATUS\r | |
790 | FatInitializeDiskCache (\r | |
791 | IN FAT_VOLUME *Volume\r | |
792 | );\r | |
793 | \r | |
794 | EFI_STATUS\r | |
795 | FatAccessCache (\r | |
796 | IN FAT_VOLUME *Volume,\r | |
797 | IN CACHE_DATA_TYPE CacheDataType,\r | |
798 | IN IO_MODE IoMode,\r | |
799 | IN UINT64 Offset,\r | |
800 | IN UINTN BufferSize,\r | |
801 | IN OUT UINT8 *Buffer,\r | |
802 | IN FAT_TASK *Task\r | |
803 | );\r | |
804 | \r | |
805 | EFI_STATUS\r | |
806 | FatVolumeFlushCache (\r | |
807 | IN FAT_VOLUME *Volume,\r | |
808 | IN FAT_TASK *Task\r | |
809 | );\r | |
810 | \r | |
811 | //\r | |
812 | // Flush.c\r | |
813 | //\r | |
814 | EFI_STATUS\r | |
815 | FatOFileFlush (\r | |
816 | IN FAT_OFILE *OFile\r | |
817 | );\r | |
818 | \r | |
819 | BOOLEAN\r | |
820 | FatCheckOFileRef (\r | |
821 | IN FAT_OFILE *OFile\r | |
822 | );\r | |
823 | \r | |
824 | VOID\r | |
825 | FatSetVolumeError (\r | |
826 | IN FAT_OFILE *OFile,\r | |
827 | IN EFI_STATUS Status\r | |
828 | );\r | |
829 | \r | |
830 | EFI_STATUS\r | |
831 | FatIFileClose (\r | |
832 | FAT_IFILE *IFile\r | |
833 | );\r | |
834 | \r | |
835 | EFI_STATUS\r | |
836 | FatCleanupVolume (\r | |
837 | IN FAT_VOLUME *Volume,\r | |
838 | IN FAT_OFILE *OFile,\r | |
839 | IN EFI_STATUS EfiStatus,\r | |
840 | IN FAT_TASK *Task\r | |
841 | );\r | |
842 | \r | |
843 | //\r | |
844 | // FileSpace.c\r | |
845 | //\r | |
846 | EFI_STATUS\r | |
847 | FatShrinkEof (\r | |
848 | IN FAT_OFILE *OFile\r | |
849 | );\r | |
850 | \r | |
851 | EFI_STATUS\r | |
852 | FatGrowEof (\r | |
853 | IN FAT_OFILE *OFile,\r | |
854 | IN UINT64 NewSizeInBytes\r | |
855 | );\r | |
856 | \r | |
857 | UINTN\r | |
858 | FatPhysicalDirSize (\r | |
859 | IN FAT_VOLUME *Volume,\r | |
860 | IN UINTN Cluster\r | |
861 | );\r | |
862 | \r | |
863 | UINT64\r | |
864 | FatPhysicalFileSize (\r | |
865 | IN FAT_VOLUME *Volume,\r | |
866 | IN UINTN RealSize\r | |
867 | );\r | |
868 | \r | |
869 | EFI_STATUS\r | |
870 | FatOFilePosition (\r | |
871 | IN FAT_OFILE *OFile,\r | |
872 | IN UINTN Position,\r | |
873 | IN UINTN PosLimit\r | |
874 | );\r | |
875 | \r | |
876 | VOID\r | |
877 | FatComputeFreeInfo (\r | |
878 | IN FAT_VOLUME *Volume\r | |
879 | );\r | |
880 | \r | |
881 | //\r | |
882 | // Init.c\r | |
883 | //\r | |
884 | EFI_STATUS\r | |
885 | FatAllocateVolume (\r | |
886 | IN EFI_HANDLE Handle,\r | |
887 | IN EFI_DISK_IO_PROTOCOL *DiskIo,\r | |
888 | IN EFI_DISK_IO2_PROTOCOL *DiskIo2,\r | |
889 | IN EFI_BLOCK_IO_PROTOCOL *BlockIo\r | |
890 | );\r | |
891 | \r | |
892 | EFI_STATUS\r | |
893 | FatOpenDevice (\r | |
894 | IN OUT FAT_VOLUME *Volume\r | |
895 | );\r | |
896 | \r | |
897 | EFI_STATUS\r | |
898 | FatAbandonVolume (\r | |
899 | IN FAT_VOLUME *Volume\r | |
900 | );\r | |
901 | \r | |
902 | //\r | |
903 | // Misc.c\r | |
904 | //\r | |
905 | FAT_TASK *\r | |
906 | FatCreateTask (\r | |
907 | FAT_IFILE *IFile,\r | |
908 | EFI_FILE_IO_TOKEN *Token\r | |
909 | );\r | |
910 | \r | |
911 | VOID\r | |
912 | FatDestroyTask (\r | |
913 | FAT_TASK *Task\r | |
914 | );\r | |
915 | \r | |
916 | VOID\r | |
917 | FatWaitNonblockingTask (\r | |
918 | FAT_IFILE *IFile\r | |
919 | );\r | |
920 | \r | |
921 | LIST_ENTRY *\r | |
922 | FatDestroySubtask (\r | |
923 | FAT_SUBTASK *Subtask\r | |
924 | );\r | |
925 | \r | |
926 | EFI_STATUS\r | |
927 | FatQueueTask (\r | |
928 | IN FAT_IFILE *IFile,\r | |
929 | IN FAT_TASK *Task\r | |
930 | );\r | |
931 | \r | |
932 | EFI_STATUS\r | |
933 | FatAccessVolumeDirty (\r | |
934 | IN FAT_VOLUME *Volume,\r | |
935 | IN IO_MODE IoMode,\r | |
936 | IN VOID *DirtyValue\r | |
937 | );\r | |
938 | \r | |
939 | EFI_STATUS\r | |
940 | FatDiskIo (\r | |
941 | IN FAT_VOLUME *Volume,\r | |
942 | IN IO_MODE IoMode,\r | |
943 | IN UINT64 Offset,\r | |
944 | IN UINTN BufferSize,\r | |
945 | IN OUT VOID *Buffer,\r | |
946 | IN FAT_TASK *Task\r | |
947 | );\r | |
948 | \r | |
949 | VOID\r | |
950 | FatAcquireLock (\r | |
951 | VOID\r | |
952 | );\r | |
953 | \r | |
954 | VOID\r | |
955 | FatReleaseLock (\r | |
956 | VOID\r | |
957 | );\r | |
958 | \r | |
959 | EFI_STATUS\r | |
960 | FatAcquireLockOrFail (\r | |
961 | VOID\r | |
962 | );\r | |
963 | \r | |
964 | VOID\r | |
965 | FatFreeDirEnt (\r | |
966 | IN FAT_DIRENT *DirEnt\r | |
967 | );\r | |
968 | \r | |
969 | VOID\r | |
970 | FatFreeVolume (\r | |
971 | IN FAT_VOLUME *Volume\r | |
972 | );\r | |
973 | \r | |
974 | VOID\r | |
975 | FatEfiTimeToFatTime (\r | |
976 | IN EFI_TIME *ETime,\r | |
977 | OUT FAT_DATE_TIME *FTime\r | |
978 | );\r | |
979 | \r | |
980 | VOID\r | |
981 | FatFatTimeToEfiTime (\r | |
982 | IN FAT_DATE_TIME *FTime,\r | |
983 | OUT EFI_TIME *ETime\r | |
984 | );\r | |
985 | \r | |
986 | VOID\r | |
987 | FatGetCurrentFatTime (\r | |
988 | OUT FAT_DATE_TIME *FatTime\r | |
989 | );\r | |
990 | \r | |
991 | BOOLEAN\r | |
992 | FatIsValidTime (\r | |
993 | IN EFI_TIME *Time\r | |
994 | );\r | |
995 | \r | |
996 | //\r | |
997 | // UnicodeCollation.c\r | |
998 | //\r | |
999 | EFI_STATUS\r | |
1000 | InitializeUnicodeCollationSupport (\r | |
1001 | IN EFI_HANDLE AgentHandle\r | |
1002 | );\r | |
1003 | \r | |
1004 | VOID\r | |
1005 | FatFatToStr (\r | |
1006 | IN UINTN FatSize,\r | |
1007 | IN CHAR8 *Fat,\r | |
1008 | OUT CHAR16 *String\r | |
1009 | );\r | |
1010 | \r | |
1011 | BOOLEAN\r | |
1012 | FatStrToFat (\r | |
1013 | IN CHAR16 *String,\r | |
1014 | IN UINTN FatSize,\r | |
1015 | OUT CHAR8 *Fat\r | |
1016 | );\r | |
1017 | \r | |
1018 | VOID\r | |
1019 | FatStrLwr (\r | |
1020 | IN CHAR16 *Str\r | |
1021 | );\r | |
1022 | \r | |
1023 | VOID\r | |
1024 | FatStrUpr (\r | |
1025 | IN CHAR16 *Str\r | |
1026 | );\r | |
1027 | \r | |
1028 | INTN\r | |
1029 | FatStriCmp (\r | |
1030 | IN CHAR16 *Str1,\r | |
1031 | IN CHAR16 *Str2\r | |
1032 | );\r | |
1033 | \r | |
1034 | //\r | |
1035 | // Open.c\r | |
1036 | //\r | |
1037 | EFI_STATUS\r | |
1038 | FatOFileOpen (\r | |
1039 | IN FAT_OFILE *OFile,\r | |
1040 | OUT FAT_IFILE **NewIFile,\r | |
1041 | IN CHAR16 *FileName,\r | |
1042 | IN UINT64 OpenMode,\r | |
1043 | IN UINT8 Attributes\r | |
1044 | );\r | |
1045 | \r | |
1046 | EFI_STATUS\r | |
1047 | FatAllocateIFile (\r | |
1048 | IN FAT_OFILE *OFile,\r | |
1049 | OUT FAT_IFILE **PtrIFile\r | |
1050 | );\r | |
1051 | \r | |
1052 | //\r | |
1053 | // OpenVolume.c\r | |
1054 | //\r | |
1055 | EFI_STATUS\r | |
1056 | EFIAPI\r | |
1057 | FatOpenVolume (\r | |
1058 | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,\r | |
1059 | OUT EFI_FILE_PROTOCOL **File\r | |
1060 | );\r | |
1061 | \r | |
1062 | //\r | |
1063 | // ReadWrite.c\r | |
1064 | //\r | |
1065 | EFI_STATUS\r | |
1066 | FatAccessOFile (\r | |
1067 | IN FAT_OFILE *OFile,\r | |
1068 | IN IO_MODE IoMode,\r | |
1069 | IN UINTN Position,\r | |
1070 | IN UINTN *DataBufferSize,\r | |
1071 | IN UINT8 *UserBuffer,\r | |
1072 | IN FAT_TASK *Task\r | |
1073 | );\r | |
1074 | \r | |
1075 | EFI_STATUS\r | |
1076 | FatExpandOFile (\r | |
1077 | IN FAT_OFILE *OFile,\r | |
1078 | IN UINT64 ExpandedSize\r | |
1079 | );\r | |
1080 | \r | |
1081 | EFI_STATUS\r | |
1082 | FatWriteZeroPool (\r | |
1083 | IN FAT_OFILE *OFile,\r | |
1084 | IN UINTN WritePos\r | |
1085 | );\r | |
1086 | \r | |
1087 | EFI_STATUS\r | |
1088 | FatTruncateOFile (\r | |
1089 | IN FAT_OFILE *OFile,\r | |
1090 | IN UINTN TruncatedSize\r | |
1091 | );\r | |
1092 | \r | |
1093 | //\r | |
1094 | // DirectoryManage.c\r | |
1095 | //\r | |
1096 | VOID\r | |
1097 | FatResetODirCursor (\r | |
1098 | IN FAT_OFILE *OFile\r | |
1099 | );\r | |
1100 | \r | |
1101 | EFI_STATUS\r | |
1102 | FatGetNextDirEnt (\r | |
1103 | IN FAT_OFILE *OFILE,\r | |
1104 | OUT FAT_DIRENT **PtrDirEnt\r | |
1105 | );\r | |
1106 | \r | |
1107 | EFI_STATUS\r | |
1108 | FatRemoveDirEnt (\r | |
1109 | IN FAT_OFILE *OFile,\r | |
1110 | IN FAT_DIRENT *DirEnt\r | |
1111 | );\r | |
1112 | \r | |
1113 | EFI_STATUS\r | |
1114 | FatStoreDirEnt (\r | |
1115 | IN FAT_OFILE *OFile,\r | |
1116 | IN FAT_DIRENT *DirEnt\r | |
1117 | );\r | |
1118 | \r | |
1119 | EFI_STATUS\r | |
1120 | FatCreateDirEnt (\r | |
1121 | IN FAT_OFILE *OFile,\r | |
1122 | IN CHAR16 *FileName,\r | |
1123 | IN UINT8 Attributes,\r | |
1124 | OUT FAT_DIRENT **PtrDirEnt\r | |
1125 | );\r | |
1126 | \r | |
1127 | BOOLEAN\r | |
1128 | FatIsDotDirEnt (\r | |
1129 | IN FAT_DIRENT *DirEnt\r | |
1130 | );\r | |
1131 | \r | |
1132 | VOID\r | |
1133 | FatUpdateDirEntClusterSizeInfo (\r | |
1134 | IN FAT_OFILE *OFile\r | |
1135 | );\r | |
1136 | \r | |
1137 | VOID\r | |
1138 | FatCloneDirEnt (\r | |
1139 | IN FAT_DIRENT *DirEnt1,\r | |
1140 | IN FAT_DIRENT *DirEnt2\r | |
1141 | );\r | |
1142 | \r | |
1143 | EFI_STATUS\r | |
1144 | FatGetDirEntInfo (\r | |
1145 | IN FAT_VOLUME *Volume,\r | |
1146 | IN FAT_DIRENT *DirEnt,\r | |
1147 | IN OUT UINTN *BufferSize,\r | |
1148 | OUT VOID *Buffer\r | |
1149 | );\r | |
1150 | \r | |
1151 | EFI_STATUS\r | |
1152 | FatOpenDirEnt (\r | |
1153 | IN FAT_OFILE *OFile,\r | |
1154 | IN FAT_DIRENT *DirEnt\r | |
1155 | );\r | |
1156 | \r | |
1157 | EFI_STATUS\r | |
1158 | FatCreateDotDirEnts (\r | |
1159 | IN FAT_OFILE *OFile\r | |
1160 | );\r | |
1161 | \r | |
1162 | VOID\r | |
1163 | FatCloseDirEnt (\r | |
1164 | IN FAT_DIRENT *DirEnt\r | |
1165 | );\r | |
1166 | \r | |
1167 | EFI_STATUS\r | |
1168 | FatLocateOFile (\r | |
1169 | IN OUT FAT_OFILE **PtrOFile,\r | |
1170 | IN CHAR16 *FileName,\r | |
1171 | IN UINT8 Attributes,\r | |
1172 | OUT CHAR16 *NewFileName\r | |
1173 | );\r | |
1174 | \r | |
1175 | EFI_STATUS\r | |
1176 | FatGetVolumeEntry (\r | |
1177 | IN FAT_VOLUME *Volume,\r | |
1178 | IN CHAR16 *Name\r | |
1179 | );\r | |
1180 | \r | |
1181 | EFI_STATUS\r | |
1182 | FatSetVolumeEntry (\r | |
1183 | IN FAT_VOLUME *Volume,\r | |
1184 | IN CHAR16 *Name\r | |
1185 | );\r | |
1186 | \r | |
1187 | //\r | |
1188 | // Hash.c\r | |
1189 | //\r | |
1190 | FAT_DIRENT **\r | |
1191 | FatLongNameHashSearch (\r | |
1192 | IN FAT_ODIR *ODir,\r | |
1193 | IN CHAR16 *LongNameString\r | |
1194 | );\r | |
1195 | \r | |
1196 | FAT_DIRENT **\r | |
1197 | FatShortNameHashSearch (\r | |
1198 | IN FAT_ODIR *ODir,\r | |
1199 | IN CHAR8 *ShortNameString\r | |
1200 | );\r | |
1201 | \r | |
1202 | VOID\r | |
1203 | FatInsertToHashTable (\r | |
1204 | IN FAT_ODIR *ODir,\r | |
1205 | IN FAT_DIRENT *DirEnt\r | |
1206 | );\r | |
1207 | \r | |
1208 | VOID\r | |
1209 | FatDeleteFromHashTable (\r | |
1210 | IN FAT_ODIR *ODir,\r | |
1211 | IN FAT_DIRENT *DirEnt\r | |
1212 | );\r | |
1213 | \r | |
1214 | //\r | |
1215 | // FileName.c\r | |
1216 | //\r | |
1217 | BOOLEAN\r | |
1218 | FatCheckIs8Dot3Name (\r | |
1219 | IN CHAR16 *FileName,\r | |
1220 | OUT CHAR8 *File8Dot3Name\r | |
1221 | );\r | |
1222 | \r | |
1223 | VOID\r | |
1224 | FatCreate8Dot3Name (\r | |
1225 | IN FAT_OFILE *Parent,\r | |
1226 | IN FAT_DIRENT *DirEnt\r | |
1227 | );\r | |
1228 | \r | |
1229 | VOID\r | |
1230 | FatNameToStr (\r | |
1231 | IN CHAR8 *FatName,\r | |
1232 | IN UINTN Len,\r | |
1233 | IN UINTN LowerCase,\r | |
1234 | IN CHAR16 *Str\r | |
1235 | );\r | |
1236 | \r | |
1237 | VOID\r | |
1238 | FatSetCaseFlag (\r | |
1239 | IN FAT_DIRENT *DirEnt\r | |
1240 | );\r | |
1241 | \r | |
1242 | VOID\r | |
1243 | FatGetFileNameViaCaseFlag (\r | |
1244 | IN FAT_DIRENT *DirEnt,\r | |
1245 | IN OUT CHAR16 *FileString,\r | |
1246 | IN UINTN FileStringMax\r | |
1247 | );\r | |
1248 | \r | |
1249 | UINT8\r | |
1250 | FatCheckSum (\r | |
1251 | IN CHAR8 *ShortNameString\r | |
1252 | );\r | |
1253 | \r | |
1254 | CHAR16*\r | |
1255 | FatGetNextNameComponent (\r | |
1256 | IN CHAR16 *Path,\r | |
1257 | OUT CHAR16 *Name\r | |
1258 | );\r | |
1259 | \r | |
1260 | BOOLEAN\r | |
1261 | FatFileNameIsValid (\r | |
1262 | IN CHAR16 *InputFileName,\r | |
1263 | OUT CHAR16 *OutputFileName\r | |
1264 | );\r | |
1265 | \r | |
1266 | //\r | |
1267 | // DirectoryCache.c\r | |
1268 | //\r | |
1269 | VOID\r | |
1270 | FatDiscardODir (\r | |
1271 | IN FAT_OFILE *OFile\r | |
1272 | );\r | |
1273 | \r | |
1274 | VOID\r | |
1275 | FatRequestODir (\r | |
1276 | IN FAT_OFILE *OFile\r | |
1277 | );\r | |
1278 | \r | |
1279 | VOID\r | |
1280 | FatCleanupODirCache (\r | |
1281 | IN FAT_VOLUME *Volume\r | |
1282 | );\r | |
1283 | \r | |
1284 | //\r | |
1285 | // Global Variables\r | |
1286 | //\r | |
1287 | extern EFI_DRIVER_BINDING_PROTOCOL gFatDriverBinding;\r | |
1288 | extern EFI_COMPONENT_NAME_PROTOCOL gFatComponentName;\r | |
1289 | extern EFI_COMPONENT_NAME2_PROTOCOL gFatComponentName2;\r | |
1290 | extern EFI_LOCK FatFsLock;\r | |
1291 | extern EFI_LOCK FatTaskLock;\r | |
1292 | extern EFI_FILE_PROTOCOL FatFileInterface;\r | |
1293 | \r | |
1294 | #endif\r |