RTEMS 6.1-rc6
|
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) le16toh(v) |
#define | CF_LE_L(v) le32toh(v) |
#define | CT_LE_W(v) htole16(v) |
#define | CT_LE_L(v) htole32(v) |
#define | FAT_HASH_SIZE 2 |
#define | FAT_HASH_MODULE FAT_HASH_SIZE |
#define | FAT_SECTOR512_SIZE 512 /* sector size (bytes) */ |
#define | FAT_SECTOR512_BITS 9 /* log2(SECTOR_SIZE) */ |
#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) ((uint8_t *)(x) + (ofs)) |
#define | FAT_GET_VAL8(x, ofs) (uint8_t)(*((uint8_t *)(x) + (ofs))) |
#define | FAT_GET_VAL16(x, ofs) |
#define | FAT_GET_VAL32(x, ofs) |
#define | FAT_SET_VAL8(x, ofs, val) (*((uint8_t *)(x)+(ofs))=(uint8_t)(val)) |
#define | FAT_SET_VAL16(x, ofs, val) |
#define | FAT_SET_VAL32(x, ofs, val) |
#define | FAT_GET_BR_JMPBOOT(x) FAT_GET_VAL8( x, 0) |
#define | FAT_SET_BR_JMPBOOT(x, val) FAT_SET_VAL8( x, 0,val) |
#define | FAT_GET_ADDR_BR_OEMNAME(x) FAT_GET_ADDR( x, 3) |
#define | FAT_BR_OEMNAME_SIZE (8) |
#define | FAT_GET_BR_BYTES_PER_SECTOR(x) FAT_GET_VAL16(x, 11) |
#define | FAT_SET_BR_BYTES_PER_SECTOR(x, val) FAT_SET_VAL16(x, 11,val) |
#define | FAT_GET_BR_SECTORS_PER_CLUSTER(x) FAT_GET_VAL8( x, 13) |
#define | FAT_SET_BR_SECTORS_PER_CLUSTER(x, val) FAT_SET_VAL8( x, 13,val) |
#define | FAT_GET_BR_RESERVED_SECTORS_NUM(x) FAT_GET_VAL16(x, 14) |
#define | FAT_SET_BR_RESERVED_SECTORS_NUM(x, val) FAT_SET_VAL16(x, 14,val) |
#define | FAT_GET_BR_FAT_NUM(x) FAT_GET_VAL8( x, 16) |
#define | FAT_SET_BR_FAT_NUM(x, val) FAT_SET_VAL8( x, 16,val) |
#define | FAT_GET_BR_FILES_PER_ROOT_DIR(x) FAT_GET_VAL16(x, 17) |
#define | FAT_SET_BR_FILES_PER_ROOT_DIR(x, val) FAT_SET_VAL16(x, 17,val) |
#define | FAT_GET_BR_TOTAL_SECTORS_NUM16(x) FAT_GET_VAL16(x, 19) |
#define | FAT_SET_BR_TOTAL_SECTORS_NUM16(x, val) FAT_SET_VAL16(x, 19,val) |
#define | FAT_GET_BR_MEDIA(x) FAT_GET_VAL8( x, 21) |
#define | FAT_SET_BR_MEDIA(x, val) FAT_SET_VAL8( x, 21,val) |
#define | FAT_GET_BR_SECTORS_PER_FAT(x) FAT_GET_VAL16(x, 22) |
#define | FAT_SET_BR_SECTORS_PER_FAT(x, val) FAT_SET_VAL16(x, 22,val) |
#define | FAT_GET_BR_SECTORS_PER_TRACK(x) FAT_GET_VAL16(x, 24) |
#define | FAT_SET_BR_SECTORS_PER_TRACK(x, val) FAT_SET_VAL16(x, 24,val) |
#define | FAT_GET_BR_NUMBER_OF_HEADS(x) FAT_GET_VAL16(x, 26) |
#define | FAT_SET_BR_NUMBER_OF_HEADS(x, val) FAT_SET_VAL16(x, 26,val) |
#define | FAT_GET_BR_HIDDEN_SECTORS(x) FAT_GET_VAL32(x, 28) |
#define | FAT_SET_BR_HIDDEN_SECTORS(x, val) FAT_SET_VAL32(x, 28,val) |
#define | FAT_GET_BR_TOTAL_SECTORS_NUM32(x) FAT_GET_VAL32(x, 32) |
#define | FAT_SET_BR_TOTAL_SECTORS_NUM32(x, val) FAT_SET_VAL32(x, 32,val) |
#define | FAT_GET_BR_DRVNUM(x) FAT_GET_VAL8( x, 36) |
#define | FAT_SET_BR_DRVNUM(x, val) FAT_SET_VAL8( x, 36,val) |
#define | FAT_GET_BR_RSVD1(x) FAT_GET_VAL8( x, 37) |
#define | FAT_SET_BR_RSVD1(x, val) FAT_SET_VAL8( x, 37,val) |
#define | FAT_GET_BR_BOOTSIG(x) FAT_GET_VAL8( x, 38) |
#define | FAT_SET_BR_BOOTSIG(x, val) FAT_SET_VAL8( x, 38,val) |
#define | FAT_BR_BOOTSIG_VAL (0x29) |
#define | FAT_GET_BR_VOLID(x) FAT_GET_VAL32(x, 39) |
#define | FAT_SET_BR_VOLID(x, val) FAT_SET_VAL32(x, 39,val) |
#define | FAT_GET_ADDR_BR_VOLLAB(x) FAT_GET_ADDR (x, 43) |
#define | FAT_BR_VOLLAB_SIZE (11) |
#define | FAT_GET_ADDR_BR_FILSYSTYPE(x) FAT_GET_ADDR (x, 54) |
#define | FAT_BR_FILSYSTYPE_SIZE (8) |
#define | FAT_GET_BR_SECTORS_PER_FAT32(x) FAT_GET_VAL32(x, 36) |
#define | FAT_SET_BR_SECTORS_PER_FAT32(x, val) FAT_SET_VAL32(x, 36,val) |
#define | FAT_GET_BR_EXT_FLAGS(x) FAT_GET_VAL16(x, 40) |
#define | FAT_SET_BR_EXT_FLAGS(x, val) FAT_SET_VAL16(x, 40,val) |
#define | FAT_GET_BR_FSVER(x) FAT_GET_VAL16(x, 42) |
#define | FAT_SET_BR_FSVER(x, val) FAT_SET_VAL16(x, 42,val) |
#define | FAT_GET_BR_FAT32_ROOT_CLUSTER(x) FAT_GET_VAL32(x, 44) |
#define | FAT_SET_BR_FAT32_ROOT_CLUSTER(x, val) FAT_SET_VAL32(x, 44,val) |
#define | FAT_GET_BR_FAT32_FS_INFO_SECTOR(x) FAT_GET_VAL16(x, 48) |
#define | FAT_SET_BR_FAT32_FS_INFO_SECTOR(x, val) FAT_SET_VAL16(x, 48,val) |
#define | FAT_GET_BR_FAT32_BK_BOOT_SECTOR(x) FAT_GET_VAL16(x, 50) |
#define | FAT_SET_BR_FAT32_BK_BOOT_SECTOR(x, val) FAT_SET_VAL16(x, 50,val) |
#define | FAT_GET_ADDR_BR_FAT32_RESERVED(x) FAT_GET_ADDR (x, 52) |
#define | FAT_BR_FAT32_RESERVED_SIZE (12) |
#define | FAT_GET_BR_FAT32_DRVNUM(x) FAT_GET_VAL8( x, 64) |
#define | FAT_SET_BR_FAT32_DRVNUM(x, val) FAT_SET_VAL8( x, 64,val) |
#define | FAT_GET_BR_FAT32_RSVD1(x) FAT_GET_VAL8( x, 65) |
#define | FAT_SET_BR_FAT32_RSVD1(x, val) FAT_SET_VAL8( x, 65,val) |
#define | FAT_GET_BR_FAT32_BOOTSIG(x) FAT_GET_VAL8( x, 66) |
#define | FAT_SET_BR_FAT32_BOOTSIG(x, val) FAT_SET_VAL8( x, 66,val) |
#define | FAT_BR_FAT32_BOOTSIG_VAL (0x29) |
#define | FAT_GET_BR_FAT32_VOLID(x) FAT_GET_VAL32(x, 67) |
#define | FAT_SET_BR_FAT32_VOLID(x, val) FAT_SET_VAL32(x, 67,val) |
#define | FAT_GET_ADDR_BR_FAT32_VOLLAB(x) FAT_GET_ADDR (x, 71) |
#define | FAT_BR_FAT32_VOLLAB_SIZE (11) |
#define | FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(x) FAT_GET_ADDR (x, 82) |
#define | FAT_BR_FAT32_FILSYSTYPE_SIZE (8) |
#define | FAT_GET_BR_SIGNATURE(x) FAT_GET_VAL16(x,510) |
#define | FAT_SET_BR_SIGNATURE(x, val) FAT_SET_VAL16(x,510,val) |
#define | FAT_BR_SIGNATURE_VAL (0xAA55) |
#define | FAT_GET_FSINFO_LEAD_SIGNATURE(x) FAT_GET_VAL32(x, 0) |
#define | FAT_SET_FSINFO_LEAD_SIGNATURE(x, val) FAT_SET_VAL32(x, 0,val) |
#define | FAT_FSINFO_LEAD_SIGNATURE_VALUE (0x41615252) |
#define | FAT_GET_FSINFO_STRUC_SIGNATURE(x) FAT_GET_VAL32(x,484) |
#define | FAT_SET_FSINFO_STRUC_SIGNATURE(x, val) FAT_SET_VAL32(x,484,val) |
#define | FAT_FSINFO_STRUC_SIGNATURE_VALUE (0x61417272) |
#define | FAT_GET_FSINFO_TRAIL_SIGNATURE(x) FAT_GET_VAL32(x,508) |
#define | FAT_SET_FSINFO_TRAIL_SIGNATURE(x, val) FAT_SET_VAL32(x,508,val) |
#define | FAT_FSINFO_TRAIL_SIGNATURE_VALUE (0xAA550000) |
#define | FAT_GET_FSINFO_FREE_CLUSTER_COUNT(x) FAT_GET_VAL32(x, 4) |
#define | FAT_SET_FSINFO_FREE_CLUSTER_COUNT(x, val) FAT_SET_VAL32(x, 4,val) |
#define | FAT_GET_FSINFO_NEXT_FREE_CLUSTER(x) FAT_GET_VAL32(x, 8) |
#define | FAT_SET_FSINFO_NEXT_FREE_CLUSTER(x, val) FAT_SET_VAL32(x, 8,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 /* 64K */ |
#define | MS_BYTES_PER_CLUSTER_LIMIT_FAT12 0x1000 /* 4K */ |
#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) ((n) & 0x0001) |
#define | FAT12_SHIFT 0x4 /* half of a byte */ |
#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) |
Constants/Data Structures/Prototypes on a Volume with FAT Filesystem.
Constants/Data Structures/Prototypes for Low-Level Operations on a Volume with FAT Filesystem