ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
mdl_rabook_vfs.h
Go to the documentation of this file.
1
25#pragma once
26
27#include <stdint.h>
28
29#include "book_chunked.h"
31#include "ra8_io_vfs.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
47typedef struct {
49 uint64_t* table;
50 uint8_t* compressed;
51 uint8_t* chunk;
52 uint8_t* scratch;
53 uint32_t table_cap;
54 uint32_t compressed_cap;
55 uint32_t chunk_cap;
56 uint32_t scratch_cap;
58
91
108 const mdl_rabook_vfs_config_t* config);
109
128[[nodiscard]] ra8_err_t mdl_rabook_vfs_validate(void* opaque,
129 const char* staging_path,
130 uint64_t total_bytes,
131 const uint8_t sha256[k_ra8_mdl_sha256_bytes]);
132
146[[nodiscard]] ra8_err_t mdl_rabook_vfs_open(mdl_rabook_vfs_t* ctx, const char* path);
147
159[[nodiscard]] ra8_err_t
160mdl_rabook_vfs_read_chunk(mdl_rabook_vfs_t* ctx, uint64_t offset, uint8_t* dst, uint32_t len);
161
175[[nodiscard]] ra8_err_t mdl_rabook_vfs_info(const mdl_rabook_vfs_t* ctx,
176 book_header_t* out_header,
177 uint64_t* out_flat_size);
178
189
190#ifdef __cplusplus
191} /* extern "C" */
192#endif
ra8_err_t(* book_inflate_fn)(const void *src, size_t src_len, void *dst, size_t dst_cap, size_t *out_len)
Caller-supplied DEFLATE inflater used by book_open().
Definition book.h:656
Demand-paged chunk reader for the "RBKC" .rabook container.
ra8_err_t mdl_rabook_vfs_read_chunk(mdl_rabook_vfs_t *ctx, uint64_t offset, uint8_t *dst, uint32_t len)
Read one exact chunk-aligned flat-blob span from an open book.
ra8_err_t mdl_rabook_vfs_close(mdl_rabook_vfs_t *ctx)
Close and release an open VFS reader facade.
ra8_err_t mdl_rabook_vfs_validate(void *opaque, const char *staging_path, uint64_t total_bytes, const uint8_t sha256[k_ra8_mdl_sha256_bytes])
Strictly validate one closed private RBKC staging object.
ra8_err_t mdl_rabook_vfs_info(const mdl_rabook_vfs_t *ctx, book_header_t *out_header, uint64_t *out_flat_size)
Copy metadata from an open strictly validated book.
ra8_err_t mdl_rabook_vfs_open(mdl_rabook_vfs_t *ctx, const char *path)
Open and strictly revalidate a published RBKC object for consumption.
ra8_err_t mdl_rabook_vfs_init(mdl_rabook_vfs_t *ctx, const mdl_rabook_vfs_config_t *config)
Initialize one strict RBKC VFS workspace binding.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_io virtual filesystem – mount many volumes, address them by name.
@ k_ra8_mdl_sha256_bytes
SHA-256 digest size in bytes.
One open chunked .rabook file: parsed geometry + caller storage.
Fixed 100-byte prologue describing every table and pool in the blob.
Definition book.h:246
Caller-owned decompression and strict-validation workspace binding.
uint32_t table_cap
Entries available at table.
uint32_t compressed_cap
Bytes available at compressed.
uint32_t chunk_cap
Bytes available at chunk.
uint8_t * scratch
Strict semantic/CRC workspace.
uint64_t * table
Parsed RBKC offset-table workspace.
uint32_t scratch_cap
Bytes available at scratch.
uint8_t * compressed
One compressed-chunk staging span.
book_inflate_fn inflate_cb
Heap-free RFC 1950 inflater.
uint8_t * chunk
One complete inflated-chunk span.
One initialized strict validator or one open validated RBKC reader.
uint8_t * scratch
Caller strict workspace.
uint32_t table_cap
Table entry capacity.
uint8_t * chunk
Caller inflated chunk.
ra8_io_vfs_file_t * file
Borrowed VFS facade slot.
uint64_t * table
Caller table workspace.
uint8_t digest[k_ra8_mdl_sha256_bytes]
Transfer digest at validate.
book_header_t header
Strict decoded header.
uint8_t * compressed
Caller compressed staging.
uint32_t scratch_cap
Strict workspace bytes.
bool transfer_validated
Stage validation succeeded.
book_inflate_fn inflate_cb
Caller inflater.
uint64_t file_size
Validated RBKC byte length.
uint32_t chunk_cap
Inflated chunk bytes.
book_chunked_t reader
Bound RBKC reader.
uint32_t compressed_cap
Compressed staging bytes.
bool open
Live final-file reader.
Opaque, statically-pooled format-neutral file stream.