|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Open-file state. More...
#include <ra8_fs_types.h>
Data Fields | |
| ra8_fs_mount_t * | mount |
| Owning mount point. | |
| uint32_t | first_cluster |
| Head of the file's cluster chain. | |
| uint32_t | cur_cluster |
| Cluster the offset currently points into. | |
| uint32_t | walk_cache_idx |
| Chain index whose cluster is cached below. | |
| uint32_t | walk_cache_cluster |
| Cluster at walk_cache_idx; < 2 = no cache. | |
| uint64_t | size_bytes |
| File size (DIR_FileSize / DataLength). | |
| uint64_t | offset |
| Current read/write offset. | |
| uint64_t | dir_entry_lba |
| FAT: sector containing the dir entry. | |
| uint32_t | dir_entry_idx |
| FAT: byte offset of the entry in it. | |
| uint64_t | valid_bytes |
| exFAT ValidDataLength (bytes written). | |
| uint32_t | entry_set_cluster |
| exFAT: dir cluster of the File entry. | |
| uint32_t | entry_set_index |
| exFAT: entry index of the File entry. | |
| uint32_t | entry_set_count |
| exFAT: 1 + SecondaryCount. | |
| uint32_t | alloc_clusters |
| exFAT: clusters currently allocated. | |
| uint32_t | tail_cluster |
| exFAT: last cluster of the allocation. | |
| ra8_fs_mode_t | mode |
| Open mode. | |
| uint8_t | in_use |
| 0 = slot free, 1 = open. | |
| uint8_t | no_fat_chain |
| exFAT contiguous file (no FAT walk). | |
| uint8_t | dirty |
| 1 once written; drives the close mtime. | |
Open-file state.
The first block is common to both filesystems. The entry_set_*, alloc_clusters, tail_cluster and valid_bytes fields carry the extra bookkeeping an exFAT stream needs and are meaningless on a FAT12/16/32 handle: exFAT locates a file by a directory ENTRY SET rather than one 32-byte entry, tracks its allocation separately from its length (the allocation bitmap, not a FAT chain, is authoritative), and distinguishes the bytes actually written (ValidDataLength) from the file's length (DataLength).
The three byte lengths are 64-bit because exFAT's on-disk DataLength / ValidDataLength are (#676): a file past 4 GiB is exactly what exFAT exists to carry. On FAT12/16/32 the same fields never exceed k_ra8_fs_fat_max_file_bytes – DIR_FileSize is 32-bit – and the write and truncate paths enforce that cap rather than wrapping.
Definition at line 304 of file ra8_fs_types.h.
| uint32_t ra8_fs_file_t::alloc_clusters |
exFAT: clusters currently allocated.
Definition at line 318 of file ra8_fs_types.h.
| uint32_t ra8_fs_file_t::cur_cluster |
Cluster the offset currently points into.
Definition at line 307 of file ra8_fs_types.h.
Referenced by internal_exfat_open_found(), internal_init_new_file(), internal_open_existing(), and internal_truncate_existing().
| uint32_t ra8_fs_file_t::dir_entry_idx |
FAT: byte offset of the entry in it.
Definition at line 313 of file ra8_fs_types.h.
Referenced by internal_init_new_file(), and internal_open_existing().
| uint64_t ra8_fs_file_t::dir_entry_lba |
FAT: sector containing the dir entry.
Definition at line 312 of file ra8_fs_types.h.
Referenced by internal_init_new_file(), and internal_open_existing().
| uint8_t ra8_fs_file_t::dirty |
1 once written; drives the close mtime.
Definition at line 323 of file ra8_fs_types.h.
Referenced by internal_init_new_file(), and internal_open_existing().
| uint32_t ra8_fs_file_t::entry_set_cluster |
exFAT: dir cluster of the File entry.
Definition at line 315 of file ra8_fs_types.h.
| uint32_t ra8_fs_file_t::entry_set_count |
exFAT: 1 + SecondaryCount.
Definition at line 317 of file ra8_fs_types.h.
| uint32_t ra8_fs_file_t::entry_set_index |
exFAT: entry index of the File entry.
Definition at line 316 of file ra8_fs_types.h.
| uint32_t ra8_fs_file_t::first_cluster |
Head of the file's cluster chain.
Definition at line 306 of file ra8_fs_types.h.
Referenced by internal_exfat_open_found(), internal_init_new_file(), internal_open_existing(), and internal_truncate_existing().
| uint8_t ra8_fs_file_t::in_use |
0 = slot free, 1 = open.
Definition at line 321 of file ra8_fs_types.h.
Referenced by internal_exfat_open_created(), internal_exfat_open_found(), internal_init_new_file(), and internal_open_existing().
| ra8_fs_mode_t ra8_fs_file_t::mode |
Open mode.
Definition at line 320 of file ra8_fs_types.h.
Referenced by internal_init_new_file(), and internal_open_existing().
| ra8_fs_mount_t* ra8_fs_file_t::mount |
Owning mount point.
Definition at line 305 of file ra8_fs_types.h.
Referenced by internal_exfat_open_created(), internal_exfat_open_found(), internal_init_new_file(), and internal_open_existing().
| uint8_t ra8_fs_file_t::no_fat_chain |
exFAT contiguous file (no FAT walk).
Definition at line 322 of file ra8_fs_types.h.
Referenced by internal_exfat_open_found(), internal_init_new_file(), and internal_open_existing().
| uint64_t ra8_fs_file_t::offset |
Current read/write offset.
Definition at line 311 of file ra8_fs_types.h.
Referenced by internal_exfat_open_found(), internal_init_new_file(), internal_open_existing(), and internal_truncate_existing().
| uint64_t ra8_fs_file_t::size_bytes |
File size (DIR_FileSize / DataLength).
Definition at line 310 of file ra8_fs_types.h.
Referenced by internal_exfat_open_found(), internal_init_new_file(), internal_open_existing(), and internal_truncate_existing().
| uint32_t ra8_fs_file_t::tail_cluster |
exFAT: last cluster of the allocation.
Definition at line 319 of file ra8_fs_types.h.
| uint64_t ra8_fs_file_t::valid_bytes |
exFAT ValidDataLength (bytes written).
Definition at line 314 of file ra8_fs_types.h.
Referenced by internal_exfat_open_found().
| uint32_t ra8_fs_file_t::walk_cache_cluster |
Cluster at walk_cache_idx; < 2 = no cache.
Definition at line 309 of file ra8_fs_types.h.
Referenced by internal_exfat_open_found(), internal_init_new_file(), internal_open_existing(), and internal_truncate_existing().
| uint32_t ra8_fs_file_t::walk_cache_idx |
Chain index whose cluster is cached below.
Definition at line 308 of file ra8_fs_types.h.
Referenced by internal_init_new_file(), internal_open_existing(), and internal_truncate_existing().