TianoCore EDK2 master
|
#include <Uefi.h>
#include <Guid/FileInfo.h>
#include <Guid/FileSystemInfo.h>
#include <Guid/FileSystemVolumeLabelInfo.h>
#include <Protocol/BlockIo.h>
#include <Protocol/DiskIo.h>
#include <Protocol/DiskIo2.h>
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/UnicodeCollation.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include "FatFileSystem.h"
Go to the source code of this file.
Data Structures | |
struct | CACHE_TAG |
struct | DISK_CACHE |
struct | _FAT_DIRENT |
struct | _FAT_ODIR |
struct | FAT_IFILE |
struct | FAT_TASK |
struct | FAT_SUBTASK |
struct | _FAT_OFILE |
struct | _FAT_VOLUME |
Macros | |
#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 | 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 | 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 | 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_CHILDLINK(a) CR (a, FAT_OFILE, ChildLink, FAT_OFILE_SIGNATURE) |
#define | MAX_BLOCK_ALIGNMENT 12 |
#define | MIN_BLOCK_ALIGNMENT 9 |
#define | MAX_SECTORS_PER_CLUSTER_ALIGNMENT 7 |
#define | IS_LEAP_YEAR(a) (((a) % 4 == 0) && (((a) % 100 != 0) || ((a) % 400 == 0))) |
#define | FAT_FATCACHE_PAGE_MIN_ALIGNMENT 13 |
#define | FAT_FATCACHE_PAGE_MAX_ALIGNMENT 15 |
#define | FAT_DATACACHE_PAGE_MIN_ALIGNMENT 13 |
#define | FAT_DATACACHE_PAGE_MAX_ALIGNMENT 16 |
#define | FAT_DATACACHE_GROUP_COUNT 64 |
#define | FAT_FATCACHE_GROUP_MIN_COUNT 1 |
#define | FAT_FATCACHE_GROUP_MAX_COUNT 16 |
#define | BITS_PER_BYTE 8 |
#define | DIRTY_BITS_PER_BLOCK ((sizeof (DIRTY_BLOCKS) * BITS_PER_BYTE)) |
#define | DIRTY_BITS ((1 << FAT_DATACACHE_PAGE_MAX_ALIGNMENT) / (1 << MIN_BLOCK_ALIGNMENT)) |
#define | DIRTY_BLOCKS_SIZE (DIRTY_BITS / sizeof (DIRTY_BLOCKS)) |
#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 | 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 | FAT_MAX_DIR_CACHE_COUNT 8 |
#define | FAT_MAX_DIRENTRY_COUNT 0xFFFF |
#define | CACHE_ENABLED(a) ((a) >= 2) |
#define | RAW_ACCESS(a) ((IO_MODE)((a) & 0x1)) |
#define | CACHE_TYPE(a) ((CACHE_DATA_TYPE)((a) >> 2)) |
#define | HASH_TABLE_SIZE 0x400 |
#define | HASH_TABLE_MASK (HASH_TABLE_SIZE - 1) |
Typedefs | |
typedef UINT64 | DIRTY_BLOCKS |
typedef CHAR8 | LC_ISO_639_2 |
typedef struct _FAT_DIRENT | FAT_DIRENT |
typedef struct _FAT_ODIR | FAT_ODIR |
typedef struct _FAT_OFILE | FAT_OFILE |
typedef struct _FAT_VOLUME | FAT_VOLUME |
Main header file for EFI FAT file system driver.
Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Fat.h.
#define ASSERT_VOLUME_LOCKED | ( | a | ) | ASSERT_LOCKED (&FatFsLock) |
#define DIRENT_FROM_LINK | ( | a | ) | CR (a, FAT_DIRENT, Link, FAT_DIRENT_SIGNATURE) |
#define DIRTY_BITS ((1 << FAT_DATACACHE_PAGE_MAX_ALIGNMENT) / (1 << MIN_BLOCK_ALIGNMENT)) |
#define DIRTY_BITS_PER_BLOCK ((sizeof (DIRTY_BLOCKS) * BITS_PER_BYTE)) |
#define FAT_DIRENT_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'e') |
#define FAT_IFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'i') |
#define FAT_ODIR_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'd') |
#define FAT_OFILE_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'o') |
#define FAT_SUBTASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'S') |
#define FAT_TASK_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'T') |
#define FAT_VOLUME_SIGNATURE SIGNATURE_32 ('f', 'a', 't', 'v') |
#define HASH_VALUE_TAG_LEN (SPEC_BASE_TAG_LEN - HASH_BASE_TAG_LEN) |
#define IS_LEAP_YEAR | ( | a | ) | (((a) % 4 == 0) && (((a) % 100 != 0) || ((a) % 400 == 0))) |
#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); |
typedef struct _FAT_DIRENT FAT_DIRENT |
typedef struct _FAT_OFILE FAT_OFILE |
typedef struct _FAT_VOLUME FAT_VOLUME |
EFI_STATUS FatAbandonVolume | ( | IN FAT_VOLUME * | Volume | ) |
Called by FatDriverBindingStop(), Abandon the volume.
Volume | - The volume to be abandoned. |
EFI_SUCCESS | - Abandoned the volume successfully. |
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 | ||
) |
Read BufferSize bytes from the position of Offset into Buffer, or write BufferSize bytes from Buffer into the position of Offset.
Base on the parameter of CACHE_DATA_TYPE, the data access will be divided into the access of FAT cache (CACHE_FAT) and the access of Data cache (CACHE_DATA):
Volume | - FAT file system volume. |
CacheDataType | - The type of cache: CACHE_DATA or CACHE_FAT. |
IoMode | - Indicate the type of disk access. |
Offset | - The starting byte offset to read from. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing cache data. |
Task | point to task instance. |
EFI_SUCCESS | - The data was accessed correctly. |
EFI_MEDIA_CHANGED | - The MediaId does not match the current device. |
Definition at line 493 of file DiskCache.c.
EFI_STATUS FatAccessOFile | ( | IN FAT_OFILE * | OFile, |
IN IO_MODE | IoMode, | ||
IN UINTN | Position, | ||
IN UINTN * | DataBufferSize, | ||
IN UINT8 * | UserBuffer, | ||
IN FAT_TASK * | Task | ||
) |
This function reads data from a file or writes data to a file. It uses OFile->PosRem to determine how much data can be accessed in one time.
OFile | - The open file. |
IoMode | - Indicate whether the access mode is reading or writing. |
Position | - The position where data will be accessed. |
DataBufferSize | - Size of Buffer. |
UserBuffer | - Buffer containing data. |
Task | point to task instance. |
EFI_SUCCESS | - Access the data successfully. |
EFI_STATUS FatAccessVolumeDirty | ( | IN FAT_VOLUME * | Volume, |
IN IO_MODE | IoMode, | ||
IN VOID * | DirtyValue | ||
) |
Set the volume as dirty or not.
Volume | - FAT file system volume. |
IoMode | - The access mode. |
DirtyValue | - Set the volume as dirty or not. |
EFI_SUCCESS | - Set the new FAT entry value successfully. |
EFI_STATUS FatAcquireLockOrFail | ( | VOID | ) |
Lock the volume. If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned. Otherwise, EFI_SUCCESS is returned.
EFI_SUCCESS | - The volume is locked. |
EFI_ACCESS_DENIED | - The volume could not be locked because it is already locked. |
EFI_STATUS FatAllocateIFile | ( | IN FAT_OFILE * | OFile, |
OUT FAT_IFILE ** | PtrIFile | ||
) |
Create an Open instance for the existing OFile. The IFile of the newly opened file is passed out.
OFile | - The file that serves as a starting reference point. |
PtrIFile | - The newly generated IFile instance. |
EFI_OUT_OF_RESOURCES | - Can not allocate the memory for the IFile |
EFI_SUCCESS | - Create the new IFile for the OFile successfully |
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 | ||
) |
Allocates volume structure, detects FAT file system, installs protocol, and initialize cache.
Handle | - The handle of parent device. |
DiskIo | - The DiskIo of parent device. |
DiskIo2 | - The DiskIo2 of parent device. |
BlockIo | - The BlockIo of parent device. |
EFI_SUCCESS | - Allocate a new volume successfully. |
EFI_OUT_OF_RESOURCES | - Can not allocate the memory. |
This function checks whether the input FileName is a valid 8.3 short name. If the input FileName is a valid 8.3, the output is the 8.3 short name; otherwise, the output is the base tag of 8.3 short name.
FileName | - The input unicode filename. |
File8Dot3Name | - The output ascii 8.3 short name or base tag of 8.3 short name. |
TRUE | - The input unicode filename is a valid 8.3 short name. |
FALSE | - The input unicode filename is not a valid 8.3 short name. |
Definition at line 25 of file FileName.c.
UINT8 FatCheckSum | ( | IN CHAR8 * | ShortNameString | ) |
Get the Check sum for a short name.
ShortNameString | - The short name for a file. |
Sum | - UINT8 checksum. |
Definition at line 382 of file FileName.c.
VOID FatCleanupODirCache | ( | IN FAT_VOLUME * | Volume | ) |
Clean up all the cached directory structures when the volume is going to be abandoned.
Volume | - FAT file system volume. |
Definition at line 175 of file DirectoryCache.c.
EFI_STATUS FatCleanupVolume | ( | IN FAT_VOLUME * | Volume, |
IN FAT_OFILE * | OFile, | ||
IN EFI_STATUS | EfiStatus, | ||
IN FAT_TASK * | Task | ||
) |
Set error status for a specific OFile, reference checking the volume. If volume is already marked as invalid, and all resources are freed after reference checking, the file system protocol is uninstalled and the volume structure is freed.
Volume | - the Volume that is to be reference checked and unlocked. |
OFile | - the OFile whose permanent error code is to be set. |
EfiStatus | - error code to be set. |
Task | point to task instance. |
EFI_SUCCESS | - Clean up the volume successfully. |
VOID FatCloneDirEnt | ( | IN FAT_DIRENT * | DirEnt1, |
IN FAT_DIRENT * | DirEnt2 | ||
) |
Copy all the information of DirEnt2 to DirEnt1 except for 8.3 name.
DirEnt1 | - The destination directory entry. |
DirEnt2 | - The source directory entry. |
Definition at line 205 of file DirectoryManage.c.
EFI_STATUS EFIAPI FatClose | ( | IN EFI_FILE_PROTOCOL * | FHand | ) |
VOID FatCloseDirEnt | ( | IN FAT_DIRENT * | DirEnt | ) |
Close the directory entry and free the OFile.
DirEnt | - The directory entry to be closed. |
Definition at line 1216 of file DirectoryManage.c.
VOID FatComputeFreeInfo | ( | IN FAT_VOLUME * | Volume | ) |
Update the free cluster info of FatInfoSector of the volume.
Volume | - FAT file system volume. |
Definition at line 720 of file FileSpace.c.
VOID FatCreate8Dot3Name | ( | IN FAT_OFILE * | Parent, |
IN FAT_DIRENT * | DirEnt | ||
) |
This function generates 8Dot3 name from user specified name for a newly created file.
Parent | - The parent directory. |
DirEnt | - The directory entry whose 8Dot3Name needs to be generated. |
Definition at line 169 of file FileName.c.
EFI_STATUS FatCreateDirEnt | ( | IN FAT_OFILE * | OFile, |
IN CHAR16 * | FileName, | ||
IN UINT8 | Attributes, | ||
OUT FAT_DIRENT ** | PtrDirEnt | ||
) |
Create a directory entry in the parent OFile.
OFile | - The parent OFile. |
FileName | - The filename of the newly-created directory entry. |
Attributes | - The attribute of the newly-created directory entry. |
PtrDirEnt | - The pointer to the newly-created directory entry. |
EFI_SUCCESS | - The directory entry is successfully created. |
EFI_OUT_OF_RESOURCES | - Not enough memory to create the directory entry. |
Definition at line 1040 of file DirectoryManage.c.
EFI_STATUS FatCreateDotDirEnts | ( | IN FAT_OFILE * | OFile | ) |
Create "." and ".." directory entries in the newly-created parent OFile.
OFile | - The parent OFile. |
EFI_SUCCESS | - The dot directory entries are successfully created. |
Definition at line 997 of file DirectoryManage.c.
FAT_TASK * FatCreateTask | ( | FAT_IFILE * | IFile, |
EFI_FILE_IO_TOKEN * | Token | ||
) |
EFI_STATUS EFIAPI FatDelete | ( | IN EFI_FILE_PROTOCOL * | FHand | ) |
VOID FatDeleteFromHashTable | ( | IN FAT_ODIR * | ODir, |
IN FAT_DIRENT * | DirEnt | ||
) |
LIST_ENTRY * FatDestroySubtask | ( | FAT_SUBTASK * | Subtask | ) |
VOID FatDestroyTask | ( | FAT_TASK * | Task | ) |
Discard the directory structure when an OFile will be freed. Volume will cache this directory if the OFile does not represent a deleted file.
OFile | - The OFile whose directory structure is to be discarded. |
Definition at line 80 of file DirectoryCache.c.
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 | ||
) |
General disk access function.
Volume | - FAT file system volume. |
IoMode | - The access mode (disk read/write or cache access). |
Offset | - The starting byte offset to read from. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing read data. |
Task | point to task instance. |
EFI_SUCCESS | - The operation is performed successfully. |
EFI_VOLUME_CORRUPTED | - The access is |
VOID FatEfiTimeToFatTime | ( | IN EFI_TIME * | ETime, |
OUT FAT_DATE_TIME * | FTime | ||
) |
Translate EFI time to FAT time.
ETime | - The time of EFI_TIME. |
FTime | - The time of FAT_DATE_TIME. |
EFI_STATUS FatExpandOFile | ( | IN FAT_OFILE * | OFile, |
IN UINT64 | ExpandedSize | ||
) |
Expand OFile by appending zero bytes at the end of OFile.
OFile | - The open file. |
ExpandedSize | - The number of zero bytes appended at the end of the file. |
EFI_SUCCESS | - The file is expanded successfully. |
Definition at line 537 of file ReadWrite.c.
VOID FatFatTimeToEfiTime | ( | IN FAT_DATE_TIME * | FTime, |
OUT EFI_TIME * | ETime | ||
) |
Translate Fat time to EFI time.
FTime | - The time of FAT_DATE_TIME. |
ETime | - The time of EFI_TIME.. |
Convert FAT string to unicode string.
FatSize | The size of FAT string. |
Fat | The FAT string. |
String | The unicode string. |
Definition at line 227 of file UnicodeCollation.c.
Check whether the IFileName is valid long file name. If the IFileName is a valid long file name, then we trim the possible leading blanks and leading/trailing dots. the trimmed filename is stored in OutputFileName
InputFileName | - The input file name. |
OutputFileName | - The output file name. |
TRUE | - The InputFileName is a valid long file name. |
FALSE | - The InputFileName is not a valid long file name. |
Definition at line 444 of file FileName.c.
EFI_STATUS EFIAPI FatFlush | ( | IN EFI_FILE_PROTOCOL * | FHand | ) |
Flushes all data associated with the file handle.
FHand | - Handle to file to flush |
EFI_SUCCESS | - Flushed the file successfully |
EFI_WRITE_PROTECTED | - The volume is read only |
EFI_ACCESS_DENIED | - The volume is not read only but the file is read only |
Flushes all data associated with the file handle.
FHand | - Handle to file to flush. |
EFI_SUCCESS | - Flushed the file successfully. |
EFI_WRITE_PROTECTED | - The volume is read only. |
EFI_ACCESS_DENIED | - The file is read only. |
EFI_STATUS EFIAPI FatFlushEx | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN EFI_FILE_IO_TOKEN * | Token | ||
) |
Flushes all data associated with the file handle.
FHand | - Handle to file to flush. |
Token | - A pointer to the token associated with the transaction. |
EFI_SUCCESS | - Flushed the file successfully. |
EFI_WRITE_PROTECTED | - The volume is read only. |
EFI_ACCESS_DENIED | - The file is read only. |
VOID FatFreeDirEnt | ( | IN FAT_DIRENT * | DirEnt | ) |
VOID FatFreeVolume | ( | IN FAT_VOLUME * | Volume | ) |
VOID FatGetCurrentFatTime | ( | OUT FAT_DATE_TIME * | FatNow | ) |
EFI_STATUS FatGetDirEntInfo | ( | IN FAT_VOLUME * | Volume, |
IN FAT_DIRENT * | DirEnt, | ||
IN OUT UINTN * | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Get the directory entry's info into Buffer.
Volume | - FAT file system volume. |
DirEnt | - The corresponding directory entry. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing file info. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_BUFFER_TOO_SMALL | - The buffer is too small. |
Definition at line 448 of file DirectoryManage.c.
VOID FatGetFileNameViaCaseFlag | ( | IN FAT_DIRENT * | DirEnt, |
IN OUT CHAR16 * | FileString, | ||
IN UINTN | FileStringMax | ||
) |
Convert the 8.3 ASCII fat name to cased Unicode string according to case flag.
DirEnt | - The corresponding directory entry. |
FileString | - The output Unicode file name. |
FileStringMax | The max length of FileString. |
Definition at line 348 of file FileName.c.
EFI_STATUS EFIAPI FatGetInfo | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN EFI_GUID * | Type, | ||
IN OUT UINTN * | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Get the some types info of the file into Buffer
FHand | - The handle of file. |
Type | - The type of the info. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing volume info. |
EFI_SUCCESS | - Get the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
Get the some types info of the file into Buffer.
FHand | - The handle of file. |
Type | - The type of the info. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing volume info. |
EFI_SUCCESS | - Get the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_STATUS FatGetNextDirEnt | ( | IN FAT_OFILE * | OFile, |
OUT FAT_DIRENT ** | PtrDirEnt | ||
) |
Set the directory's cursor to the next and get the next directory entry.
OFile | - The parent OFile. |
PtrDirEnt | - The next directory entry. |
EFI_SUCCESS | - We get the next directory entry successfully. |
Definition at line 597 of file DirectoryManage.c.
Takes Path as input, returns the next name component in Name, and returns the position after Name (e.g., the start of the next name component)
Path | - The path of one file. |
Name | - The next name component in Path. |
The position after Name in the Path
Definition at line 410 of file FileName.c.
EFI_STATUS EFIAPI FatGetPosition | ( | IN EFI_FILE_PROTOCOL * | FHand, |
OUT UINT64 * | Position | ||
) |
Get the file's position of the file
FHand | - The handle of file. |
Position | - The file's position of the file. |
EFI_SUCCESS | - Get the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_UNSUPPORTED | - The open file is not a file. |
Get the file's position of the file.
FHand | - The handle of file. |
Position | - The file's position of the file. |
EFI_SUCCESS | - Get the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_UNSUPPORTED | - The open file is not a file. |
Definition at line 27 of file ReadWrite.c.
EFI_STATUS FatGetVolumeEntry | ( | IN FAT_VOLUME * | Volume, |
IN CHAR16 * | Name | ||
) |
Get the directory entry for the volume.
Volume | - FAT file system volume. |
Name | - The file name of the volume. |
EFI_SUCCESS | - Update the volume with the directory entry successfully. |
Definition at line 916 of file DirectoryManage.c.
EFI_STATUS FatGrowEof | ( | IN FAT_OFILE * | OFile, |
IN UINT64 | NewSizeInBytes | ||
) |
Grow the end of the open file base on the NewSizeInBytes.
OFile | - The open file. |
NewSizeInBytes | - The new size in bytes of the open file. |
EFI_SUCCESS | - The file is grown successfully. |
EFI_UNSUPPORTED | - The file size is larger than 4GB. |
EFI_VOLUME_CORRUPTED | - There are errors in the files' clusters. |
EFI_VOLUME_FULL | - The volume is full and can not grow the file. |
Definition at line 429 of file FileSpace.c.
EFI_STATUS FatIFileClose | ( | FAT_IFILE * | IFile | ) |
EFI_STATUS FatInitializeDiskCache | ( | IN FAT_VOLUME * | Volume | ) |
Initialize the disk cache according to Volume's FatType.
Volume | - FAT file system volume. |
EFI_SUCCESS | - The disk cache is successfully initialized. |
EFI_OUT_OF_RESOURCES | - Not enough memory to allocate disk cache. |
Definition at line 649 of file DiskCache.c.
VOID FatInsertToHashTable | ( | IN FAT_ODIR * | ODir, |
IN FAT_DIRENT * | DirEnt | ||
) |
BOOLEAN FatIsDotDirEnt | ( | IN FAT_DIRENT * | DirEnt | ) |
Determine whether the directory entry is "." or ".." entry.
DirEnt | - The corresponding directory entry. |
TRUE | - The directory entry is "." or ".." directory entry |
FALSE | - The directory entry is not "." or ".." directory entry |
Definition at line 143 of file DirectoryManage.c.
EFI_STATUS FatLocateOFile | ( | IN OUT FAT_OFILE ** | PtrOFile, |
IN CHAR16 * | FileName, | ||
IN UINT8 | Attributes, | ||
OUT CHAR16 * | NewFileName | ||
) |
Traverse filename and open all OFiles that can be opened. Update filename pointer to the component that can't be opened. If more than one name component remains, returns an error; otherwise, return the remaining name component so that the caller might choose to create it.
PtrOFile | - As input, the reference OFile; as output, the located OFile. |
FileName | - The file name relevant to the OFile. |
Attributes | - The attribute of the destination OFile. |
NewFileName | - The remaining file name. |
EFI_NOT_FOUND | - The file name can't be opened and there is more than one components within the name left (this means the name can not be created either). |
EFI_INVALID_PARAMETER | - The parameter is not valid. |
EFI_SUCCESS | - Open the file successfully. |
Definition at line 1268 of file DirectoryManage.c.
FAT_DIRENT ** FatLongNameHashSearch | ( | IN FAT_ODIR * | ODir, |
IN CHAR16 * | LongNameString | ||
) |
Convert the ascii fat name to the unicode string and strip trailing spaces, and if necessary, convert the unicode string to lower case.
FatName | - The Char8 string needs to be converted. |
Len | - The length of the fat name. |
LowerCase | - Indicate whether to convert the string to lower case. |
Str | - The result of the conversion. |
EFI_STATUS FatOFileFlush | ( | IN FAT_OFILE * | OFile | ) |
Flush the data associated with an open file. In this implementation, only last Mod/Access time is updated.
OFile | - The open file. |
EFI_SUCCESS | - The OFile is flushed successfully. |
EFI_STATUS FatOFileOpen | ( | IN FAT_OFILE * | OFile, |
OUT FAT_IFILE ** | NewIFile, | ||
IN CHAR16 * | FileName, | ||
IN UINT64 | OpenMode, | ||
IN UINT8 | Attributes | ||
) |
Open a file for a file name relative to an existing OFile. The IFile of the newly opened file is passed out.
OFile | - The file that serves as a starting reference point. |
NewIFile | - The newly generated IFile instance. |
FileName | - The file name relative to the OFile. |
OpenMode | - Open mode. |
Attributes | - Attributes to set if the file is created. |
EFI_SUCCESS | - Open the file successfully. |
EFI_INVALID_PARAMETER | - The open mode is conflict with the attributes or the file name is not valid. |
EFI_NOT_FOUND | - Conflicts between dir intention and attribute. |
EFI_WRITE_PROTECTED | - Can't open for write if the volume is read only. |
EFI_ACCESS_DENIED | - If the file's attribute is read only, and the open is for read-write fail it. |
EFI_OUT_OF_RESOURCES | - Can not allocate the memory. |
Seek OFile to requested position, and calculate the number of consecutive clusters from the position in the file
OFile | - The open file. |
Position | - The file's position which will be accessed. |
PosLimit | - The maximum length current reading/writing may access |
EFI_SUCCESS | - Set the info successfully. |
EFI_VOLUME_CORRUPTED | - Cluster chain corrupt. |
Definition at line 562 of file FileSpace.c.
EFI_STATUS EFIAPI FatOpen | ( | IN EFI_FILE_PROTOCOL * | FHand, |
OUT EFI_FILE_PROTOCOL ** | NewHandle, | ||
IN CHAR16 * | FileName, | ||
IN UINT64 | OpenMode, | ||
IN UINT64 | Attributes | ||
) |
Implements Open() of Simple File System Protocol.
FHand | - File handle of the file serves as a starting reference point. |
NewHandle | - Handle of the file that is newly opened. |
FileName | - File name relative to FHand. |
OpenMode | - Open mode. |
Attributes | - Attributes to set if the file is created. |
EFI_INVALID_PARAMETER | - The FileName is NULL or the file string is empty. The OpenMode is not supported. The Attributes is not the valid attributes. |
EFI_OUT_OF_RESOURCES | - Can not allocate the memory for file string. |
EFI_SUCCESS | - Open the file successfully. |
EFI_STATUS FatOpenDevice | ( | IN OUT FAT_VOLUME * | Volume | ) |
Detects FAT file system on Disk and set relevant fields of Volume.
Volume | - The volume structure. |
EFI_SUCCESS | - The Fat File System is detected successfully |
EFI_UNSUPPORTED | - The volume is not FAT file system. |
EFI_VOLUME_CORRUPTED | - The volume is corrupted. |
EFI_STATUS FatOpenDirEnt | ( | IN FAT_OFILE * | Parent, |
IN FAT_DIRENT * | DirEnt | ||
) |
Open the directory entry to get the OFile.
Parent | - The parent OFile. |
DirEnt | - The directory entry to be opened. |
EFI_SUCCESS | - The directory entry is successfully opened. |
EFI_OUT_OF_RESOURCES | - not enough memory to allocate a new OFile. |
Definition at line 1142 of file DirectoryManage.c.
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 | ||
) |
Implements OpenEx() of Simple File System Protocol.
FHand | - File handle of the file serves as a starting reference point. |
NewHandle | - Handle of the file that is newly opened. |
FileName | - File name relative to FHand. |
OpenMode | - Open mode. |
Attributes | - Attributes to set if the file is created. |
Token | - A pointer to the token associated with the transaction. |
EFI_INVALID_PARAMETER | - The FileName is NULL or the file string is empty. The OpenMode is not supported. The Attributes is not the valid attributes. |
EFI_OUT_OF_RESOURCES | - Can not allocate the memory for file string. |
EFI_SUCCESS | - Open the file successfully. |
Implements OpenEx() of Simple File System Protocol.
FHand | - File handle of the file serves as a starting reference point. |
NewHandle | - Handle of the file that is newly opened. |
FileName | - File name relative to FHand. |
OpenMode | - Open mode. |
Attributes | - Attributes to set if the file is created. |
Token | - A pointer to the token associated with the transaction.: |
EFI_INVALID_PARAMETER | - The FileName is NULL or the file string is empty. The OpenMode is not supported. The Attributes is not the valid attributes. |
EFI_OUT_OF_RESOURCES | - Can not allocate the memory for file string. |
EFI_SUCCESS | - Open the file successfully. |
EFI_STATUS EFIAPI FatOpenVolume | ( | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * | This, |
OUT EFI_FILE_PROTOCOL ** | File | ||
) |
Implements Simple File System Protocol interface function OpenVolume().
This | - Calling context. |
File | - the Root Directory of the volume. |
EFI_OUT_OF_RESOURCES | - Can not allocate the memory. |
EFI_VOLUME_CORRUPTED | - The FAT type is error. |
EFI_SUCCESS | - Open the volume successfully. |
Definition at line 25 of file OpenVolume.c.
UINTN FatPhysicalDirSize | ( | IN FAT_VOLUME * | Volume, |
IN UINTN | Cluster | ||
) |
Get the size of directory of the open file.
Volume | - The File System Volume. |
Cluster | - The Starting cluster. |
Definition at line 654 of file FileSpace.c.
UINT64 FatPhysicalFileSize | ( | IN FAT_VOLUME * | Volume, |
IN UINTN | RealSize | ||
) |
Get the physical size of a file on the disk.
Volume | - The file system volume. |
RealSize | - The real size of a file. |
Definition at line 699 of file FileSpace.c.
EFI_STATUS FatQueueTask | ( | IN FAT_IFILE * | IFile, |
IN FAT_TASK * | Task | ||
) |
EFI_STATUS EFIAPI FatRead | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT UINTN * | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Get the file info.
FHand | - The handle of the file. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing read data. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_VOLUME_CORRUPTED | - The file type of open file is error. |
Definition at line 360 of file ReadWrite.c.
EFI_STATUS EFIAPI FatReadEx | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT EFI_FILE_IO_TOKEN * | Token | ||
) |
Get the file info.
FHand | - The handle of the file. |
Token | - A pointer to the token associated with the transaction. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_VOLUME_CORRUPTED | - The file type of open file is error. |
Definition at line 384 of file ReadWrite.c.
EFI_STATUS FatRemoveDirEnt | ( | IN FAT_OFILE * | OFile, |
IN FAT_DIRENT * | DirEnt | ||
) |
Remove this directory entry node from the list of directory entries and hash table.
OFile | - The parent OFile. |
DirEnt | - The directory entry to be removed. |
EFI_SUCCESS | - The directory entry is successfully removed. |
Definition at line 1101 of file DirectoryManage.c.
Request the directory structure when an OFile is newly generated. If the directory structure is cached by volume, then just return this directory; Otherwise, allocate a new one for OFile.
OFile | - The OFile which requests directory structure. |
Definition at line 130 of file DirectoryCache.c.
Set the OFile's current directory cursor to the list head.
OFile | - The directory OFile whose directory cursor is reset. |
Definition at line 573 of file DirectoryManage.c.
VOID FatSetCaseFlag | ( | IN FAT_DIRENT * | DirEnt | ) |
Set the caseflag value for the directory entry.
DirEnt | - The logical directory entry whose caseflag value is to be set. |
Definition at line 293 of file FileName.c.
EFI_STATUS EFIAPI FatSetInfo | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN EFI_GUID * | Type, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Set the some types info of the file into Buffer.
FHand | - The handle of file. |
Type | - The type of the info. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing volume info. |
EFI_SUCCESS | - Set the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
Set the some types info of the file into Buffer.
FHand | - The handle of file. |
Type | - The type of the info. |
BufferSize | - Size of Buffer |
Buffer | - Buffer containing volume info. |
EFI_SUCCESS | - Set the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_STATUS EFIAPI FatSetPosition | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN UINT64 | Position | ||
) |
Set the file's position of the file.
FHand | - The handle of file |
Position | - The file's position of the file |
EFI_SUCCESS | - Set the info successfully |
EFI_DEVICE_ERROR | - Can not find the OFile for the file |
EFI_UNSUPPORTED | - Set a directory with a not-zero position |
Set the file's position of the file.
FHand | - The handle of file. |
Position | - The file's position of the file. |
EFI_SUCCESS | - Set the info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_UNSUPPORTED | - Set a directory with a not-zero position. |
Definition at line 64 of file ReadWrite.c.
EFI_STATUS FatSetVolumeEntry | ( | IN FAT_VOLUME * | Volume, |
IN CHAR16 * | Name | ||
) |
Set the relevant directory entry into disk for the volume.
Volume | - FAT file system volume. |
Name | - The new file name of the volume. |
EFI_SUCCESS | - Update the Volume successfully. |
EFI_UNSUPPORTED | - The input label is not a valid volume label. |
Definition at line 948 of file DirectoryManage.c.
VOID FatSetVolumeError | ( | IN FAT_OFILE * | OFile, |
IN EFI_STATUS | Status | ||
) |
FAT_DIRENT ** FatShortNameHashSearch | ( | IN FAT_ODIR * | ODir, |
IN CHAR8 * | ShortNameString | ||
) |
EFI_STATUS FatShrinkEof | ( | IN FAT_OFILE * | OFile | ) |
Shrink the end of the open file base on the file size.
OFile | - The open file. |
EFI_SUCCESS | - Shrinked successfully. |
EFI_VOLUME_CORRUPTED | - There are errors in the file's clusters. |
Definition at line 355 of file FileSpace.c.
EFI_STATUS FatStoreDirEnt | ( | IN FAT_OFILE * | OFile, |
IN FAT_DIRENT * | DirEnt | ||
) |
Save the directory entry to disk.
OFile | - The parent OFile which needs to update. |
DirEnt | - The directory entry to be saved. |
EFI_SUCCESS | - Store the directory entry successfully. |
Definition at line 63 of file DirectoryManage.c.
Performs a case-insensitive comparison of two Null-terminated Unicode strings.
Str1 | A pointer to a Null-terminated Unicode string. |
Str2 | A pointer to a Null-terminated Unicode string. |
0 | S1 is equivalent to S2. |
>0 | S1 is lexically greater than S2. |
<0 | S1 is lexically less than S2. |
Performs a case-insensitive comparison of two Null-terminated Unicode strings.
S1 | A pointer to a Null-terminated Unicode string. |
S2 | A pointer to a Null-terminated Unicode string. |
0 | S1 is equivalent to S2. |
>0 | S1 is lexically greater than S2. |
<0 | S1 is lexically less than S2. |
Definition at line 164 of file UnicodeCollation.c.
VOID FatStrLwr | ( | IN CHAR16 * | Str | ) |
Lowercase a string
Str | The string which will be lower-cased. |
Convert unicode string to Fat string.
String | The unicode string. |
FatSize | The size of the FAT string. |
Fat | The FAT string. |
TRUE | Convert successfully. |
FALSE | Convert error. |
Definition at line 253 of file UnicodeCollation.c.
VOID FatStrUpr | ( | IN CHAR16 * | Str | ) |
Uppercase a string.
Str | The string which will be upper-cased. |
EFI_STATUS FatTruncateOFile | ( | IN FAT_OFILE * | OFile, |
IN UINTN | TruncatedSize | ||
) |
Truncate the OFile to smaller file size.
OFile | - The open file. |
TruncatedSize | - The new file size. |
EFI_SUCCESS | - The file is truncated successfully. |
Definition at line 622 of file ReadWrite.c.
Set the OFile's cluster and size info in its directory entry.
OFile | - The corresponding OFile. |
Definition at line 187 of file DirectoryManage.c.
EFI_STATUS FatVolumeFlushCache | ( | IN FAT_VOLUME * | Volume, |
IN FAT_TASK * | Task | ||
) |
Flush all the dirty cache back, include the FAT cache and the Data cache.
Volume | - FAT file system volume. |
Task | point to task instance. |
EFI_SUCCESS | - Flush all the dirty cache back successfully |
Definition at line 595 of file DiskCache.c.
VOID FatWaitNonblockingTask | ( | FAT_IFILE * | IFile | ) |
EFI_STATUS EFIAPI FatWrite | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT UINTN * | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Set the file info.
FHand | - The handle of the file. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing write data. |
EFI_SUCCESS | - Set the file info successfully. |
EFI_WRITE_PROTECTED | - The disk is write protected. |
EFI_ACCESS_DENIED | - The file is read-only. |
EFI_DEVICE_ERROR | - The OFile is not valid. |
EFI_UNSUPPORTED | - The open file is not a file.
|
Write the content of buffer into files.
FHand | - The handle of the file. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing write data. |
EFI_SUCCESS | - Set the file info successfully. |
EFI_WRITE_PROTECTED | - The disk is write protect. |
EFI_ACCESS_DENIED | - The file is read-only. |
EFI_DEVICE_ERROR | - The OFile is not valid. |
EFI_UNSUPPORTED | - The open file is not a file.
|
Definition at line 411 of file ReadWrite.c.
EFI_STATUS EFIAPI FatWriteEx | ( | IN EFI_FILE_PROTOCOL * | FHand, |
IN OUT EFI_FILE_IO_TOKEN * | Token | ||
) |
Get the file info.
FHand | - The handle of the file. |
Token | - A pointer to the token associated with the transaction. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_DEVICE_ERROR | - Can not find the OFile for the file. |
EFI_VOLUME_CORRUPTED | - The file type of open file is error. |
Definition at line 435 of file ReadWrite.c.
EFI_STATUS FatWriteZeroPool | ( | IN FAT_OFILE * | OFile, |
IN UINTN | WritePos | ||
) |
Write zero pool from the WritePos to the end of OFile.
OFile | - The open file to write zero pool. |
WritePos | - The number of zero bytes written. |
EFI_SUCCESS | - Write the zero pool successfully. |
EFI_OUT_OF_RESOURCES | - Not enough memory to perform the operation. |
Definition at line 567 of file ReadWrite.c.
EFI_STATUS InitializeUnicodeCollationSupport | ( | IN EFI_HANDLE | AgentHandle | ) |
Initialize Unicode Collation support.
It tries to locate Unicode Collation 2 protocol and matches it with current platform language code. If for any reason the first attempt fails, it then tries to use Unicode Collation Protocol.
AgentHandle | The handle used to open Unicode Collation (2) protocol. |
EFI_SUCCESS | The Unicode Collation (2) protocol has been successfully located. |
Others | The Unicode Collation (2) protocol has not been located. |
Definition at line 120 of file UnicodeCollation.c.
|
extern |
|
extern |
Definition at line 143 of file ComponentName.c.
|
extern |
Definition at line 152 of file ComponentName.c.
|
extern |