RTEMS 6.3
Loading...
Searching...
No Matches

Constants/Data Structures/Prototypes on a Volume with FAT Filesystem. More...

#include <sys/param.h>
#include <sys/endian.h>
#include <string.h>
#include <rtems/seterr.h>
#include <errno.h>
#include <rtems/bdbuf.h>

Go to the source code of this file.

Data Structures

struct  fat_vol_s
struct  fat_cache_s
struct  fat_fs_info_s
struct  fat_pos_s
struct  fat_dir_pos_s

Macros

#define RC_OK   0
#define CF_LE_W(v)
#define CF_LE_L(v)
#define CT_LE_W(v)
#define CT_LE_L(v)
#define FAT_HASH_SIZE   2
#define FAT_HASH_MODULE   FAT_HASH_SIZE
#define FAT_SECTOR512_SIZE   512
#define FAT_SECTOR512_BITS   9
#define FAT_FAT12_MAX_CLN   4085
#define FAT_FAT16_MAX_CLN   65525
#define FAT_FAT12   0x01
#define FAT_FAT16   0x02
#define FAT_FAT32   0x04
#define FAT_UNDEFINED_VALUE   (uint32_t)0xFFFFFFFF
#define FAT_FAT12_EOC   0x0FF8
#define FAT_FAT16_EOC   0xFFF8
#define FAT_FAT32_EOC   (uint32_t)0x0FFFFFF8
#define FAT_FAT12_FREE   0x0000
#define FAT_FAT16_FREE   0x0000
#define FAT_FAT32_FREE   0x00000000
#define FAT_GENFAT_EOC   (uint32_t)0xFFFFFFFF
#define FAT_GENFAT_FREE   (uint32_t)0x00000000
#define FAT_FAT12_SHIFT   0x04
#define FAT_FAT12_MASK   0x00000FFF
#define FAT_FAT16_MASK   0x0000FFFF
#define FAT_FAT32_MASK   (uint32_t)0x0FFFFFFF
#define FAT_MAX_BPB_SIZE   90
#define FAT_TOTAL_MBR_SIZE   512
#define FAT_USEFUL_INFO_SIZE   12
#define FAT_GET_ADDR(x, ofs)
#define FAT_GET_VAL8(x, ofs)
#define FAT_GET_VAL16(x, ofs)
#define FAT_GET_VAL32(x, ofs)
#define FAT_SET_VAL8(x, ofs, val)
#define FAT_SET_VAL16(x, ofs, val)
#define FAT_SET_VAL32(x, ofs, val)
#define FAT_GET_BR_JMPBOOT(x)
#define FAT_SET_BR_JMPBOOT(x, val)
#define FAT_GET_ADDR_BR_OEMNAME(x)
#define FAT_BR_OEMNAME_SIZE   (8)
#define FAT_GET_BR_BYTES_PER_SECTOR(x)
#define FAT_SET_BR_BYTES_PER_SECTOR(x, val)
#define FAT_GET_BR_SECTORS_PER_CLUSTER(x)
#define FAT_SET_BR_SECTORS_PER_CLUSTER(x, val)
#define FAT_GET_BR_RESERVED_SECTORS_NUM(x)
#define FAT_SET_BR_RESERVED_SECTORS_NUM(x, val)
#define FAT_GET_BR_FAT_NUM(x)
#define FAT_SET_BR_FAT_NUM(x, val)
#define FAT_GET_BR_FILES_PER_ROOT_DIR(x)
#define FAT_SET_BR_FILES_PER_ROOT_DIR(x, val)
#define FAT_GET_BR_TOTAL_SECTORS_NUM16(x)
#define FAT_SET_BR_TOTAL_SECTORS_NUM16(x, val)
#define FAT_GET_BR_MEDIA(x)
#define FAT_SET_BR_MEDIA(x, val)
#define FAT_GET_BR_SECTORS_PER_FAT(x)
#define FAT_SET_BR_SECTORS_PER_FAT(x, val)
#define FAT_GET_BR_SECTORS_PER_TRACK(x)
#define FAT_SET_BR_SECTORS_PER_TRACK(x, val)
#define FAT_GET_BR_NUMBER_OF_HEADS(x)
#define FAT_SET_BR_NUMBER_OF_HEADS(x, val)
#define FAT_GET_BR_HIDDEN_SECTORS(x)
#define FAT_SET_BR_HIDDEN_SECTORS(x, val)
#define FAT_GET_BR_TOTAL_SECTORS_NUM32(x)
#define FAT_SET_BR_TOTAL_SECTORS_NUM32(x, val)
#define FAT_GET_BR_DRVNUM(x)
#define FAT_SET_BR_DRVNUM(x, val)
#define FAT_GET_BR_RSVD1(x)
#define FAT_SET_BR_RSVD1(x, val)
#define FAT_GET_BR_BOOTSIG(x)
#define FAT_SET_BR_BOOTSIG(x, val)
#define FAT_BR_BOOTSIG_VAL   (0x29)
#define FAT_GET_BR_VOLID(x)
#define FAT_SET_BR_VOLID(x, val)
#define FAT_GET_ADDR_BR_VOLLAB(x)
#define FAT_BR_VOLLAB_SIZE   (11)
#define FAT_GET_ADDR_BR_FILSYSTYPE(x)
#define FAT_BR_FILSYSTYPE_SIZE   (8)
#define FAT_GET_BR_SECTORS_PER_FAT32(x)
#define FAT_SET_BR_SECTORS_PER_FAT32(x, val)
#define FAT_GET_BR_EXT_FLAGS(x)
#define FAT_SET_BR_EXT_FLAGS(x, val)
#define FAT_GET_BR_FSVER(x)
#define FAT_SET_BR_FSVER(x, val)
#define FAT_GET_BR_FAT32_ROOT_CLUSTER(x)
#define FAT_SET_BR_FAT32_ROOT_CLUSTER(x, val)
#define FAT_GET_BR_FAT32_FS_INFO_SECTOR(x)
#define FAT_SET_BR_FAT32_FS_INFO_SECTOR(x, val)
#define FAT_GET_BR_FAT32_BK_BOOT_SECTOR(x)
#define FAT_SET_BR_FAT32_BK_BOOT_SECTOR(x, val)
#define FAT_GET_ADDR_BR_FAT32_RESERVED(x)
#define FAT_BR_FAT32_RESERVED_SIZE   (12)
#define FAT_GET_BR_FAT32_DRVNUM(x)
#define FAT_SET_BR_FAT32_DRVNUM(x, val)
#define FAT_GET_BR_FAT32_RSVD1(x)
#define FAT_SET_BR_FAT32_RSVD1(x, val)
#define FAT_GET_BR_FAT32_BOOTSIG(x)
#define FAT_SET_BR_FAT32_BOOTSIG(x, val)
#define FAT_BR_FAT32_BOOTSIG_VAL   (0x29)
#define FAT_GET_BR_FAT32_VOLID(x)
#define FAT_SET_BR_FAT32_VOLID(x, val)
#define FAT_GET_ADDR_BR_FAT32_VOLLAB(x)
#define FAT_BR_FAT32_VOLLAB_SIZE   (11)
#define FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(x)
#define FAT_BR_FAT32_FILSYSTYPE_SIZE   (8)
#define FAT_GET_BR_SIGNATURE(x)
#define FAT_SET_BR_SIGNATURE(x, val)
#define FAT_BR_SIGNATURE_VAL   (0xAA55)
#define FAT_GET_FSINFO_LEAD_SIGNATURE(x)
#define FAT_SET_FSINFO_LEAD_SIGNATURE(x, val)
#define FAT_FSINFO_LEAD_SIGNATURE_VALUE   (0x41615252)
#define FAT_GET_FSINFO_STRUC_SIGNATURE(x)
#define FAT_SET_FSINFO_STRUC_SIGNATURE(x, val)
#define FAT_FSINFO_STRUC_SIGNATURE_VALUE   (0x61417272)
#define FAT_GET_FSINFO_TRAIL_SIGNATURE(x)
#define FAT_SET_FSINFO_TRAIL_SIGNATURE(x, val)
#define FAT_FSINFO_TRAIL_SIGNATURE_VALUE   (0xAA550000)
#define FAT_GET_FSINFO_FREE_CLUSTER_COUNT(x)
#define FAT_SET_FSINFO_FREE_CLUSTER_COUNT(x, val)
#define FAT_GET_FSINFO_NEXT_FREE_CLUSTER(x)
#define FAT_SET_FSINFO_NEXT_FREE_CLUSTER(x, val)
#define FAT_FSI_INFO   484
#define FAT_FSINFO_STRUCT_OFFSET   488
#define FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET   (FAT_FSINFO_STRUCT_OFFSET+0)
#define FAT_FSINFO_NEXT_FREE_CLUSTER_OFFSET   (FAT_FSINFO_STRUCT_OFFSET+4)
#define FAT_RSRVD_CLN   0x02
#define FAT_FSI_LEADSIG_SIZE   0x04
#define FAT_TOTAL_FSINFO_SIZE   512
#define MS_BYTES_PER_CLUSTER_LIMIT   0x10000
#define MS_BYTES_PER_CLUSTER_LIMIT_FAT12   0x1000
#define FAT_BR_EXT_FLAGS_MIRROR   0x0080
#define FAT_BR_EXT_FLAGS_FAT_NUM   0x000F
#define FAT_BR_MEDIA_FIXED   0xf8
#define FAT_DIRENTRY_SIZE   32
#define FAT_DIRENTRIES_PER_SEC512   16
#define FAT_FILE_SHORT_NAME   (0xffffffff)
#define FAT_FAT_OFFSET(fat_type, cln)
#define FAT_CLUSTER_IS_ODD(n)
#define FAT12_SHIFT   0x4
#define FAT_UINO_POOL_INIT_SIZE   0x100
#define FAT_CACHE_EMPTY   0x0
#define FAT_CACHE_ACTUAL   0x1
#define FAT_OP_TYPE_READ   0x1
#define FAT_OP_TYPE_GET   0x2

Typedefs

typedef struct fat_vol_s fat_vol_t
typedef struct fat_cache_s fat_cache_t
typedef struct fat_fs_info_s fat_fs_info_t
typedef struct fat_pos_s fat_pos_t
typedef struct fat_dir_pos_s fat_dir_pos_t

Functions

int fat_buf_access (fat_fs_info_t *fs_info, uint32_t sec_num, int op_type, uint8_t **sec_buf)
int fat_buf_release (fat_fs_info_t *fs_info)
ssize_t _fat_block_read (fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, void *buff)
void fat_block_peek (fat_fs_info_t *fs_info, const uint32_t blk, const uint32_t blk_cnt)
ssize_t fat_cluster_write (fat_fs_info_t *fs_info, uint32_t start_cln, uint32_t offset, uint32_t count, const void *buff)
ssize_t fat_sector_write (fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff)
ssize_t fat_cluster_set (fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, uint8_t pattern)
int fat_init_volume_info (fat_fs_info_t *fs_info, const char *device)
int fat_init_clusters_chain (fat_fs_info_t *fs_info, uint32_t start_cln)
int fat_shutdown_drive (fat_fs_info_t *fs_info)
uint32_t fat_get_unique_ino (fat_fs_info_t *fs_info)
bool fat_ino_is_unique (fat_fs_info_t *fs_info, uint32_t ino)
void fat_free_unique_ino (fat_fs_info_t *fs_info, uint32_t ino)
int fat_sync (fat_fs_info_t *fs_info)

Detailed Description

Constants/Data Structures/Prototypes on a Volume with FAT Filesystem.

Constants/Data Structures/Prototypes for Low-Level Operations on a Volume with FAT Filesystem