Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
//\r
// The directory entry for opened directory\r
//\r
//\r
// The directory entry for opened directory\r
//\r
-typedef struct _FAT_DIRENT {\r
+\r
+typedef struct _FAT_DIRENT FAT_DIRENT;\r
+typedef struct _FAT_ODIR FAT_ODIR;\r
+typedef struct _FAT_OFILE FAT_OFILE;\r
+typedef struct _FAT_VOLUME FAT_VOLUME;\r
+\r
+struct _FAT_DIRENT {\r
UINTN Signature;\r
UINT16 EntryPos; // The position of this directory entry in the parent directory file\r
UINT8 EntryCount; // The count of the directory entry in the parent directory file\r
BOOLEAN Invalid; // Indicate whether this directory entry is valid\r
CHAR16 *FileString; // The unicode long file name for this directory entry\r
UINTN Signature;\r
UINT16 EntryPos; // The position of this directory entry in the parent directory file\r
UINT8 EntryCount; // The count of the directory entry in the parent directory file\r
BOOLEAN Invalid; // Indicate whether this directory entry is valid\r
CHAR16 *FileString; // The unicode long file name for this directory entry\r
- struct _FAT_OFILE *OFile; // The OFile of the corresponding directory entry\r
- struct _FAT_DIRENT *ShortNameForwardLink; // Hash successor link for short filename\r
- struct _FAT_DIRENT *LongNameForwardLink; // Hash successor link for long filename\r
+ FAT_OFILE *OFile; // The OFile of the corresponding directory entry\r
+ FAT_DIRENT *ShortNameForwardLink; // Hash successor link for short filename\r
+ FAT_DIRENT *LongNameForwardLink; // Hash successor link for long filename\r
LIST_ENTRY Link; // Connection of every directory entry\r
FAT_DIRECTORY_ENTRY Entry; // The physical directory entry stored in disk\r
LIST_ENTRY Link; // Connection of every directory entry\r
FAT_DIRECTORY_ENTRY Entry; // The physical directory entry stored in disk\r
-typedef struct _FAT_ODIR {\r
UINTN Signature;\r
UINT32 CurrentEndPos; // Current end position of the directory\r
UINT32 CurrentPos; // Current position of the directory\r
UINTN Signature;\r
UINT32 CurrentEndPos; // Current end position of the directory\r
UINT32 CurrentPos; // Current position of the directory\r
UINTN DirCacheTag; // The identification of the directory when in directory cache\r
FAT_DIRENT *LongNameHashTable[HASH_TABLE_SIZE];\r
FAT_DIRENT *ShortNameHashTable[HASH_TABLE_SIZE];\r
UINTN DirCacheTag; // The identification of the directory when in directory cache\r
FAT_DIRENT *LongNameHashTable[HASH_TABLE_SIZE];\r
FAT_DIRENT *ShortNameHashTable[HASH_TABLE_SIZE];\r
\r
typedef struct {\r
UINTN Signature;\r
EFI_FILE_PROTOCOL Handle;\r
UINT64 Position;\r
BOOLEAN ReadOnly;\r
\r
typedef struct {\r
UINTN Signature;\r
EFI_FILE_PROTOCOL Handle;\r
UINT64 Position;\r
BOOLEAN ReadOnly;\r
- struct _FAT_OFILE *OFile;\r
LIST_ENTRY Tasks; // List of all FAT_TASKs\r
LIST_ENTRY Link; // Link to other IFiles\r
} FAT_IFILE;\r
LIST_ENTRY Tasks; // List of all FAT_TASKs\r
LIST_ENTRY Link; // Link to other IFiles\r
} FAT_IFILE;\r
//\r
// FAT_OFILE - Each opened file\r
//\r
//\r
// FAT_OFILE - Each opened file\r
//\r
-typedef struct _FAT_OFILE {\r
- struct _FAT_VOLUME *Volume;\r
//\r
// A permanant error code to return to all accesses to\r
// this opened file\r
//\r
// A permanant error code to return to all accesses to\r
// this opened file\r
//\r
// The opened parent, full path length and currently opened child files\r
//\r
//\r
// The opened parent, full path length and currently opened child files\r
//\r
- struct _FAT_OFILE *Parent;\r
UINTN FullPathLen;\r
LIST_ENTRY ChildHead;\r
LIST_ENTRY ChildLink;\r
UINTN FullPathLen;\r
LIST_ENTRY ChildHead;\r
LIST_ENTRY ChildLink;\r
// Link in Volume's reference list\r
//\r
LIST_ENTRY CheckLink;\r
// Link in Volume's reference list\r
//\r
LIST_ENTRY CheckLink;\r
-typedef struct _FAT_VOLUME {\r
UINTN Signature;\r
\r
EFI_HANDLE Handle;\r
UINTN Signature;\r
\r
EFI_HANDLE Handle;\r
// File Name of root OFile, it is empty string\r
//\r
CHAR16 RootFileString[1];\r
// File Name of root OFile, it is empty string\r
//\r
CHAR16 RootFileString[1];\r
- struct _FAT_OFILE *Root;\r
\r
//\r
// New OFiles are added to this list so they\r
\r
//\r
// New OFiles are added to this list so they\r
//\r
VOID *CacheBuffer;\r
DISK_CACHE DiskCache[CacheMaxType];\r
//\r
VOID *CacheBuffer;\r
DISK_CACHE DiskCache[CacheMaxType];\r
\r
//\r
// Function Prototypes\r
\r
//\r
// Function Prototypes\r
CHAR8 SystemId[8];\r
} FAT32_BOOT_SECTOR_EXT;\r
\r
CHAR8 SystemId[8];\r
} FAT32_BOOT_SECTOR_EXT;\r
\r
-typedef struct {\r
- FAT_BOOT_SECTOR_BASIC FatBsb;\r
- union {\r
FAT_BOOT_SECTOR_EXT FatBse;\r
FAT32_BOOT_SECTOR_EXT Fat32Bse;\r
FAT_BOOT_SECTOR_EXT FatBse;\r
FAT32_BOOT_SECTOR_EXT Fat32Bse;\r
+ } FAT_BSE;\r
+\r
+typedef struct {\r
+ FAT_BOOT_SECTOR_BASIC FatBsb;\r
+ FAT_BSE FatBse;\r
} FAT_BOOT_SECTOR;\r
\r
//\r
} FAT_BOOT_SECTOR;\r
\r
//\r