]>
Commit | Line | Data |
---|---|---|
b9ec9330 QH |
1 | /*++\r |
2 | \r | |
149d6335 | 3 | Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r |
6163cc98 | 4 | This program and the accompanying materials are licensed and made available\r |
b9ec9330 QH |
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 | |
b9ec9330 QH |
33 | #include <Protocol/BlockIo.h>\r |
34 | #include <Protocol/DiskIo.h>\r | |
149d6335 | 35 | #include <Protocol/DiskIo2.h>\r |
b9ec9330 QH |
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 | |
bcc9adde QH |
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 | |
149d6335 RN |
59 | #define FAT_TASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'T')\r |
60 | #define FAT_SUBTASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'S')\r | |
b9ec9330 QH |
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 | |
dba03ba1 | 215 | EFI_FILE_PROTOCOL Handle;\r |
b9ec9330 QH |
216 | UINT64 Position;\r |
217 | BOOLEAN ReadOnly;\r | |
218 | struct _FAT_OFILE *OFile;\r | |
149d6335 RN |
219 | LIST_ENTRY Tasks; // List of all FAT_TASKs\r |
220 | LIST_ENTRY Link; // Link to other IFiles\r | |
b9ec9330 QH |
221 | } FAT_IFILE;\r |
222 | \r | |
149d6335 RN |
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 | |
b9ec9330 QH |
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 | |
c3b8ec43 | 269 | // Archive is set if the archive attribute in the file's\r |
b9ec9330 QH |
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 | |
149d6335 | 322 | EFI_DISK_IO2_PROTOCOL *DiskIo2;\r |
b9ec9330 QH |
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 | |
dba03ba1 QH |
396 | IN EFI_FILE_PROTOCOL *FHand,\r |
397 | OUT EFI_FILE_PROTOCOL **NewHandle,\r | |
b9ec9330 QH |
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 | |
149d6335 RN |
427 | EFI_STATUS\r |
428 | FatOpenEx (\r | |
429 | IN EFI_FILE_PROTOCOL *FHand,\r | |
430 | OUT EFI_FILE_PROTOCOL **NewHandle,\r | |
431 | IN CHAR16 *FileName,\r | |
432 | IN UINT64 OpenMode,\r | |
433 | IN UINT64 Attributes,\r | |
434 | IN OUT EFI_FILE_IO_TOKEN *Token\r | |
435 | )\r | |
436 | /*++\r | |
437 | Routine Description:\r | |
438 | \r | |
439 | Implements OpenEx() of Simple File System Protocol.\r | |
440 | \r | |
441 | Arguments:\r | |
442 | \r | |
443 | FHand - File handle of the file serves as a starting reference point.\r | |
444 | NewHandle - Handle of the file that is newly opened.\r | |
445 | FileName - File name relative to FHand.\r | |
446 | OpenMode - Open mode.\r | |
447 | Attributes - Attributes to set if the file is created.\r | |
448 | Token - A pointer to the token associated with the transaction.\r | |
449 | \r | |
450 | Returns:\r | |
451 | \r | |
452 | EFI_INVALID_PARAMETER - The FileName is NULL or the file string is empty.\r | |
453 | The OpenMode is not supported.\r | |
454 | The Attributes is not the valid attributes.\r | |
455 | EFI_OUT_OF_RESOURCES - Can not allocate the memory for file string.\r | |
456 | EFI_SUCCESS - Open the file successfully.\r | |
457 | Others - The status of open file.\r | |
458 | \r | |
459 | --*/\r | |
460 | ;\r | |
461 | \r | |
b9ec9330 QH |
462 | EFI_STATUS\r |
463 | EFIAPI\r | |
464 | FatGetPosition (\r | |
dba03ba1 | 465 | IN EFI_FILE_PROTOCOL *FHand,\r |
b9ec9330 QH |
466 | OUT UINT64 *Position\r |
467 | )\r | |
468 | /*++\r | |
469 | \r | |
470 | Routine Description:\r | |
471 | \r | |
472 | Get the file's position of the file\r | |
473 | \r | |
474 | Arguments:\r | |
475 | \r | |
476 | FHand - The handle of file.\r | |
477 | Position - The file's position of the file.\r | |
478 | \r | |
479 | Returns:\r | |
480 | \r | |
481 | EFI_SUCCESS - Get the info successfully.\r | |
482 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
483 | EFI_UNSUPPORTED - The open file is not a file.\r | |
484 | \r | |
485 | --*/\r | |
486 | ;\r | |
487 | \r | |
488 | EFI_STATUS\r | |
489 | EFIAPI\r | |
490 | FatGetInfo (\r | |
dba03ba1 QH |
491 | IN EFI_FILE_PROTOCOL *FHand,\r |
492 | IN EFI_GUID *Type,\r | |
493 | IN OUT UINTN *BufferSize,\r | |
494 | OUT VOID *Buffer\r | |
b9ec9330 QH |
495 | )\r |
496 | /*++\r | |
497 | \r | |
498 | Routine Description:\r | |
499 | \r | |
500 | Get the some types info of the file into Buffer\r | |
501 | \r | |
502 | Arguments:\r | |
503 | \r | |
504 | FHand - The handle of file.\r | |
505 | Type - The type of the info.\r | |
506 | BufferSize - Size of Buffer.\r | |
507 | Buffer - Buffer containing volume info.\r | |
508 | \r | |
509 | Returns:\r | |
510 | \r | |
511 | EFI_SUCCESS - Get the info successfully.\r | |
512 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
513 | \r | |
514 | --*/\r | |
515 | ;\r | |
516 | \r | |
517 | EFI_STATUS\r | |
518 | EFIAPI\r | |
519 | FatSetInfo (\r | |
dba03ba1 | 520 | IN EFI_FILE_PROTOCOL *FHand,\r |
b9ec9330 QH |
521 | IN EFI_GUID *Type,\r |
522 | IN UINTN BufferSize,\r | |
523 | IN VOID *Buffer\r | |
524 | )\r | |
525 | /*++\r | |
526 | \r | |
527 | Routine Description:\r | |
528 | \r | |
529 | Set the some types info of the file into Buffer\r | |
530 | \r | |
531 | Arguments:\r | |
532 | \r | |
533 | FHand - The handle of file.\r | |
534 | Type - The type of the info.\r | |
535 | BufferSize - Size of Buffer.\r | |
536 | Buffer - Buffer containing volume info.\r | |
537 | \r | |
538 | Returns:\r | |
539 | \r | |
540 | EFI_SUCCESS - Set the info successfully.\r | |
541 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
542 | \r | |
543 | --*/\r | |
544 | ;\r | |
545 | \r | |
546 | EFI_STATUS\r | |
547 | EFIAPI\r | |
548 | FatFlush (\r | |
dba03ba1 | 549 | IN EFI_FILE_PROTOCOL *FHand\r |
b9ec9330 QH |
550 | )\r |
551 | /*++\r | |
552 | \r | |
553 | Routine Description:\r | |
554 | \r | |
555 | Flushes all data associated with the file handle\r | |
556 | \r | |
557 | Arguments:\r | |
558 | \r | |
559 | FHand - Handle to file to flush\r | |
560 | \r | |
561 | Returns:\r | |
562 | \r | |
563 | EFI_SUCCESS - Flushed the file successfully\r | |
564 | EFI_WRITE_PROTECTED - The volume is read only\r | |
565 | EFI_ACCESS_DENIED - The volume is not read only\r | |
566 | but the file is read only\r | |
567 | Others - Flushing of the file is failed\r | |
568 | \r | |
569 | --*/\r | |
570 | ;\r | |
571 | \r | |
149d6335 RN |
572 | EFI_STATUS\r |
573 | EFIAPI\r | |
574 | FatFlushEx (\r | |
575 | IN EFI_FILE_PROTOCOL *FHand,\r | |
576 | IN EFI_FILE_IO_TOKEN *Token\r | |
577 | )\r | |
578 | /*++\r | |
579 | \r | |
580 | Routine Description:\r | |
581 | \r | |
582 | Flushes all data associated with the file handle.\r | |
583 | \r | |
584 | Arguments:\r | |
585 | \r | |
586 | FHand - Handle to file to flush.\r | |
587 | Token - A pointer to the token associated with the transaction.\r | |
588 | \r | |
589 | Returns:\r | |
590 | \r | |
591 | EFI_SUCCESS - Flushed the file successfully.\r | |
592 | EFI_WRITE_PROTECTED - The volume is read only.\r | |
593 | EFI_ACCESS_DENIED - The file is read only.\r | |
594 | Others - Flushing of the file failed.\r | |
595 | \r | |
596 | --*/\r | |
597 | ;\r | |
598 | \r | |
b9ec9330 QH |
599 | EFI_STATUS\r |
600 | EFIAPI\r | |
601 | FatClose (\r | |
dba03ba1 | 602 | IN EFI_FILE_PROTOCOL *FHand\r |
b9ec9330 QH |
603 | )\r |
604 | /*++\r | |
605 | \r | |
606 | Routine Description:\r | |
607 | \r | |
608 | Flushes & Closes the file handle.\r | |
609 | \r | |
610 | Arguments:\r | |
611 | \r | |
612 | FHand - Handle to the file to delete.\r | |
613 | \r | |
614 | Returns:\r | |
615 | \r | |
616 | EFI_SUCCESS - Closed the file successfully.\r | |
617 | \r | |
618 | --*/\r | |
619 | ;\r | |
620 | \r | |
621 | EFI_STATUS\r | |
622 | EFIAPI\r | |
623 | FatDelete (\r | |
dba03ba1 | 624 | IN EFI_FILE_PROTOCOL *FHand\r |
b9ec9330 QH |
625 | )\r |
626 | /*++\r | |
627 | \r | |
628 | Routine Description:\r | |
629 | \r | |
630 | Deletes the file & Closes the file handle.\r | |
631 | \r | |
632 | Arguments:\r | |
633 | \r | |
634 | FHand - Handle to the file to delete.\r | |
635 | \r | |
636 | Returns:\r | |
637 | \r | |
638 | EFI_SUCCESS - Delete the file successfully.\r | |
639 | EFI_WARN_DELETE_FAILURE - Fail to delete the file.\r | |
640 | \r | |
641 | --*/\r | |
642 | ;\r | |
643 | \r | |
644 | EFI_STATUS\r | |
645 | EFIAPI\r | |
646 | FatSetPosition (\r | |
dba03ba1 | 647 | IN EFI_FILE_PROTOCOL *FHand,\r |
b9ec9330 QH |
648 | IN UINT64 Position\r |
649 | )\r | |
650 | /*++\r | |
651 | \r | |
652 | Routine Description:\r | |
653 | \r | |
654 | Set the file's position of the file\r | |
655 | \r | |
656 | Arguments:\r | |
657 | \r | |
658 | FHand - The handle of file\r | |
659 | Position - The file's position of the file\r | |
660 | \r | |
661 | Returns:\r | |
662 | \r | |
663 | EFI_SUCCESS - Set the info successfully\r | |
664 | EFI_DEVICE_ERROR - Can not find the OFile for the file\r | |
665 | EFI_UNSUPPORTED - Set a directory with a not-zero position\r | |
666 | \r | |
667 | --*/\r | |
668 | ;\r | |
669 | \r | |
670 | EFI_STATUS\r | |
671 | EFIAPI\r | |
672 | FatRead (\r | |
dba03ba1 QH |
673 | IN EFI_FILE_PROTOCOL *FHand,\r |
674 | IN OUT UINTN *BufferSize,\r | |
675 | OUT VOID *Buffer\r | |
b9ec9330 QH |
676 | )\r |
677 | /*++\r | |
678 | \r | |
679 | Routine Description:\r | |
680 | \r | |
681 | Get the file info.\r | |
682 | \r | |
683 | Arguments:\r | |
684 | \r | |
685 | FHand - The handle of the file.\r | |
686 | BufferSize - Size of Buffer.\r | |
687 | Buffer - Buffer containing read data.\r | |
688 | \r | |
689 | Returns:\r | |
690 | \r | |
691 | EFI_SUCCESS - Get the file info successfully.\r | |
692 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
693 | EFI_VOLUME_CORRUPTED - The file type of open file is error.\r | |
694 | other - An error occurred when operation the disk.\r | |
695 | \r | |
696 | --*/\r | |
697 | ;\r | |
698 | \r | |
149d6335 RN |
699 | EFI_STATUS\r |
700 | EFIAPI\r | |
701 | FatReadEx (\r | |
702 | IN EFI_FILE_PROTOCOL *FHand,\r | |
703 | IN OUT EFI_FILE_IO_TOKEN *Token\r | |
704 | )\r | |
705 | /*++\r | |
706 | \r | |
707 | Routine Description:\r | |
708 | \r | |
709 | Get the file info.\r | |
710 | \r | |
711 | Arguments:\r | |
712 | \r | |
713 | FHand - The handle of the file.\r | |
714 | Token - A pointer to the token associated with the transaction.\r | |
715 | \r | |
716 | Returns:\r | |
717 | \r | |
718 | EFI_SUCCESS - Get the file info successfully.\r | |
719 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
720 | EFI_VOLUME_CORRUPTED - The file type of open file is error.\r | |
721 | other - An error occurred when operation the disk.\r | |
722 | \r | |
723 | --*/\r | |
724 | ;\r | |
725 | \r | |
b9ec9330 QH |
726 | EFI_STATUS\r |
727 | EFIAPI\r | |
728 | FatWrite (\r | |
dba03ba1 QH |
729 | IN EFI_FILE_PROTOCOL *FHand,\r |
730 | IN OUT UINTN *BufferSize,\r | |
731 | IN VOID *Buffer\r | |
b9ec9330 QH |
732 | )\r |
733 | /*++\r | |
734 | \r | |
735 | Routine Description:\r | |
736 | \r | |
737 | Set the file info.\r | |
738 | \r | |
739 | Arguments:\r | |
740 | \r | |
741 | FHand - The handle of the file.\r | |
742 | BufferSize - Size of Buffer.\r | |
743 | Buffer - Buffer containing write data.\r | |
744 | \r | |
745 | Returns:\r | |
746 | \r | |
747 | EFI_SUCCESS - Set the file info successfully.\r | |
748 | EFI_WRITE_PROTECTED - The disk is write protected.\r | |
749 | EFI_ACCESS_DENIED - The file is read-only.\r | |
750 | EFI_DEVICE_ERROR - The OFile is not valid.\r | |
751 | EFI_UNSUPPORTED - The open file is not a file.\r | |
752 | - The writing file size is larger than 4GB.\r | |
753 | other - An error occurred when operation the disk.\r | |
754 | \r | |
755 | --*/\r | |
756 | ;\r | |
757 | \r | |
149d6335 RN |
758 | EFI_STATUS\r |
759 | EFIAPI\r | |
760 | FatWriteEx (\r | |
761 | IN EFI_FILE_PROTOCOL *FHand,\r | |
762 | IN OUT EFI_FILE_IO_TOKEN *Token\r | |
763 | )\r | |
764 | /*++\r | |
765 | \r | |
766 | Routine Description:\r | |
767 | \r | |
768 | Get the file info.\r | |
769 | \r | |
770 | Arguments:\r | |
771 | \r | |
772 | FHand - The handle of the file.\r | |
773 | Token - A pointer to the token associated with the transaction.\r | |
774 | \r | |
775 | Returns:\r | |
776 | \r | |
777 | EFI_SUCCESS - Get the file info successfully.\r | |
778 | EFI_DEVICE_ERROR - Can not find the OFile for the file.\r | |
779 | EFI_VOLUME_CORRUPTED - The file type of open file is error.\r | |
780 | other - An error occurred when operation the disk.\r | |
781 | \r | |
782 | --*/\r | |
783 | ;\r | |
784 | \r | |
b9ec9330 QH |
785 | //\r |
786 | // DiskCache.c\r | |
787 | //\r | |
788 | EFI_STATUS\r | |
789 | FatInitializeDiskCache (\r | |
790 | IN FAT_VOLUME *Volume\r | |
791 | );\r | |
792 | \r | |
793 | EFI_STATUS\r | |
794 | FatAccessCache (\r | |
795 | IN FAT_VOLUME *Volume,\r | |
796 | IN CACHE_DATA_TYPE CacheDataType,\r | |
797 | IN IO_MODE IoMode,\r | |
798 | IN UINT64 Offset,\r | |
799 | IN UINTN BufferSize,\r | |
149d6335 RN |
800 | IN OUT UINT8 *Buffer,\r |
801 | IN FAT_TASK *Task\r | |
b9ec9330 QH |
802 | );\r |
803 | \r | |
804 | EFI_STATUS\r | |
805 | FatVolumeFlushCache (\r | |
149d6335 RN |
806 | IN FAT_VOLUME *Volume,\r |
807 | IN FAT_TASK *Task\r | |
b9ec9330 QH |
808 | );\r |
809 | \r | |
810 | //\r | |
811 | // Flush.c\r | |
812 | //\r | |
813 | EFI_STATUS\r | |
814 | FatOFileFlush (\r | |
815 | IN FAT_OFILE *OFile\r | |
816 | );\r | |
817 | \r | |
818 | BOOLEAN\r | |
819 | FatCheckOFileRef (\r | |
820 | IN FAT_OFILE *OFile\r | |
821 | );\r | |
822 | \r | |
823 | VOID\r | |
824 | FatSetVolumeError (\r | |
825 | IN FAT_OFILE *OFile,\r | |
826 | IN EFI_STATUS Status\r | |
827 | );\r | |
828 | \r | |
829 | EFI_STATUS\r | |
830 | FatIFileClose (\r | |
831 | FAT_IFILE *IFile\r | |
832 | );\r | |
833 | \r | |
834 | EFI_STATUS\r | |
835 | FatCleanupVolume (\r | |
836 | IN FAT_VOLUME *Volume,\r | |
837 | IN FAT_OFILE *OFile,\r | |
149d6335 RN |
838 | IN EFI_STATUS EfiStatus,\r |
839 | IN FAT_TASK *Task\r | |
b9ec9330 QH |
840 | );\r |
841 | \r | |
842 | //\r | |
843 | // FileSpace.c\r | |
844 | //\r | |
845 | EFI_STATUS\r | |
846 | FatShrinkEof (\r | |
847 | IN FAT_OFILE *OFile\r | |
848 | );\r | |
849 | \r | |
850 | EFI_STATUS\r | |
851 | FatGrowEof (\r | |
852 | IN FAT_OFILE *OFile,\r | |
853 | IN UINT64 NewSizeInBytes\r | |
854 | );\r | |
855 | \r | |
856 | UINTN\r | |
857 | FatPhysicalDirSize (\r | |
858 | IN FAT_VOLUME *Volume,\r | |
859 | IN UINTN Cluster\r | |
860 | );\r | |
861 | \r | |
862 | UINT64\r | |
863 | FatPhysicalFileSize (\r | |
864 | IN FAT_VOLUME *Volume,\r | |
865 | IN UINTN RealSize\r | |
866 | );\r | |
867 | \r | |
868 | EFI_STATUS\r | |
869 | FatOFilePosition (\r | |
870 | IN FAT_OFILE *OFile,\r | |
871 | IN UINTN Position,\r | |
872 | IN UINTN PosLimit\r | |
873 | );\r | |
874 | \r | |
875 | VOID\r | |
876 | FatComputeFreeInfo (\r | |
877 | IN FAT_VOLUME *Volume\r | |
878 | );\r | |
879 | \r | |
880 | //\r | |
881 | // Init.c\r | |
882 | //\r | |
883 | EFI_STATUS\r | |
884 | FatAllocateVolume (\r | |
885 | IN EFI_HANDLE Handle,\r | |
886 | IN EFI_DISK_IO_PROTOCOL *DiskIo,\r | |
149d6335 | 887 | IN EFI_DISK_IO2_PROTOCOL *DiskIo2,\r |
b9ec9330 QH |
888 | IN EFI_BLOCK_IO_PROTOCOL *BlockIo\r |
889 | );\r | |
890 | \r | |
891 | EFI_STATUS\r | |
892 | FatOpenDevice (\r | |
893 | IN OUT FAT_VOLUME *Volume\r | |
894 | );\r | |
895 | \r | |
896 | EFI_STATUS\r | |
897 | FatAbandonVolume (\r | |
898 | IN FAT_VOLUME *Volume\r | |
899 | );\r | |
900 | \r | |
901 | //\r | |
902 | // Misc.c\r | |
903 | //\r | |
149d6335 RN |
904 | FAT_TASK *\r |
905 | FatCreateTask (\r | |
906 | FAT_IFILE *IFile,\r | |
907 | EFI_FILE_IO_TOKEN *Token\r | |
908 | );\r | |
909 | \r | |
910 | VOID\r | |
911 | FatDestroyTask (\r | |
912 | FAT_TASK *Task\r | |
913 | );\r | |
914 | \r | |
915 | VOID\r | |
916 | FatWaitNonblockingTask (\r | |
917 | FAT_IFILE *IFile\r | |
918 | );\r | |
919 | \r | |
920 | LIST_ENTRY *\r | |
921 | FatDestroySubtask (\r | |
922 | FAT_SUBTASK *Subtask\r | |
923 | );\r | |
924 | \r | |
925 | EFI_STATUS\r | |
926 | FatQueueTask (\r | |
927 | IN FAT_IFILE *IFile,\r | |
928 | IN FAT_TASK *Task\r | |
929 | );\r | |
930 | \r | |
b9ec9330 QH |
931 | EFI_STATUS\r |
932 | FatAccessVolumeDirty (\r | |
933 | IN FAT_VOLUME *Volume,\r | |
934 | IN IO_MODE IoMode,\r | |
935 | IN VOID *DirtyValue\r | |
936 | );\r | |
937 | \r | |
938 | EFI_STATUS\r | |
939 | FatDiskIo (\r | |
940 | IN FAT_VOLUME *Volume,\r | |
941 | IN IO_MODE IoMode,\r | |
942 | IN UINT64 Offset,\r | |
943 | IN UINTN BufferSize,\r | |
149d6335 RN |
944 | IN OUT VOID *Buffer,\r |
945 | IN FAT_TASK *Task\r | |
b9ec9330 QH |
946 | );\r |
947 | \r | |
948 | VOID\r | |
949 | FatAcquireLock (\r | |
950 | VOID\r | |
951 | );\r | |
952 | \r | |
953 | VOID\r | |
954 | FatReleaseLock (\r | |
955 | VOID\r | |
956 | );\r | |
957 | \r | |
25ce9b1f QH |
958 | EFI_STATUS\r |
959 | FatAcquireLockOrFail (\r | |
b9ec9330 QH |
960 | VOID\r |
961 | );\r | |
962 | \r | |
963 | VOID\r | |
964 | FatFreeDirEnt (\r | |
965 | IN FAT_DIRENT *DirEnt\r | |
966 | );\r | |
967 | \r | |
968 | VOID\r | |
969 | FatFreeVolume (\r | |
970 | IN FAT_VOLUME *Volume\r | |
971 | );\r | |
972 | \r | |
973 | VOID\r | |
974 | FatEfiTimeToFatTime (\r | |
975 | IN EFI_TIME *ETime,\r | |
976 | OUT FAT_DATE_TIME *FTime\r | |
977 | );\r | |
978 | \r | |
979 | VOID\r | |
980 | FatFatTimeToEfiTime (\r | |
981 | IN FAT_DATE_TIME *FTime,\r | |
982 | OUT EFI_TIME *ETime\r | |
983 | );\r | |
984 | \r | |
985 | VOID\r | |
986 | FatGetCurrentFatTime (\r | |
987 | OUT FAT_DATE_TIME *FatTime\r | |
988 | );\r | |
989 | \r | |
990 | BOOLEAN\r | |
991 | FatIsValidTime (\r | |
992 | IN EFI_TIME *Time\r | |
993 | );\r | |
994 | \r | |
995 | //\r | |
996 | // UnicodeCollation.c\r | |
997 | //\r | |
998 | EFI_STATUS\r | |
999 | InitializeUnicodeCollationSupport (\r | |
1000 | IN EFI_HANDLE AgentHandle\r | |
1001 | );\r | |
1002 | \r | |
1003 | VOID\r | |
1004 | FatFatToStr (\r | |
1005 | IN UINTN FatSize,\r | |
1006 | IN CHAR8 *Fat,\r | |
1007 | OUT CHAR16 *String\r | |
1008 | );\r | |
1009 | \r | |
1010 | BOOLEAN\r | |
1011 | FatStrToFat (\r | |
1012 | IN CHAR16 *String,\r | |
1013 | IN UINTN FatSize,\r | |
1014 | OUT CHAR8 *Fat\r | |
1015 | );\r | |
1016 | \r | |
1017 | VOID\r | |
1018 | FatStrLwr (\r | |
1019 | IN CHAR16 *Str\r | |
1020 | );\r | |
1021 | \r | |
1022 | VOID\r | |
1023 | FatStrUpr (\r | |
1024 | IN CHAR16 *Str\r | |
1025 | );\r | |
1026 | \r | |
1027 | INTN\r | |
1028 | FatStriCmp (\r | |
1029 | IN CHAR16 *Str1,\r | |
1030 | IN CHAR16 *Str2\r | |
1031 | );\r | |
1032 | \r | |
1033 | //\r | |
1034 | // Open.c\r | |
1035 | //\r | |
1036 | EFI_STATUS\r | |
1037 | FatOFileOpen (\r | |
1038 | IN FAT_OFILE *OFile,\r | |
1039 | OUT FAT_IFILE **NewIFile,\r | |
1040 | IN CHAR16 *FileName,\r | |
1041 | IN UINT64 OpenMode,\r | |
1042 | IN UINT8 Attributes\r | |
1043 | );\r | |
1044 | \r | |
1045 | EFI_STATUS\r | |
1046 | FatAllocateIFile (\r | |
1047 | IN FAT_OFILE *OFile,\r | |
1048 | OUT FAT_IFILE **PtrIFile\r | |
1049 | );\r | |
1050 | \r | |
1051 | //\r | |
1052 | // OpenVolume.c\r | |
1053 | //\r | |
1054 | EFI_STATUS\r | |
1055 | EFIAPI\r | |
1056 | FatOpenVolume (\r | |
1057 | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,\r | |
dba03ba1 | 1058 | OUT EFI_FILE_PROTOCOL **File\r |
b9ec9330 QH |
1059 | );\r |
1060 | \r | |
1061 | //\r | |
1062 | // ReadWrite.c\r | |
1063 | //\r | |
1064 | EFI_STATUS\r | |
1065 | FatAccessOFile (\r | |
1066 | IN FAT_OFILE *OFile,\r | |
1067 | IN IO_MODE IoMode,\r | |
1068 | IN UINTN Position,\r | |
1069 | IN UINTN *DataBufferSize,\r | |
149d6335 RN |
1070 | IN UINT8 *UserBuffer,\r |
1071 | IN FAT_TASK *Task\r | |
b9ec9330 QH |
1072 | );\r |
1073 | \r | |
1074 | EFI_STATUS\r | |
1075 | FatExpandOFile (\r | |
1076 | IN FAT_OFILE *OFile,\r | |
1077 | IN UINT64 ExpandedSize\r | |
1078 | );\r | |
1079 | \r | |
1080 | EFI_STATUS\r | |
1081 | FatWriteZeroPool (\r | |
1082 | IN FAT_OFILE *OFile,\r | |
1083 | IN UINTN WritePos\r | |
1084 | );\r | |
1085 | \r | |
1086 | EFI_STATUS\r | |
1087 | FatTruncateOFile (\r | |
1088 | IN FAT_OFILE *OFile,\r | |
1089 | IN UINTN TruncatedSize\r | |
1090 | );\r | |
1091 | \r | |
1092 | //\r | |
1093 | // DirectoryManage.c\r | |
1094 | //\r | |
1095 | VOID\r | |
1096 | FatResetODirCursor (\r | |
1097 | IN FAT_OFILE *OFile\r | |
1098 | );\r | |
1099 | \r | |
1100 | EFI_STATUS\r | |
1101 | FatGetNextDirEnt (\r | |
1102 | IN FAT_OFILE *OFILE,\r | |
1103 | OUT FAT_DIRENT **PtrDirEnt\r | |
1104 | );\r | |
1105 | \r | |
1106 | EFI_STATUS\r | |
1107 | FatRemoveDirEnt (\r | |
1108 | IN FAT_OFILE *OFile,\r | |
1109 | IN FAT_DIRENT *DirEnt\r | |
1110 | );\r | |
1111 | \r | |
1112 | EFI_STATUS\r | |
1113 | FatStoreDirEnt (\r | |
1114 | IN FAT_OFILE *OFile,\r | |
1115 | IN FAT_DIRENT *DirEnt\r | |
1116 | );\r | |
1117 | \r | |
1118 | EFI_STATUS\r | |
1119 | FatCreateDirEnt (\r | |
1120 | IN FAT_OFILE *OFile,\r | |
1121 | IN CHAR16 *FileName,\r | |
1122 | IN UINT8 Attributes,\r | |
1123 | OUT FAT_DIRENT **PtrDirEnt\r | |
1124 | );\r | |
1125 | \r | |
1126 | BOOLEAN\r | |
1127 | FatIsDotDirEnt (\r | |
1128 | IN FAT_DIRENT *DirEnt\r | |
1129 | );\r | |
1130 | \r | |
1131 | VOID\r | |
1132 | FatUpdateDirEntClusterSizeInfo (\r | |
1133 | IN FAT_OFILE *OFile\r | |
1134 | );\r | |
1135 | \r | |
1136 | VOID\r | |
1137 | FatCloneDirEnt (\r | |
1138 | IN FAT_DIRENT *DirEnt1,\r | |
1139 | IN FAT_DIRENT *DirEnt2\r | |
1140 | );\r | |
1141 | \r | |
1142 | EFI_STATUS\r | |
1143 | FatGetDirEntInfo (\r | |
1144 | IN FAT_VOLUME *Volume,\r | |
1145 | IN FAT_DIRENT *DirEnt,\r | |
1146 | IN OUT UINTN *BufferSize,\r | |
1147 | OUT VOID *Buffer\r | |
1148 | );\r | |
1149 | \r | |
1150 | EFI_STATUS\r | |
1151 | FatOpenDirEnt (\r | |
1152 | IN FAT_OFILE *OFile,\r | |
1153 | IN FAT_DIRENT *DirEnt\r | |
1154 | );\r | |
1155 | \r | |
1156 | EFI_STATUS\r | |
1157 | FatCreateDotDirEnts (\r | |
1158 | IN FAT_OFILE *OFile\r | |
1159 | );\r | |
1160 | \r | |
1161 | VOID\r | |
1162 | FatCloseDirEnt (\r | |
1163 | IN FAT_DIRENT *DirEnt\r | |
1164 | );\r | |
1165 | \r | |
1166 | EFI_STATUS\r | |
1167 | FatLocateOFile (\r | |
1168 | IN OUT FAT_OFILE **PtrOFile,\r | |
1169 | IN CHAR16 *FileName,\r | |
1170 | IN UINT8 Attributes,\r | |
1171 | OUT CHAR16 *NewFileName\r | |
1172 | );\r | |
1173 | \r | |
1174 | EFI_STATUS\r | |
1175 | FatGetVolumeEntry (\r | |
1176 | IN FAT_VOLUME *Volume,\r | |
1177 | IN CHAR16 *Name\r | |
1178 | );\r | |
1179 | \r | |
1180 | EFI_STATUS\r | |
1181 | FatSetVolumeEntry (\r | |
1182 | IN FAT_VOLUME *Volume,\r | |
1183 | IN CHAR16 *Name\r | |
1184 | );\r | |
1185 | \r | |
1186 | //\r | |
1187 | // Hash.c\r | |
1188 | //\r | |
1189 | FAT_DIRENT **\r | |
1190 | FatLongNameHashSearch (\r | |
1191 | IN FAT_ODIR *ODir,\r | |
1192 | IN CHAR16 *LongNameString\r | |
1193 | );\r | |
1194 | \r | |
1195 | FAT_DIRENT **\r | |
1196 | FatShortNameHashSearch (\r | |
1197 | IN FAT_ODIR *ODir,\r | |
1198 | IN CHAR8 *ShortNameString\r | |
1199 | );\r | |
1200 | \r | |
1201 | VOID\r | |
1202 | FatInsertToHashTable (\r | |
1203 | IN FAT_ODIR *ODir,\r | |
1204 | IN FAT_DIRENT *DirEnt\r | |
1205 | );\r | |
1206 | \r | |
1207 | VOID\r | |
1208 | FatDeleteFromHashTable (\r | |
1209 | IN FAT_ODIR *ODir,\r | |
1210 | IN FAT_DIRENT *DirEnt\r | |
1211 | );\r | |
1212 | \r | |
1213 | //\r | |
1214 | // FileName.c\r | |
1215 | //\r | |
1216 | BOOLEAN\r | |
1217 | FatCheckIs8Dot3Name (\r | |
1218 | IN CHAR16 *FileName,\r | |
1219 | OUT CHAR8 *File8Dot3Name\r | |
1220 | );\r | |
1221 | \r | |
1222 | VOID\r | |
1223 | FatCreate8Dot3Name (\r | |
1224 | IN FAT_OFILE *Parent,\r | |
1225 | IN FAT_DIRENT *DirEnt\r | |
1226 | );\r | |
1227 | \r | |
1228 | VOID\r | |
1229 | FatNameToStr (\r | |
1230 | IN CHAR8 *FatName,\r | |
1231 | IN UINTN Len,\r | |
1232 | IN UINTN LowerCase,\r | |
1233 | IN CHAR16 *Str\r | |
1234 | );\r | |
1235 | \r | |
1236 | VOID\r | |
1237 | FatSetCaseFlag (\r | |
1238 | IN FAT_DIRENT *DirEnt\r | |
1239 | );\r | |
1240 | \r | |
1241 | VOID\r | |
1242 | FatGetFileNameViaCaseFlag (\r | |
1243 | IN FAT_DIRENT *DirEnt,\r | |
1244 | OUT CHAR16 *FileString\r | |
1245 | );\r | |
1246 | \r | |
1247 | UINT8\r | |
1248 | FatCheckSum (\r | |
1249 | IN CHAR8 *ShortNameString\r | |
1250 | );\r | |
1251 | \r | |
1252 | CHAR16*\r | |
1253 | FatGetNextNameComponent (\r | |
1254 | IN CHAR16 *Path,\r | |
1255 | OUT CHAR16 *Name\r | |
1256 | );\r | |
1257 | \r | |
1258 | BOOLEAN\r | |
1259 | FatFileNameIsValid (\r | |
1260 | IN CHAR16 *InputFileName,\r | |
1261 | OUT CHAR16 *OutputFileName\r | |
1262 | );\r | |
1263 | \r | |
1264 | //\r | |
1265 | // DirectoryCache.c\r | |
1266 | //\r | |
1267 | VOID\r | |
1268 | FatDiscardODir (\r | |
1269 | IN FAT_OFILE *OFile\r | |
1270 | );\r | |
1271 | \r | |
1272 | VOID\r | |
1273 | FatRequestODir (\r | |
1274 | IN FAT_OFILE *OFile\r | |
1275 | );\r | |
1276 | \r | |
1277 | VOID\r | |
1278 | FatCleanupODirCache (\r | |
1279 | IN FAT_VOLUME *Volume\r | |
1280 | );\r | |
1281 | \r | |
1282 | //\r | |
1283 | // Global Variables\r | |
1284 | //\r | |
1285 | extern EFI_DRIVER_BINDING_PROTOCOL gFatDriverBinding;\r | |
1286 | extern EFI_COMPONENT_NAME_PROTOCOL gFatComponentName;\r | |
1287 | extern EFI_COMPONENT_NAME2_PROTOCOL gFatComponentName2;\r | |
1288 | extern EFI_LOCK FatFsLock;\r | |
149d6335 | 1289 | extern EFI_LOCK FatTaskLock;\r |
dba03ba1 | 1290 | extern EFI_FILE_PROTOCOL FatFileInterface;\r |
b9ec9330 QH |
1291 | \r |
1292 | #endif\r |