summaryrefslogtreecommitdiffstats
path: root/FatPkg/EnhancedFatDxe/Fat.h
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:53:58 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitbcdcc4160d7460c46c08c9395aae81be44ef23a9 (patch)
tree8e8607b86b86a1cebeaf6f614c43731a486b61a5 /FatPkg/EnhancedFatDxe/Fat.h
parenta550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97 (diff)
downloadedk2-bcdcc4160d7460c46c08c9395aae81be44ef23a9.tar.gz
edk2-bcdcc4160d7460c46c08c9395aae81be44ef23a9.tar.bz2
edk2-bcdcc4160d7460c46c08c9395aae81be44ef23a9.zip
FatPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the FatPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'FatPkg/EnhancedFatDxe/Fat.h')
-rw-r--r--FatPkg/EnhancedFatDxe/Fat.h673
1 files changed, 342 insertions, 331 deletions
diff --git a/FatPkg/EnhancedFatDxe/Fat.h b/FatPkg/EnhancedFatDxe/Fat.h
index fcc25952d4..356cdbdb51 100644
--- a/FatPkg/EnhancedFatDxe/Fat.h
+++ b/FatPkg/EnhancedFatDxe/Fat.h
@@ -35,42 +35,42 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
// The FAT signature
//
-#define FAT_VOLUME_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'v')
-#define FAT_IFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'i')
-#define FAT_ODIR_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'd')
-#define FAT_DIRENT_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'e')
-#define FAT_OFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'o')
-#define FAT_TASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'T')
-#define FAT_SUBTASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'S')
+#define FAT_VOLUME_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'v')
+#define FAT_IFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'i')
+#define FAT_ODIR_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'd')
+#define FAT_DIRENT_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'e')
+#define FAT_OFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'o')
+#define FAT_TASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'T')
+#define FAT_SUBTASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'S')
-#define ASSERT_VOLUME_LOCKED(a) ASSERT_LOCKED (&FatFsLock)
+#define ASSERT_VOLUME_LOCKED(a) ASSERT_LOCKED (&FatFsLock)
-#define IFILE_FROM_FHAND(a) CR (a, FAT_IFILE, Handle, FAT_IFILE_SIGNATURE)
+#define IFILE_FROM_FHAND(a) CR (a, FAT_IFILE, Handle, FAT_IFILE_SIGNATURE)
-#define DIRENT_FROM_LINK(a) CR (a, FAT_DIRENT, Link, FAT_DIRENT_SIGNATURE)
+#define DIRENT_FROM_LINK(a) CR (a, FAT_DIRENT, Link, FAT_DIRENT_SIGNATURE)
-#define VOLUME_FROM_ROOT_DIRENT(a) CR (a, FAT_VOLUME, RootDirEnt, FAT_VOLUME_SIGNATURE)
+#define VOLUME_FROM_ROOT_DIRENT(a) CR (a, FAT_VOLUME, RootDirEnt, FAT_VOLUME_SIGNATURE)
-#define VOLUME_FROM_VOL_INTERFACE(a) CR (a, FAT_VOLUME, VolumeInterface, FAT_VOLUME_SIGNATURE);
+#define VOLUME_FROM_VOL_INTERFACE(a) CR (a, FAT_VOLUME, VolumeInterface, FAT_VOLUME_SIGNATURE);
-#define ODIR_FROM_DIRCACHELINK(a) CR (a, FAT_ODIR, DirCacheLink, FAT_ODIR_SIGNATURE)
+#define ODIR_FROM_DIRCACHELINK(a) CR (a, FAT_ODIR, DirCacheLink, FAT_ODIR_SIGNATURE)
-#define OFILE_FROM_CHECKLINK(a) CR (a, FAT_OFILE, CheckLink, FAT_OFILE_SIGNATURE)
+#define OFILE_FROM_CHECKLINK(a) CR (a, FAT_OFILE, CheckLink, FAT_OFILE_SIGNATURE)
-#define OFILE_FROM_CHILDLINK(a) CR (a, FAT_OFILE, ChildLink, FAT_OFILE_SIGNATURE)
+#define OFILE_FROM_CHILDLINK(a) CR (a, FAT_OFILE, ChildLink, FAT_OFILE_SIGNATURE)
//
// Minimum sector size is 512B, Maximum sector size is 4096B
// Max sectors per cluster is 128
//
-#define MAX_BLOCK_ALIGNMENT 12
-#define MIN_BLOCK_ALIGNMENT 9
-#define MAX_SECTORS_PER_CLUSTER_ALIGNMENT 7
+#define MAX_BLOCK_ALIGNMENT 12
+#define MIN_BLOCK_ALIGNMENT 9
+#define MAX_SECTORS_PER_CLUSTER_ALIGNMENT 7
//
// Efi Time Definition
//
-#define IS_LEAP_YEAR(a) (((a) % 4 == 0) && (((a) % 100 != 0) || ((a) % 400 == 0)))
+#define IS_LEAP_YEAR(a) (((a) % 4 == 0) && (((a) % 100 != 0) || ((a) % 400 == 0)))
//
// Minimum fat page size is 8K, maximum fat page alignment is 32K
@@ -87,26 +87,25 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
// Used in 8.3 generation algorithm
//
-#define MAX_SPEC_RETRY 4
-#define SPEC_BASE_TAG_LEN 6
-#define HASH_BASE_TAG_LEN 2
-#define HASH_VALUE_TAG_LEN (SPEC_BASE_TAG_LEN - HASH_BASE_TAG_LEN)
+#define MAX_SPEC_RETRY 4
+#define SPEC_BASE_TAG_LEN 6
+#define HASH_BASE_TAG_LEN 2
+#define HASH_VALUE_TAG_LEN (SPEC_BASE_TAG_LEN - HASH_BASE_TAG_LEN)
//
// Path name separator is back slash
//
-#define PATH_NAME_SEPARATOR L'\\'
+#define PATH_NAME_SEPARATOR L'\\'
+#define EFI_PATH_STRING_LENGTH 260
+#define EFI_FILE_STRING_LENGTH 255
+#define FAT_MAX_ALLOCATE_SIZE 0xA00000
+#define LC_ISO_639_2_ENTRY_SIZE 3
+#define MAX_LANG_CODE_SIZE 100
-#define EFI_PATH_STRING_LENGTH 260
-#define EFI_FILE_STRING_LENGTH 255
-#define FAT_MAX_ALLOCATE_SIZE 0xA00000
-#define LC_ISO_639_2_ENTRY_SIZE 3
-#define MAX_LANG_CODE_SIZE 100
-
-#define FAT_MAX_DIR_CACHE_COUNT 8
-#define FAT_MAX_DIRENTRY_COUNT 0xFFFF
-typedef CHAR8 LC_ISO_639_2;
+#define FAT_MAX_DIR_CACHE_COUNT 8
+#define FAT_MAX_DIRENTRY_COUNT 0xFFFF
+typedef CHAR8 LC_ISO_639_2;
//
// The fat types we support
@@ -128,12 +127,12 @@ typedef enum {
// Used in FatDiskIo
//
typedef enum {
- ReadDisk = 0, // raw disk read
- WriteDisk = 1, // raw disk write
- ReadFat = 2, // read fat cache
- WriteFat = 3, // write fat cache
- ReadData = 6, // read data cache
- WriteData = 7 // write data cache
+ ReadDisk = 0, // raw disk read
+ WriteDisk = 1, // raw disk write
+ ReadFat = 2, // read fat cache
+ WriteFat = 3, // write fat cache
+ ReadData = 6, // read data cache
+ WriteData = 7 // write data cache
} IO_MODE;
#define CACHE_ENABLED(a) ((a) >= 2)
@@ -144,19 +143,19 @@ typedef enum {
// Disk cache tag
//
typedef struct {
- UINTN PageNo;
- UINTN RealSize;
- BOOLEAN Dirty;
+ UINTN PageNo;
+ UINTN RealSize;
+ BOOLEAN Dirty;
} CACHE_TAG;
typedef struct {
- UINT64 BaseAddress;
- UINT64 LimitAddress;
- UINT8 *CacheBase;
- BOOLEAN Dirty;
- UINT8 PageAlignment;
- UINTN GroupMask;
- CACHE_TAG CacheTag[FAT_DATACACHE_GROUP_COUNT];
+ UINT64 BaseAddress;
+ UINT64 LimitAddress;
+ UINT8 *CacheBase;
+ BOOLEAN Dirty;
+ UINT8 PageAlignment;
+ UINTN GroupMask;
+ CACHE_TAG CacheTag[FAT_DATACACHE_GROUP_COUNT];
} DISK_CACHE;
//
@@ -170,88 +169,88 @@ typedef struct {
//
typedef struct _FAT_DIRENT FAT_DIRENT;
-typedef struct _FAT_ODIR FAT_ODIR;
-typedef struct _FAT_OFILE FAT_OFILE;
+typedef struct _FAT_ODIR FAT_ODIR;
+typedef struct _FAT_OFILE FAT_OFILE;
typedef struct _FAT_VOLUME FAT_VOLUME;
struct _FAT_DIRENT {
- UINTN Signature;
- UINT16 EntryPos; // The position of this directory entry in the parent directory file
- UINT8 EntryCount; // The count of the directory entry in the parent directory file
- BOOLEAN Invalid; // Indicate whether this directory entry is valid
- CHAR16 *FileString; // The unicode long file name for this directory entry
- FAT_OFILE *OFile; // The OFile of the corresponding directory entry
- FAT_DIRENT *ShortNameForwardLink; // Hash successor link for short filename
- FAT_DIRENT *LongNameForwardLink; // Hash successor link for long filename
- LIST_ENTRY Link; // Connection of every directory entry
- FAT_DIRECTORY_ENTRY Entry; // The physical directory entry stored in disk
+ UINTN Signature;
+ UINT16 EntryPos; // The position of this directory entry in the parent directory file
+ UINT8 EntryCount; // The count of the directory entry in the parent directory file
+ BOOLEAN Invalid; // Indicate whether this directory entry is valid
+ CHAR16 *FileString; // The unicode long file name for this directory entry
+ FAT_OFILE *OFile; // The OFile of the corresponding directory entry
+ FAT_DIRENT *ShortNameForwardLink; // Hash successor link for short filename
+ FAT_DIRENT *LongNameForwardLink; // Hash successor link for long filename
+ LIST_ENTRY Link; // Connection of every directory entry
+ FAT_DIRECTORY_ENTRY Entry; // The physical directory entry stored in disk
};
struct _FAT_ODIR {
- UINTN Signature;
- UINT32 CurrentEndPos; // Current end position of the directory
- UINT32 CurrentPos; // Current position of the directory
- LIST_ENTRY *CurrentCursor; // Current directory entry pointer
- LIST_ENTRY ChildList; // List of all directory entries
- BOOLEAN EndOfDir; // Indicate whether we have reached the end of the directory
- LIST_ENTRY DirCacheLink; // Linked in Volume->DirCacheList when discarded
- UINTN DirCacheTag; // The identification of the directory when in directory cache
- FAT_DIRENT *LongNameHashTable[HASH_TABLE_SIZE];
- FAT_DIRENT *ShortNameHashTable[HASH_TABLE_SIZE];
+ UINTN Signature;
+ UINT32 CurrentEndPos; // Current end position of the directory
+ UINT32 CurrentPos; // Current position of the directory
+ LIST_ENTRY *CurrentCursor; // Current directory entry pointer
+ LIST_ENTRY ChildList; // List of all directory entries
+ BOOLEAN EndOfDir; // Indicate whether we have reached the end of the directory
+ LIST_ENTRY DirCacheLink; // Linked in Volume->DirCacheList when discarded
+ UINTN DirCacheTag; // The identification of the directory when in directory cache
+ FAT_DIRENT *LongNameHashTable[HASH_TABLE_SIZE];
+ FAT_DIRENT *ShortNameHashTable[HASH_TABLE_SIZE];
};
typedef struct {
- UINTN Signature;
- EFI_FILE_PROTOCOL Handle;
- UINT64 Position;
- BOOLEAN ReadOnly;
- FAT_OFILE *OFile;
- LIST_ENTRY Tasks; // List of all FAT_TASKs
- LIST_ENTRY Link; // Link to other IFiles
+ UINTN Signature;
+ EFI_FILE_PROTOCOL Handle;
+ UINT64 Position;
+ BOOLEAN ReadOnly;
+ FAT_OFILE *OFile;
+ LIST_ENTRY Tasks; // List of all FAT_TASKs
+ LIST_ENTRY Link; // Link to other IFiles
} FAT_IFILE;
typedef struct {
- UINTN Signature;
- EFI_FILE_IO_TOKEN *FileIoToken;
- FAT_IFILE *IFile;
- LIST_ENTRY Subtasks; // List of all FAT_SUBTASKs
- LIST_ENTRY Link; // Link to other FAT_TASKs
+ UINTN Signature;
+ EFI_FILE_IO_TOKEN *FileIoToken;
+ FAT_IFILE *IFile;
+ LIST_ENTRY Subtasks; // List of all FAT_SUBTASKs
+ LIST_ENTRY Link; // Link to other FAT_TASKs
} FAT_TASK;
typedef struct {
- UINTN Signature;
- EFI_DISK_IO2_TOKEN DiskIo2Token;
- FAT_TASK *Task;
- BOOLEAN Write;
- UINT64 Offset;
- VOID *Buffer;
- UINTN BufferSize;
- LIST_ENTRY Link;
+ UINTN Signature;
+ EFI_DISK_IO2_TOKEN DiskIo2Token;
+ FAT_TASK *Task;
+ BOOLEAN Write;
+ UINT64 Offset;
+ VOID *Buffer;
+ UINTN BufferSize;
+ LIST_ENTRY Link;
} FAT_SUBTASK;
//
// FAT_OFILE - Each opened file
//
struct _FAT_OFILE {
- UINTN Signature;
- FAT_VOLUME *Volume;
+ UINTN Signature;
+ FAT_VOLUME *Volume;
//
// A permanent error code to return to all accesses to
// this opened file
//
- EFI_STATUS Error;
+ EFI_STATUS Error;
//
// A list of the IFILE instances for this OFile
//
- LIST_ENTRY Opens;
+ LIST_ENTRY Opens;
//
// The dynamic information
//
- UINTN FileSize;
- UINTN FileCluster;
- UINTN FileCurrentCluster;
- UINTN FileLastCluster;
+ UINTN FileSize;
+ UINTN FileCluster;
+ UINTN FileCurrentCluster;
+ UINTN FileLastCluster;
//
// Dirty is set if there have been any updates to the
@@ -261,120 +260,120 @@ struct _FAT_OFILE {
// PreserveLastMod is set if the last modification of the
// file is specified by SetInfo API
//
- BOOLEAN Dirty;
- BOOLEAN IsFixedRootDir;
- BOOLEAN PreserveLastModification;
- BOOLEAN Archive;
+ BOOLEAN Dirty;
+ BOOLEAN IsFixedRootDir;
+ BOOLEAN PreserveLastModification;
+ BOOLEAN Archive;
//
// Set by an OFile SetPosition
//
- UINTN Position; // within file
- UINT64 PosDisk; // on the disk
- UINTN PosRem; // remaining in this disk run
+ UINTN Position; // within file
+ UINT64 PosDisk; // on the disk
+ UINTN PosRem; // remaining in this disk run
//
// The opened parent, full path length and currently opened child files
//
- FAT_OFILE *Parent;
- UINTN FullPathLen;
- LIST_ENTRY ChildHead;
- LIST_ENTRY ChildLink;
+ FAT_OFILE *Parent;
+ UINTN FullPathLen;
+ LIST_ENTRY ChildHead;
+ LIST_ENTRY ChildLink;
//
// The opened directory structure for a directory; if this
// OFile represents a file, then ODir = NULL
//
- FAT_ODIR *ODir;
+ FAT_ODIR *ODir;
//
// The directory entry for the Ofile
//
- FAT_DIRENT *DirEnt;
+ FAT_DIRENT *DirEnt;
//
// Link in Volume's reference list
//
- LIST_ENTRY CheckLink;
+ LIST_ENTRY CheckLink;
};
struct _FAT_VOLUME {
- UINTN Signature;
+ UINTN Signature;
- EFI_HANDLE Handle;
- BOOLEAN Valid;
- BOOLEAN DiskError;
+ EFI_HANDLE Handle;
+ BOOLEAN Valid;
+ BOOLEAN DiskError;
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL VolumeInterface;
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL VolumeInterface;
//
// If opened, the parent handle and BlockIo interface
//
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- EFI_DISK_IO_PROTOCOL *DiskIo;
- EFI_DISK_IO2_PROTOCOL *DiskIo2;
- UINT32 MediaId;
- BOOLEAN ReadOnly;
+ EFI_BLOCK_IO_PROTOCOL *BlockIo;
+ EFI_DISK_IO_PROTOCOL *DiskIo;
+ EFI_DISK_IO2_PROTOCOL *DiskIo2;
+ UINT32 MediaId;
+ BOOLEAN ReadOnly;
//
// Computed values from fat bpb info
//
- UINT64 VolumeSize;
- UINT64 FatPos; // Disk pos of fat tables
- UINT64 RootPos; // Disk pos of root directory
- UINT64 FirstClusterPos; // Disk pos of first cluster
- UINTN FatSize; // Number of bytes in each fat
- UINTN MaxCluster; // Max cluster number
- UINTN ClusterSize; // Cluster size of fat partition
- UINT8 ClusterAlignment; // Equal to log_2 (clustersize);
- FAT_VOLUME_TYPE FatType;
+ UINT64 VolumeSize;
+ UINT64 FatPos; // Disk pos of fat tables
+ UINT64 RootPos; // Disk pos of root directory
+ UINT64 FirstClusterPos; // Disk pos of first cluster
+ UINTN FatSize; // Number of bytes in each fat
+ UINTN MaxCluster; // Max cluster number
+ UINTN ClusterSize; // Cluster size of fat partition
+ UINT8 ClusterAlignment; // Equal to log_2 (clustersize);
+ FAT_VOLUME_TYPE FatType;
//
// Current part of fat table that's present
//
- UINT64 FatEntryPos; // Location of buffer
- UINTN FatEntrySize; // Size of buffer
- UINT32 FatEntryBuffer; // The buffer
- FAT_INFO_SECTOR FatInfoSector; // Free cluster info
- UINTN FreeInfoPos; // Pos with the free cluster info
- BOOLEAN FreeInfoValid; // If free cluster info is valid
+ UINT64 FatEntryPos; // Location of buffer
+ UINTN FatEntrySize; // Size of buffer
+ UINT32 FatEntryBuffer; // The buffer
+ FAT_INFO_SECTOR FatInfoSector; // Free cluster info
+ UINTN FreeInfoPos; // Pos with the free cluster info
+ BOOLEAN FreeInfoValid; // If free cluster info is valid
//
// Unpacked Fat BPB info
//
- UINTN NumFats;
- UINTN RootEntries; // < FAT32, root dir is fixed size
- UINTN RootCluster; // >= FAT32, root cluster chain head
+ UINTN NumFats;
+ UINTN RootEntries; // < FAT32, root dir is fixed size
+ UINTN RootCluster; // >= FAT32, root cluster chain head
//
// info for marking the volume dirty or not
//
- BOOLEAN FatDirty; // If fat-entries have been updated
- UINT32 DirtyValue;
- UINT32 NotDirtyValue;
+ BOOLEAN FatDirty; // If fat-entries have been updated
+ UINT32 DirtyValue;
+ UINT32 NotDirtyValue;
//
// The root directory entry and opened root file
//
- FAT_DIRENT RootDirEnt;
+ FAT_DIRENT RootDirEnt;
//
// File Name of root OFile, it is empty string
//
- CHAR16 RootFileString[1];
- FAT_OFILE *Root;
+ CHAR16 RootFileString[1];
+ FAT_OFILE *Root;
//
// New OFiles are added to this list so they
// can be cleaned up if they aren't referenced.
//
- LIST_ENTRY CheckRef;
+ LIST_ENTRY CheckRef;
//
// Directory cache List
//
- LIST_ENTRY DirCacheList;
- UINTN DirCacheCount;
+ LIST_ENTRY DirCacheList;
+ UINTN DirCacheCount;
//
// Disk Cache for this volume
//
- VOID *CacheBuffer;
- DISK_CACHE DiskCache[CacheMaxType];
+ VOID *CacheBuffer;
+ DISK_CACHE DiskCache[CacheMaxType];
};
//
@@ -403,11 +402,11 @@ struct _FAT_VOLUME {
EFI_STATUS
EFIAPI
FatOpen (
- IN EFI_FILE_PROTOCOL *FHand,
- OUT EFI_FILE_PROTOCOL **NewHandle,
- IN CHAR16 *FileName,
- IN UINT64 OpenMode,
- IN UINT64 Attributes
+ IN EFI_FILE_PROTOCOL *FHand,
+ OUT EFI_FILE_PROTOCOL **NewHandle,
+ IN CHAR16 *FileName,
+ IN UINT64 OpenMode,
+ IN UINT64 Attributes
)
;
@@ -433,12 +432,12 @@ FatOpen (
EFI_STATUS
EFIAPI
FatOpenEx (
- IN EFI_FILE_PROTOCOL *FHand,
- OUT EFI_FILE_PROTOCOL **NewHandle,
- IN CHAR16 *FileName,
- IN UINT64 OpenMode,
- IN UINT64 Attributes,
- IN OUT EFI_FILE_IO_TOKEN *Token
+ IN EFI_FILE_PROTOCOL *FHand,
+ OUT EFI_FILE_PROTOCOL **NewHandle,
+ IN CHAR16 *FileName,
+ IN UINT64 OpenMode,
+ IN UINT64 Attributes,
+ IN OUT EFI_FILE_IO_TOKEN *Token
)
;
@@ -457,8 +456,8 @@ FatOpenEx (
EFI_STATUS
EFIAPI
FatGetPosition (
- IN EFI_FILE_PROTOCOL *FHand,
- OUT UINT64 *Position
+ IN EFI_FILE_PROTOCOL *FHand,
+ OUT UINT64 *Position
)
;
@@ -478,10 +477,10 @@ FatGetPosition (
EFI_STATUS
EFIAPI
FatGetInfo (
- IN EFI_FILE_PROTOCOL *FHand,
- IN EFI_GUID *Type,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
+ IN EFI_FILE_PROTOCOL *FHand,
+ IN EFI_GUID *Type,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
)
;
@@ -619,9 +618,9 @@ FatSetPosition (
EFI_STATUS
EFIAPI
FatRead (
- IN EFI_FILE_PROTOCOL *FHand,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
+ IN EFI_FILE_PROTOCOL *FHand,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
)
;
@@ -666,9 +665,9 @@ FatReadEx (
EFI_STATUS
EFIAPI
FatWrite (
- IN EFI_FILE_PROTOCOL *FHand,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
+ IN EFI_FILE_PROTOCOL *FHand,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
)
;
@@ -696,6 +695,7 @@ FatWriteEx (
//
// DiskCache.c
//
+
/**
Initialize the disk cache according to Volume's FatType.
@@ -708,7 +708,7 @@ FatWriteEx (
**/
EFI_STATUS
FatInitializeDiskCache (
- IN FAT_VOLUME *Volume
+ IN FAT_VOLUME *Volume
);
/**
@@ -742,13 +742,13 @@ FatInitializeDiskCache (
**/
EFI_STATUS
FatAccessCache (
- IN FAT_VOLUME *Volume,
- IN CACHE_DATA_TYPE CacheDataType,
- IN IO_MODE IoMode,
- IN UINT64 Offset,
- IN UINTN BufferSize,
- IN OUT UINT8 *Buffer,
- IN FAT_TASK *Task
+ IN FAT_VOLUME *Volume,
+ IN CACHE_DATA_TYPE CacheDataType,
+ IN IO_MODE IoMode,
+ IN UINT64 Offset,
+ IN UINTN BufferSize,
+ IN OUT UINT8 *Buffer,
+ IN FAT_TASK *Task
);
/**
@@ -764,13 +764,14 @@ FatAccessCache (
**/
EFI_STATUS
FatVolumeFlushCache (
- IN FAT_VOLUME *Volume,
- IN FAT_TASK *Task
+ IN FAT_VOLUME *Volume,
+ IN FAT_TASK *Task
);
//
// Flush.c
//
+
/**
Flush the data associated with an open file.
@@ -784,7 +785,7 @@ FatVolumeFlushCache (
**/
EFI_STATUS
FatOFileFlush (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -801,7 +802,7 @@ FatOFileFlush (
**/
BOOLEAN
FatCheckOFileRef (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -814,8 +815,8 @@ FatCheckOFileRef (
**/
VOID
FatSetVolumeError (
- IN FAT_OFILE *OFile,
- IN EFI_STATUS Status
+ IN FAT_OFILE *OFile,
+ IN EFI_STATUS Status
);
/**
@@ -829,7 +830,7 @@ FatSetVolumeError (
**/
EFI_STATUS
FatIFileClose (
- FAT_IFILE *IFile
+ FAT_IFILE *IFile
);
/**
@@ -850,15 +851,16 @@ FatIFileClose (
**/
EFI_STATUS
FatCleanupVolume (
- IN FAT_VOLUME *Volume,
- IN FAT_OFILE *OFile,
- IN EFI_STATUS EfiStatus,
- IN FAT_TASK *Task
+ IN FAT_VOLUME *Volume,
+ IN FAT_OFILE *OFile,
+ IN EFI_STATUS EfiStatus,
+ IN FAT_TASK *Task
);
//
// FileSpace.c
//
+
/**
Shrink the end of the open file base on the file size.
@@ -871,7 +873,7 @@ FatCleanupVolume (
**/
EFI_STATUS
FatShrinkEof (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -889,8 +891,8 @@ FatShrinkEof (
**/
EFI_STATUS
FatGrowEof (
- IN FAT_OFILE *OFile,
- IN UINT64 NewSizeInBytes
+ IN FAT_OFILE *OFile,
+ IN UINT64 NewSizeInBytes
);
/**
@@ -906,8 +908,8 @@ FatGrowEof (
**/
UINTN
FatPhysicalDirSize (
- IN FAT_VOLUME *Volume,
- IN UINTN Cluster
+ IN FAT_VOLUME *Volume,
+ IN UINTN Cluster
);
/**
@@ -922,8 +924,8 @@ FatPhysicalDirSize (
**/
UINT64
FatPhysicalFileSize (
- IN FAT_VOLUME *Volume,
- IN UINTN RealSize
+ IN FAT_VOLUME *Volume,
+ IN UINTN RealSize
);
/**
@@ -941,9 +943,9 @@ FatPhysicalFileSize (
**/
EFI_STATUS
FatOFilePosition (
- IN FAT_OFILE *OFile,
- IN UINTN Position,
- IN UINTN PosLimit
+ IN FAT_OFILE *OFile,
+ IN UINTN Position,
+ IN UINTN PosLimit
);
/**
@@ -955,12 +957,13 @@ FatOFilePosition (
**/
VOID
FatComputeFreeInfo (
- IN FAT_VOLUME *Volume
+ IN FAT_VOLUME *Volume
);
//
// Init.c
//
+
/**
Allocates volume structure, detects FAT file system, installs protocol,
@@ -978,10 +981,10 @@ FatComputeFreeInfo (
**/
EFI_STATUS
FatAllocateVolume (
- IN EFI_HANDLE Handle,
- IN EFI_DISK_IO_PROTOCOL *DiskIo,
- IN EFI_DISK_IO2_PROTOCOL *DiskIo2,
- IN EFI_BLOCK_IO_PROTOCOL *BlockIo
+ IN EFI_HANDLE Handle,
+ IN EFI_DISK_IO_PROTOCOL *DiskIo,
+ IN EFI_DISK_IO2_PROTOCOL *DiskIo2,
+ IN EFI_BLOCK_IO_PROTOCOL *BlockIo
);
/**
@@ -997,7 +1000,7 @@ FatAllocateVolume (
**/
EFI_STATUS
FatOpenDevice (
- IN OUT FAT_VOLUME *Volume
+ IN OUT FAT_VOLUME *Volume
);
/**
@@ -1012,12 +1015,13 @@ FatOpenDevice (
**/
EFI_STATUS
FatAbandonVolume (
- IN FAT_VOLUME *Volume
+ IN FAT_VOLUME *Volume
);
//
// Misc.c
//
+
/**
Create the task
@@ -1030,8 +1034,8 @@ FatAbandonVolume (
**/
FAT_TASK *
FatCreateTask (
- FAT_IFILE *IFile,
- EFI_FILE_IO_TOKEN *Token
+ FAT_IFILE *IFile,
+ EFI_FILE_IO_TOKEN *Token
);
/**
@@ -1043,7 +1047,7 @@ FatCreateTask (
**/
VOID
FatDestroyTask (
- FAT_TASK *Task
+ FAT_TASK *Task
);
/**
@@ -1055,7 +1059,7 @@ FatDestroyTask (
**/
VOID
FatWaitNonblockingTask (
- FAT_IFILE *IFile
+ FAT_IFILE *IFile
);
/**
@@ -1069,7 +1073,7 @@ FatWaitNonblockingTask (
**/
LIST_ENTRY *
FatDestroySubtask (
- FAT_SUBTASK *Subtask
+ FAT_SUBTASK *Subtask
);
/**
@@ -1085,8 +1089,8 @@ FatDestroySubtask (
**/
EFI_STATUS
FatQueueTask (
- IN FAT_IFILE *IFile,
- IN FAT_TASK *Task
+ IN FAT_IFILE *IFile,
+ IN FAT_TASK *Task
);
/**
@@ -1103,9 +1107,9 @@ FatQueueTask (
**/
EFI_STATUS
FatAccessVolumeDirty (
- IN FAT_VOLUME *Volume,
- IN IO_MODE IoMode,
- IN VOID *DirtyValue
+ IN FAT_VOLUME *Volume,
+ IN IO_MODE IoMode,
+ IN VOID *DirtyValue
);
/**
@@ -1126,12 +1130,12 @@ FatAccessVolumeDirty (
**/
EFI_STATUS
FatDiskIo (
- IN FAT_VOLUME *Volume,
- IN IO_MODE IoMode,
- IN UINT64 Offset,
- IN UINTN BufferSize,
- IN OUT VOID *Buffer,
- IN FAT_TASK *Task
+ IN FAT_VOLUME *Volume,
+ IN IO_MODE IoMode,
+ IN UINT64 Offset,
+ IN UINTN BufferSize,
+ IN OUT VOID *Buffer,
+ IN FAT_TASK *Task
);
/**
@@ -1178,7 +1182,7 @@ FatAcquireLockOrFail (
**/
VOID
FatFreeDirEnt (
- IN FAT_DIRENT *DirEnt
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1190,7 +1194,7 @@ FatFreeDirEnt (
**/
VOID
FatFreeVolume (
- IN FAT_VOLUME *Volume
+ IN FAT_VOLUME *Volume
);
/**
@@ -1203,8 +1207,8 @@ FatFreeVolume (
**/
VOID
FatEfiTimeToFatTime (
- IN EFI_TIME *ETime,
- OUT FAT_DATE_TIME *FTime
+ IN EFI_TIME *ETime,
+ OUT FAT_DATE_TIME *FTime
);
/**
@@ -1217,8 +1221,8 @@ FatEfiTimeToFatTime (
**/
VOID
FatFatTimeToEfiTime (
- IN FAT_DATE_TIME *FTime,
- OUT EFI_TIME *ETime
+ IN FAT_DATE_TIME *FTime,
+ OUT EFI_TIME *ETime
);
/**
@@ -1230,7 +1234,7 @@ FatFatTimeToEfiTime (
**/
VOID
FatGetCurrentFatTime (
- OUT FAT_DATE_TIME *FatTime
+ OUT FAT_DATE_TIME *FatTime
);
/**
@@ -1245,12 +1249,13 @@ FatGetCurrentFatTime (
**/
BOOLEAN
FatIsValidTime (
- IN EFI_TIME *Time
+ IN EFI_TIME *Time
);
//
// UnicodeCollation.c
//
+
/**
Initialize Unicode Collation support.
@@ -1266,7 +1271,7 @@ FatIsValidTime (
**/
EFI_STATUS
InitializeUnicodeCollationSupport (
- IN EFI_HANDLE AgentHandle
+ IN EFI_HANDLE AgentHandle
);
/**
@@ -1281,9 +1286,9 @@ InitializeUnicodeCollationSupport (
**/
VOID
FatFatToStr (
- IN UINTN FatSize,
- IN CHAR8 *Fat,
- OUT CHAR16 *String
+ IN UINTN FatSize,
+ IN CHAR8 *Fat,
+ OUT CHAR16 *String
);
/**
@@ -1299,9 +1304,9 @@ FatFatToStr (
**/
BOOLEAN
FatStrToFat (
- IN CHAR16 *String,
- IN UINTN FatSize,
- OUT CHAR8 *Fat
+ IN CHAR16 *String,
+ IN UINTN FatSize,
+ OUT CHAR8 *Fat
);
/**
@@ -1312,7 +1317,7 @@ FatStrToFat (
**/
VOID
FatStrLwr (
- IN CHAR16 *Str
+ IN CHAR16 *Str
);
/**
@@ -1323,7 +1328,7 @@ FatStrLwr (
**/
VOID
FatStrUpr (
- IN CHAR16 *Str
+ IN CHAR16 *Str
);
/**
@@ -1338,8 +1343,8 @@ FatStrUpr (
**/
INTN
FatStriCmp (
- IN CHAR16 *Str1,
- IN CHAR16 *Str2
+ IN CHAR16 *Str1,
+ IN CHAR16 *Str2
);
//
@@ -1370,11 +1375,11 @@ FatStriCmp (
**/
EFI_STATUS
FatOFileOpen (
- IN FAT_OFILE *OFile,
- OUT FAT_IFILE **NewIFile,
- IN CHAR16 *FileName,
- IN UINT64 OpenMode,
- IN UINT8 Attributes
+ IN FAT_OFILE *OFile,
+ OUT FAT_IFILE **NewIFile,
+ IN CHAR16 *FileName,
+ IN UINT64 OpenMode,
+ IN UINT8 Attributes
);
/**
@@ -1391,13 +1396,14 @@ FatOFileOpen (
**/
EFI_STATUS
FatAllocateIFile (
- IN FAT_OFILE *OFile,
- OUT FAT_IFILE **PtrIFile
+ IN FAT_OFILE *OFile,
+ OUT FAT_IFILE **PtrIFile
);
//
// OpenVolume.c
//
+
/**
Implements Simple File System Protocol interface function OpenVolume().
@@ -1413,13 +1419,14 @@ FatAllocateIFile (
EFI_STATUS
EFIAPI
FatOpenVolume (
- IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
- OUT EFI_FILE_PROTOCOL **File
+ IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **File
);
//
// ReadWrite.c
//
+
/**
This function reads data from a file or writes data to a file.
@@ -1438,12 +1445,12 @@ FatOpenVolume (
**/
EFI_STATUS
FatAccessOFile (
- IN FAT_OFILE *OFile,
- IN IO_MODE IoMode,
- IN UINTN Position,
- IN UINTN *DataBufferSize,
- IN UINT8 *UserBuffer,
- IN FAT_TASK *Task
+ IN FAT_OFILE *OFile,
+ IN IO_MODE IoMode,
+ IN UINTN Position,
+ IN UINTN *DataBufferSize,
+ IN UINT8 *UserBuffer,
+ IN FAT_TASK *Task
);
/**
@@ -1459,8 +1466,8 @@ FatAccessOFile (
**/
EFI_STATUS
FatExpandOFile (
- IN FAT_OFILE *OFile,
- IN UINT64 ExpandedSize
+ IN FAT_OFILE *OFile,
+ IN UINT64 ExpandedSize
);
/**
@@ -1477,8 +1484,8 @@ FatExpandOFile (
**/
EFI_STATUS
FatWriteZeroPool (
- IN FAT_OFILE *OFile,
- IN UINTN WritePos
+ IN FAT_OFILE *OFile,
+ IN UINTN WritePos
);
/**
@@ -1494,13 +1501,14 @@ FatWriteZeroPool (
**/
EFI_STATUS
FatTruncateOFile (
- IN FAT_OFILE *OFile,
- IN UINTN TruncatedSize
+ IN FAT_OFILE *OFile,
+ IN UINTN TruncatedSize
);
//
// DirectoryManage.c
//
+
/**
Set the OFile's current directory cursor to the list head.
@@ -1510,7 +1518,7 @@ FatTruncateOFile (
**/
VOID
FatResetODirCursor (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -1526,8 +1534,8 @@ FatResetODirCursor (
**/
EFI_STATUS
FatGetNextDirEnt (
- IN FAT_OFILE *OFile,
- OUT FAT_DIRENT **PtrDirEnt
+ IN FAT_OFILE *OFile,
+ OUT FAT_DIRENT **PtrDirEnt
);
/**
@@ -1543,8 +1551,8 @@ FatGetNextDirEnt (
**/
EFI_STATUS
FatRemoveDirEnt (
- IN FAT_OFILE *OFile,
- IN FAT_DIRENT *DirEnt
+ IN FAT_OFILE *OFile,
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1560,8 +1568,8 @@ FatRemoveDirEnt (
**/
EFI_STATUS
FatStoreDirEnt (
- IN FAT_OFILE *OFile,
- IN FAT_DIRENT *DirEnt
+ IN FAT_OFILE *OFile,
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1580,10 +1588,10 @@ FatStoreDirEnt (
**/
EFI_STATUS
FatCreateDirEnt (
- IN FAT_OFILE *OFile,
- IN CHAR16 *FileName,
- IN UINT8 Attributes,
- OUT FAT_DIRENT **PtrDirEnt
+ IN FAT_OFILE *OFile,
+ IN CHAR16 *FileName,
+ IN UINT8 Attributes,
+ OUT FAT_DIRENT **PtrDirEnt
);
/**
@@ -1598,7 +1606,7 @@ FatCreateDirEnt (
**/
BOOLEAN
FatIsDotDirEnt (
- IN FAT_DIRENT *DirEnt
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1610,7 +1618,7 @@ FatIsDotDirEnt (
**/
VOID
FatUpdateDirEntClusterSizeInfo (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -1623,8 +1631,8 @@ FatUpdateDirEntClusterSizeInfo (
**/
VOID
FatCloneDirEnt (
- IN FAT_DIRENT *DirEnt1,
- IN FAT_DIRENT *DirEnt2
+ IN FAT_DIRENT *DirEnt1,
+ IN FAT_DIRENT *DirEnt2
);
/**
@@ -1642,10 +1650,10 @@ FatCloneDirEnt (
**/
EFI_STATUS
FatGetDirEntInfo (
- IN FAT_VOLUME *Volume,
- IN FAT_DIRENT *DirEnt,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
+ IN FAT_VOLUME *Volume,
+ IN FAT_DIRENT *DirEnt,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
);
/**
@@ -1662,8 +1670,8 @@ FatGetDirEntInfo (
**/
EFI_STATUS
FatOpenDirEnt (
- IN FAT_OFILE *OFile,
- IN FAT_DIRENT *DirEnt
+ IN FAT_OFILE *OFile,
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1678,7 +1686,7 @@ FatOpenDirEnt (
**/
EFI_STATUS
FatCreateDotDirEnts (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -1690,7 +1698,7 @@ FatCreateDotDirEnts (
**/
VOID
FatCloseDirEnt (
- IN FAT_DIRENT *DirEnt
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1715,10 +1723,10 @@ FatCloseDirEnt (
**/
EFI_STATUS
FatLocateOFile (
- IN OUT FAT_OFILE **PtrOFile,
- IN CHAR16 *FileName,
- IN UINT8 Attributes,
- OUT CHAR16 *NewFileName
+ IN OUT FAT_OFILE **PtrOFile,
+ IN CHAR16 *FileName,
+ IN UINT8 Attributes,
+ OUT CHAR16 *NewFileName
);
/**
@@ -1734,8 +1742,8 @@ FatLocateOFile (
**/
EFI_STATUS
FatGetVolumeEntry (
- IN FAT_VOLUME *Volume,
- IN CHAR16 *Name
+ IN FAT_VOLUME *Volume,
+ IN CHAR16 *Name
);
/**
@@ -1752,13 +1760,14 @@ FatGetVolumeEntry (
**/
EFI_STATUS
FatSetVolumeEntry (
- IN FAT_VOLUME *Volume,
- IN CHAR16 *Name
+ IN FAT_VOLUME *Volume,
+ IN CHAR16 *Name
);
//
// Hash.c
//
+
/**
Search the long name hash table for the directory entry.
@@ -1771,8 +1780,8 @@ FatSetVolumeEntry (
**/
FAT_DIRENT **
FatLongNameHashSearch (
- IN FAT_ODIR *ODir,
- IN CHAR16 *LongNameString
+ IN FAT_ODIR *ODir,
+ IN CHAR16 *LongNameString
);
/**
@@ -1787,8 +1796,8 @@ FatLongNameHashSearch (
**/
FAT_DIRENT **
FatShortNameHashSearch (
- IN FAT_ODIR *ODir,
- IN CHAR8 *ShortNameString
+ IN FAT_ODIR *ODir,
+ IN CHAR8 *ShortNameString
);
/**
@@ -1801,8 +1810,8 @@ FatShortNameHashSearch (
**/
VOID
FatInsertToHashTable (
- IN FAT_ODIR *ODir,
- IN FAT_DIRENT *DirEnt
+ IN FAT_ODIR *ODir,
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1815,13 +1824,14 @@ FatInsertToHashTable (
**/
VOID
FatDeleteFromHashTable (
- IN FAT_ODIR *ODir,
- IN FAT_DIRENT *DirEnt
+ IN FAT_ODIR *ODir,
+ IN FAT_DIRENT *DirEnt
);
//
// FileName.c
//
+
/**
This function checks whether the input FileName is a valid 8.3 short name.
@@ -1837,8 +1847,8 @@ FatDeleteFromHashTable (
**/
BOOLEAN
FatCheckIs8Dot3Name (
- IN CHAR16 *FileName,
- OUT CHAR8 *File8Dot3Name
+ IN CHAR16 *FileName,
+ OUT CHAR8 *File8Dot3Name
);
/**
@@ -1851,8 +1861,8 @@ FatCheckIs8Dot3Name (
**/
VOID
FatCreate8Dot3Name (
- IN FAT_OFILE *Parent,
- IN FAT_DIRENT *DirEnt
+ IN FAT_OFILE *Parent,
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1868,10 +1878,10 @@ FatCreate8Dot3Name (
**/
VOID
FatNameToStr (
- IN CHAR8 *FatName,
- IN UINTN Len,
- IN UINTN LowerCase,
- IN CHAR16 *Str
+ IN CHAR8 *FatName,
+ IN UINTN Len,
+ IN UINTN LowerCase,
+ IN CHAR16 *Str
);
/**
@@ -1883,7 +1893,7 @@ FatNameToStr (
**/
VOID
FatSetCaseFlag (
- IN FAT_DIRENT *DirEnt
+ IN FAT_DIRENT *DirEnt
);
/**
@@ -1897,9 +1907,9 @@ FatSetCaseFlag (
**/
VOID
FatGetFileNameViaCaseFlag (
- IN FAT_DIRENT *DirEnt,
- IN OUT CHAR16 *FileString,
- IN UINTN FileStringMax
+ IN FAT_DIRENT *DirEnt,
+ IN OUT CHAR16 *FileString,
+ IN UINTN FileStringMax
);
/**
@@ -1913,7 +1923,7 @@ FatGetFileNameViaCaseFlag (
**/
UINT8
FatCheckSum (
- IN CHAR8 *ShortNameString
+ IN CHAR8 *ShortNameString
);
/**
@@ -1928,10 +1938,10 @@ FatCheckSum (
The position after Name in the Path
**/
-CHAR16*
+CHAR16 *
FatGetNextNameComponent (
- IN CHAR16 *Path,
- OUT CHAR16 *Name
+ IN CHAR16 *Path,
+ OUT CHAR16 *Name
);
/**
@@ -1956,6 +1966,7 @@ FatFileNameIsValid (
//
// DirectoryCache.c
//
+
/**
Discard the directory structure when an OFile will be freed.
@@ -1966,7 +1977,7 @@ FatFileNameIsValid (
**/
VOID
FatDiscardODir (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -1980,7 +1991,7 @@ FatDiscardODir (
**/
VOID
FatRequestODir (
- IN FAT_OFILE *OFile
+ IN FAT_OFILE *OFile
);
/**
@@ -1992,17 +2003,17 @@ FatRequestODir (
**/
VOID
FatCleanupODirCache (
- IN FAT_VOLUME *Volume
+ IN FAT_VOLUME *Volume
);
//
// Global Variables
//
-extern EFI_DRIVER_BINDING_PROTOCOL gFatDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gFatComponentName;
-extern EFI_COMPONENT_NAME2_PROTOCOL gFatComponentName2;
-extern EFI_LOCK FatFsLock;
-extern EFI_LOCK FatTaskLock;
-extern EFI_FILE_PROTOCOL FatFileInterface;
+extern EFI_DRIVER_BINDING_PROTOCOL gFatDriverBinding;
+extern EFI_COMPONENT_NAME_PROTOCOL gFatComponentName;
+extern EFI_COMPONENT_NAME2_PROTOCOL gFatComponentName2;
+extern EFI_LOCK FatFsLock;
+extern EFI_LOCK FatTaskLock;
+extern EFI_FILE_PROTOCOL FatFileInterface;
#endif