ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
rabook_import_compiler_ctx_t Struct Reference

Cookie carrying the storage rabook_import_compile_adapter needs. More...

#include <rabook_import_compiler.h>

Collaboration diagram for rabook_import_compiler_ctx_t:

Data Fields

epub_book_tepub
 Caller-owned open-book storage.
ra8_vmem_tcache
 Page cache re-initialised per compile.
uint8_t * cache_frames
 Frame pool backing the cache.
uint32_t cache_frame_bytes
 Bytes per cache frame (e.g.
uint32_t cache_frame_count
 Frames in the pool (the RAM budget).
ra8_vmem_frame_tcache_meta
 Per-frame metadata array.
ra8_vmem_key_tcache_keys
 Per-frame key-storage array.
int32_t * cache_buckets
 Cache hash-bucket heads.
uint32_t cache_bucket_count
 Number of hash buckets (>= 1).
const ra8_rabook_buffers_tbufs
 RABOOK1 builder arenas.
const ra8_rabook_pipeline_scratch_tscr
 XHTML + image decode scratch.

Detailed Description

Cookie carrying the storage rabook_import_compile_adapter needs.

All storage is caller-owned. The adapter never loads the whole .epub (#230): it opens the source file, registers it as a paged ra8_vsource object, re-initialises cache over the cache_* arrays (so no stale frame from a previous compile can be served), and streams every ZIP read through ra8_vmem_stream_read. The fixed frame pool (cache_frame_count * cache_frame_bytes bytes) is therefore the compile front-end's entire source-side RAM high-water mark, independent of the book size. After a compile the caller may read ra8_vmem_stats(cache, ...) for cache telemetry. The compile itself runs via the builder arenas in bufs and the decode scratch in scr.

Invariant
Every pointer is non-NULL and each array holds its stated count.
cache_meta has cache_frame_count entries; cache_frames has cache_frame_count * cache_frame_bytes bytes; cache_buckets has cache_bucket_count heads.
See also
ra8_vmem_stream_read
Since
Version 0.1.0

Definition at line 71 of file rabook_import_compiler.h.

Field Documentation

◆ bufs

const ra8_rabook_buffers_t* rabook_import_compiler_ctx_t::bufs

RABOOK1 builder arenas.

Definition at line 81 of file rabook_import_compiler.h.

Referenced by rabook_import_compile_adapter().

◆ cache

ra8_vmem_t* rabook_import_compiler_ctx_t::cache

Page cache re-initialised per compile.

Definition at line 73 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ cache_bucket_count

uint32_t rabook_import_compiler_ctx_t::cache_bucket_count

Number of hash buckets (>= 1).

Definition at line 80 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ cache_buckets

int32_t* rabook_import_compiler_ctx_t::cache_buckets

Cache hash-bucket heads.

Definition at line 79 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ cache_frame_bytes

uint32_t rabook_import_compiler_ctx_t::cache_frame_bytes

Bytes per cache frame (e.g.

4096).

Definition at line 75 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ cache_frame_count

uint32_t rabook_import_compiler_ctx_t::cache_frame_count

Frames in the pool (the RAM budget).

Definition at line 76 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ cache_frames

uint8_t* rabook_import_compiler_ctx_t::cache_frames

Frame pool backing the cache.

Definition at line 74 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ cache_keys

ra8_vmem_key_t* rabook_import_compiler_ctx_t::cache_keys

Per-frame key-storage array.

Definition at line 78 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ cache_meta

ra8_vmem_frame_t* rabook_import_compiler_ctx_t::cache_meta

Per-frame metadata array.

Definition at line 77 of file rabook_import_compiler.h.

Referenced by internal_cache_bind().

◆ epub

epub_book_t* rabook_import_compiler_ctx_t::epub

Caller-owned open-book storage.

Definition at line 72 of file rabook_import_compiler.h.

Referenced by internal_stream_open(), and rabook_import_compile_adapter().

◆ scr

const ra8_rabook_pipeline_scratch_t* rabook_import_compiler_ctx_t::scr

XHTML + image decode scratch.

Definition at line 82 of file rabook_import_compiler.h.

Referenced by rabook_import_compile_adapter().


The documentation for this struct was generated from the following file: