88typedef enum : uint32_t {
143 if (buf ==
nullptr) {
146 if (scr ==
nullptr) {
150 if (out ==
nullptr) {
176 .img_arena =
nullptr,
180 .css_cap =
sizeof(
s_css),
215 if (out_blob ==
nullptr) {
218 if (out_len ==
nullptr) {
227 .data = (
const uint8_t*)(uintptr_t)mb->
epub_base,
276 if (blob ==
nullptr) {
284 mb->
blob_base = (uint32_t)(uintptr_t)blob;
288 __asm
volatile(
"dsb" :::
"memory");
293 __asm
volatile(
"dsb" :::
"memory");
314 __asm
volatile(
"nop");
326typedef enum : uint8_t {
377 __asm
volatile(
"dsb" :::
"memory");
382 __asm
volatile(
"dmb" :::
"memory");
385 __asm
volatile(
"dsb" :::
"memory");
387 __asm
volatile(
"dsb" :::
"memory");
392 const void* blob =
nullptr;
467 __asm
volatile(
"dsb" :::
"memory");
469 __asm
volatile(
"dsb" :::
"memory");
472 __asm
volatile(
"nop");
486#ifndef RA8_OFF_TARGET
Flat, execute-in-place container for a build-time "compiled" e-book.
static const book_header_t * book_header(const void *base)
View the blob base as its header.
Shared-SRAM contract for the "RABOOK1 emitter on the M33" demo (#149b).
static volatile com33_mailbox_t * com33_mailbox(void)
Typed pointer to the fixed-address shared mailbox.
static uint8_t * com33_blob(void)
Typed pointer to the fixed-address shared output-blob buffer.
@ k_com33_status_no_request
status: req_magic absent (no staged job).
@ k_com33_status_fault
status: M33 took a hardware fault mid-run.
@ k_com33_req_magic
"REQ0" – M85 stamps it once the job (the
@ k_com33_status_ok
status: compile finalized a valid blob.
@ k_com33_m33_sig
"M33 CODE" boot sentinel written by M33.
@ k_com33_status_build_fail
status: a compile stage overflowed/failed.
@ k_com33_blob_cap
Shared output-blob buffer capacity in bytes.
EPUB (.epub) reader and chapter iterator for ra8-firmware.
ra8_err_t epub_close(epub_book_t *book)
Close a previously opened EPUB book.
ra8_err_t epub_open(const void *media, const char *path, epub_book_t *out_book)
Open an EPUB book from an opaque media handle.
static epub_book_t s_book
Opened book (large – file-scope, not on the stack).
void cpu1_reset_handler(void)
CPU1 reset handler.
uint32_t g_ra8_ls_cpu1_data_end
uint32_t g_ra8_ls_cpu1_bss_start
uint32_t g_ra8_ls_cpu1_data_load
uint32_t g_ra8_ls_cpu1_bss_end
const uintptr_t g_cpu1_vector_table[]
Minimal Armv8-M vector table for CPU1.
uint32_t g_ra8_ls_cpu1_stack_top
uint32_t g_ra8_ls_cpu1_data_start
static void cpu1_fault_handler(void)
CPU1 default fault handler: park the core.
static void publish_result(volatile com33_mailbox_t *mb, const void *blob, uint32_t len, bool ok)
Publish the emitter result into the shared mailbox.
static uint8_t s_image_pool[k_arena_imgpool]
static bool compile_fixture(const void **out_blob, uint32_t *out_len)
Compile the baked parity fixture EPUB into the shared output blob.
m33_arena_cap_t
Capacities of the M33 text/CSS/SVG compile's caller-owned arenas.
@ k_arena_imgpool
Image-pool capacity (bytes).
@ k_arena_xhtml
Chapter XHTML parse scratch (bytes).
@ k_arena_images
Image-table entries.
@ k_arena_attrs
Attribute-table entries.
@ k_arena_string
String-pool capacity (bytes).
@ k_arena_styles
Stylesheet-table entries.
@ k_arena_chapters
Chapter-table entries.
@ k_arena_css
Stylesheet load scratch (bytes).
@ k_arena_imgraw
SVG/resource load scratch (bytes).
@ k_arena_nodes
Node-table entries.
static book_node_t s_nodes[k_arena_nodes]
static void notify_m85(void)
Poke the M85's IPC0 receive line to wake it from WFI.
cpu1_ipc_t
IPC channel the M33 pokes to wake the parked M85.
@ k_cpu1_ipc_wake_channel
IPC0 channel 0 (CPU1 -> CPU0).
static void cpu1_park(void)
Park the M33 forever once the emitter has reported its result.
static uint8_t s_image_raw[k_arena_imgraw]
static char s_css[k_arena_css]
static book_stylesheet_t s_styles[k_arena_styles]
static book_image_t s_images[k_arena_images]
static void cpu1_run_compile(void)
CPU1 emitter entry: build the book, finalize the blob, report.
static char s_string_pool[k_arena_string]
static bool bind_compile(ra8_rabook_buffers_t *buf, ra8_rabook_pipeline_scratch_t *scr)
Point a builder + pipeline-scratch view at the SDRAM arenas + output.
static ra8_rabook_xml_workspace_t s_xml_workspace
static book_chapter_t s_chapters[k_arena_chapters]
static book_attr_t s_attrs[k_arena_attrs]
Annotation-attribute framework macros for ra8-firmware.
#define RA8_LOOP_BOUND_RUNTIME(ceiling_ref)
NASA Power-of-10 Rule 2: bind ONE loop to a runtime / linker ceiling.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
void * memset(void *dst, int value, size_t n)
Fill memory with a constant byte value.
Inter-Processor Communication (IPC) HAL driver – public API.
@ k_ra8_ipc_irq_event_0
RA8 ipc IRQ event 0.
ra8_err_t ra8_ipc_send_event(uint8_t channel, ra8_ipc_irq_event_id_t event_id)
Generate a maskable IRQ event on the peer core.
End-to-end EPUB -> RABOOK1 compile pipeline (#149).
ra8_err_t rabook_compile_from_epub_to_buffer(epub_book_t *epub, const ra8_rabook_buffers_t *bufs, const ra8_rabook_pipeline_scratch_t *scr, const void **out_blob, uint32_t *out_len)
Compile an open EPUB into a RABOOK1 blob left in bufs->out, with no filesystem write.
Zero-heap builder that emits a RABOOK1 blob (the #149 compiler back-end).
static uint8_t s_xhtml[k_sh_xhtml_cap]
One name="value" attribute on an element.
One spine document (a renderable chapter) plus its TOC label.
Descriptor for one transcoded image in the image pool.
A preserved CSS stylesheet and the chapter it scopes to.
Cross-core handoff block backed by a fixed shared-SRAM address.
volatile uint32_t blob_base
Address of the finalized blob (= out_base).
volatile uint32_t chapter_count
Chapters the M33 emitted into the blob.
volatile uint32_t blob_len
Finalized RABOOK1 blob length, bytes.
volatile uint32_t m33_sig
M33 stamps k_com33_m33_sig on boot.
volatile uint32_t req_magic
M85 stamps k_com33_req_magic when the job is.
volatile uint32_t blob_crc
Blob header body CRC-32, echoed for cross-check.
volatile uint32_t epub_len
M85: length of the staged .epub, bytes.
volatile uint32_t done
Set to 1 by the M33 once the blob is published.
volatile uint32_t epub_base
M85: address of the staged source .epub bytes.
volatile uint32_t status
Compile outcome (com33_const_t status codes).
Caller-owned, fixed-capacity arenas the builder appends into (no heap).
Caller-owned temporary buffers the pipeline stage needs.
Caller-owned storage for one parser invocation.