ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fs_fat_lfn_write_internal.h
Go to the documentation of this file.
1
29
30#pragma once
31
32#include "ra8_attributes.h"
34
35/* ===========================================================================
36 * The name domain: what shape a leaf needs, and what alias it is filed under.
37 * ===========================================================================
38 */
39
81 uint16_t* out_units,
82 uint32_t* out_nunits,
83 uint8_t* out83,
84 uint8_t* out_ntres);
85
118void priv_lfn_alias_basis(const uint16_t* leaf, uint32_t n, uint32_t tail, uint8_t* out11);
119
120/* ===========================================================================
121 * The entry domain: one long-name slot, and the checksum that binds the chain.
122 * ===========================================================================
123 */
124
152uint8_t priv_sfn_checksum(const uint8_t* name83);
153
187void priv_lfn_fill_slot(uint8_t* ent,
188 const uint16_t* name,
189 uint32_t nlen,
190 uint32_t order,
191 uint8_t is_last,
192 uint8_t csum);
193
194/* ===========================================================================
195 * The directory domain: reserve, commit, look up, erase.
196 * ===========================================================================
197 */
198
230 const dir_loc_t* loc,
231 uint32_t need,
232 dir_slot_t* out);
233
267 const dir_loc_t* loc,
268 const char* leaf,
269 dir_insert_t* out);
270
313 const dir_insert_t* plan,
314 const uint8_t* tmpl,
315 uint64_t* out_lba,
316 uint32_t* out_off);
317
350 const dir_loc_t* loc,
351 const char* leaf,
352 uint64_t* out_lba,
353 uint32_t* out_off,
354 uint8_t out_entry[k_ra8_fs_dir_entry_bytes]);
355
390 const dir_loc_t* loc,
391 uint64_t lba,
392 uint32_t off,
393 const uint8_t* name83);
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
void priv_lfn_alias_basis(const uint16_t *leaf, uint32_t n, uint32_t tail, uint8_t *out11)
Derive the LONGNA~N.TXT 8.3 alias a long name is filed under.
ra8_err_t priv_dir_reserve(const ra8_fs_mount_t *m, const dir_loc_t *loc, const char *leaf, dir_insert_t *out)
Decide how a name will be stored and set aside the slots for it.
uint8_t priv_sfn_checksum(const uint8_t *name83)
Compute the 8.3 short-name checksum carried in each LFN directory entry.
ra8_err_t priv_dir_erase_chain(const ra8_fs_mount_t *m, const dir_loc_t *loc, uint64_t lba, uint32_t off, const uint8_t *name83)
Delete a directory entry together with its long-name chain.
ra8_err_t priv_dir_find_free_run(const ra8_fs_mount_t *m, const dir_loc_t *loc, uint32_t need, dir_slot_t *out)
Locate need consecutive free entry slots in a given directory.
void priv_lfn_fill_slot(uint8_t *ent, const uint16_t *name, uint32_t nlen, uint32_t order, uint8_t is_last, uint8_t csum)
Fill one 32-byte slot with the order -th group of a long name.
ra8_err_t priv_dir_lookup_any(const ra8_fs_mount_t *m, const dir_loc_t *loc, const char *leaf, uint64_t *out_lba, uint32_t *out_off, uint8_t out_entry[k_ra8_fs_dir_entry_bytes])
Resolve one leaf name by 8.3 first and by long name second.
ra8_fs_name_kind_t priv_name_classify(const char *leaf, uint16_t *out_units, uint32_t *out_nunits, uint8_t *out83, uint8_t *out_ntres)
Decide whether a leaf needs one entry, one entry plus case flags, or a chain.
ra8_err_t priv_dir_commit(const ra8_fs_mount_t *m, const dir_insert_t *plan, const uint8_t *tmpl, uint64_t *out_lba, uint32_t *out_off)
Write a reserved run: the long-name chain, then the 8.3 entry.
Cross-TU on-disk-layout enums and typedefs for the FAT/exFAT adapter.
ra8_fs_name_kind_t
How a leaf component has to be stored in a FAT directory.
@ k_ra8_fs_dir_entry_bytes
MS FAT spec sec 6 "Directory Entry".
Everything decided about a new directory entry before anything is written.
Identifies the directory a lookup/scan should operate in.
A directory cursor that addresses one entry, not just one sector.
Cached parse of one mounted FAT volume.