52typedef enum : uint32_t {
67typedef enum : uint32_t {
134 "directory entry layout pinned at 16 bytes");
136 "entry header must fit one sector");
138 "superblock must fit one sector");
205 const uint8_t* in512);
266 uint32_t start_sector,
267 uint16_t sector_count,
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Persistent key(CRC32)->blob cache for compiled .rabook containers,built on the vendored,...
@ k_ra8_cache_store_sector_bytes
LevelX logical-sector size (bytes).
uint32_t priv_cache_store_crc32(const uint8_t *data, uint32_t len)
Fold a byte block into a CRC-32/ISO-HDLC value (seeded + finalised).
ra8_cs_media_const_t
Magics + serialization sizing for the on-flash records.
@ k_ra8_cs_format_version
On-flash layout revision.
@ k_ra8_cs_crc32_poly
Reflected CRC-32/ISO-HDLC polynomial.
@ k_ra8_cs_dir_per_sector
Directory entries per 512-byte sector.
@ k_ra8_cs_crc32_seed
CRC-32 pre/post conditioning.
@ k_ra8_cs_entry_magic
Entry-header tag 'R','C','S','E'.
@ k_ra8_cs_super_magic
Superblock tag 'R','C','S','1'.
@ k_ra8_cs_dir_ent_bytes
Serialized ra8_cs_dir_ent_t size.
int32_t priv_cache_store_index_add(ra8_cache_store_t *store, uint32_t key, uint32_t start_sector, uint16_t sector_count, uint32_t byte_len, bool pinned)
Claim a free index slot and populate it for key.
ra8_cs_clean_t
Values of ra8_cs_super_t::clean (the shutdown marker).
@ k_ra8_cs_dirty
Session open or crashed -> mount must replay the log.
@ k_ra8_cs_clean
Clean shutdown -> the checkpoint directory is valid.
ra8_err_t priv_cache_store_dir_save(ra8_cache_store_t *store, uint32_t *out_entry_count)
Serialize the live index into the on-flash checkpoint directory.
ra8_err_t priv_cache_store_sector_read(const ra8_cache_store_t *store, uint32_t sector, uint8_t *out512)
Read one LevelX logical sector into the store staging buffer region.
int32_t priv_cache_store_index_find(const ra8_cache_store_t *store, uint32_t key)
Find the index slot holding key.
ra8_err_t priv_cache_store_super_write(ra8_cache_store_t *store, uint32_t clean)
Write the superblock (sector 0) with the given clean marker.
ra8_err_t priv_cache_store_sector_write(ra8_cache_store_t *store, uint32_t sector, const uint8_t *in512)
Write one LevelX logical sector from a one-sector source buffer.
ra8_err_t priv_cache_store_sector_release(ra8_cache_store_t *store, uint32_t sector)
Release a LevelX logical sector back to the free pool.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Caller-owned store handle.
One serialized directory entry in the checkpoint region (16 bytes).
uint16_t flags
Persisted flags (pinned bit).
uint32_t start_sector
Entry header logical sector.
uint32_t byte_len
Payload length in bytes.
uint16_t sector_count
Run length (header + payload).
On-flash entry header at a run's first logical sector.
uint16_t flags
Persisted flags (pinned bit).
uint32_t magic
k_ra8_cs_entry_magic.
uint32_t start_sector
This header's own logical sector (self-anchor).
uint32_t seq
Append sequence number (monotonic).
uint32_t byte_len
Payload length in bytes.
uint32_t key
Content key (source CRC-32).
uint32_t hdr_crc
CRC-32 over the six fields above.
uint16_t sector_count
Run length (header + payload sectors).
On-flash superblock at logical sector 0 (also the checkpoint commit).
uint32_t version
k_ra8_cs_format_version.
uint32_t entry_count
Directory entries in the checkpoint.
uint32_t log_start
First append-log logical sector.
uint32_t logical_sectors
Usable logical-sector span.
uint32_t live_sectors
Live sector count at checkpoint time.
uint32_t crc
CRC-32 over the ten fields above.
uint32_t clean
ra8_cs_clean_t shutdown marker.
uint32_t data_capacity
Overprovisioned live-sector budget.
uint32_t next_seq
Next append sequence number.
uint32_t magic
k_ra8_cs_super_magic.
uint32_t seq
Checkpoint sequence (monotonic).