ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fs_fat_check_internal.h
Go to the documentation of this file.
1
28
29#pragma once
30
31#include <stdint.h>
32
33#include "ra8_attributes.h"
34#include "ra8_fs.h"
35#include "ra8_fs_check.h"
36
51typedef enum : uint16_t {
54
77
108 uint32_t cluster,
109 uint64_t lba,
110 uint32_t entry_off);
111
136bool priv_check_in_range(const ra8_fs_check_ctx_t* ctx, uint32_t cluster);
137
164bool priv_check_mark(ra8_fs_check_ctx_t* ctx, uint32_t cluster);
165
195 uint32_t cluster,
197
220
246
277
303 uint32_t cluster,
304 bool already_truncated);
305
334void ra8_fs_check_test_exfat_mark_run(ra8_fs_check_ctx_t* ctx, uint32_t first, uint64_t nclus);
335
369
400
426 uint32_t cluster,
427 bool already_truncated);
428
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
#define RA8_TEST_HELPER
Mark a symbol as externally-linked but only callable from tests.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Minimal FAT12/FAT16/FAT32 filesystem adapter (read + write).
Read-only on-device volume consistency check (fsck) for ra8_fs.
ra8_fs_check_fault_kind_t
The category of a single consistency finding.
void ra8_fs_check_test_exfat_push_overflow(ra8_fs_check_ctx_t *ctx, uint32_t cluster, bool already_truncated)
Exercise the exFAT directory-worklist overflow guard from a host test.
void priv_check_zero_bitmap(ra8_fs_check_ctx_t *ctx)
Zero the scratch visited-bitmap over its valid bit range.
ra8_err_t ra8_fs_check_test_exfat_mark_dir_alloc(ra8_fs_check_ctx_t *ctx, uint32_t first)
Exercise the exFAT FAT-chained directory allocation marker from a host test.
void ra8_fs_check_test_fat_push_overflow(ra8_fs_check_ctx_t *ctx, uint32_t cluster, bool already_truncated)
Exercise the FAT directory-worklist overflow guard from a host test.
void ra8_fs_check_test_exfat_mark_run(ra8_fs_check_ctx_t *ctx, uint32_t first, uint64_t nclus)
Exercise the exFAT contiguous-run marker from a host unit test.
bool priv_check_in_range(const ra8_fs_check_ctx_t *ctx, uint32_t cluster)
True when cluster is a real data cluster of the volume under check.
ra8_err_t priv_check_fat(ra8_fs_check_ctx_t *ctx)
Run the FAT12/16/32 consistency check into the context's report.
ra8_fs_check_bound_t
Static bounds that keep a scan of a corrupt volume terminating.
@ k_ra8_fs_check_max_dirs
Directory worklist depth cap.
bool priv_check_mark(ra8_fs_check_ctx_t *ctx, uint32_t cluster)
Mark cluster visited in the scratch bitmap; report a prior visit.
ra8_err_t priv_check_exfat(ra8_fs_check_ctx_t *ctx)
Run the exFAT consistency check into the context's report.
ra8_err_t ra8_fs_check_test_fat_scan_cluster_dir(ra8_fs_check_ctx_t *ctx, uint32_t first)
Exercise the FAT cluster-directory walker from a host unit test.
ra8_err_t ra8_fs_check_test_exfat_mark_fatchain(ra8_fs_check_ctx_t *ctx, uint32_t first)
Exercise the exFAT fragmented-chain walker from a host unit test.
bool priv_check_visit(ra8_fs_check_ctx_t *ctx, uint32_t cluster, ra8_fs_check_fault_kind_t oor_kind)
Visit a cluster during a walk: mark it, and report a range or link fault.
void priv_check_fault(ra8_fs_check_ctx_t *ctx, ra8_fs_check_fault_kind_t kind, uint32_t cluster, uint64_t lba, uint32_t entry_off)
Record one consistency finding into the report.
The state one ra8_fs_check run threads through its passes.
ra8_fs_check_report_t * rep
The report being filled.
uint32_t bitmap_bits
Valid bit count (== clusters_total).
ra8_fs_mount_t * m
The mounted volume under check.
uint8_t * bitmap
Scratch visited-cluster bitmap, or NULL.
The structured result of one ra8_fs_check run.
Cached parse of one mounted FAT volume.