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