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

Cross-core handoff block backed by a fixed shared-SRAM address. More...

#include <compile_on_m33.h>

Data Fields

volatile uint32_t magic
 M85 stamps k_com33_magic when ready.
volatile uint32_t req_magic
 M85 stamps k_com33_req_magic when the job is.
volatile uint32_t epub_base
 M85: address of the staged source .epub bytes.
volatile uint32_t epub_len
 M85: length of the staged .epub, bytes.
volatile uint32_t out_base
 M85: address the M33 writes the finalized blob.
volatile uint32_t out_cap
 M85: capacity of the output buffer, bytes.
volatile uint32_t m33_sig
 M33 stamps k_com33_m33_sig on boot.
volatile uint32_t status
 Compile outcome (com33_const_t status codes).
volatile uint32_t blob_base
 Address of the finalized blob (= out_base).
volatile uint32_t blob_len
 Finalized RABOOK1 blob length, bytes.
volatile uint32_t blob_crc
 Blob header body CRC-32, echoed for cross-check.
volatile uint32_t chapter_count
 Chapters the M33 emitted into the blob.
volatile uint32_t done
 Set to 1 by the M33 once the blob is published.

Detailed Description

Cross-core handoff block backed by a fixed shared-SRAM address.

All fields are volatile so each core re-reads memory rather than caching a value in a register. The M85 owns the REQUEST half (magic, req_magic, epub_base/len, out_base/cap); the M33 owns the RESPONSE half (m33_sig, status, blob_*, chapter_count, done). Each core only reads fields it does not own, and the M85 reads the response only after observing done == 1 behind a dmb.

Invariant
magic is 0 until the M85 stamps k_com33_magic, then holds.
req_magic is 0 until the M85 has staged the .epub + buffers, then k_com33_req_magic; the M33 does not compile until it observes it.
done is 0 until the M33 publishes the blob, then 1 forever.
On status == ok, blob_base == out_base and 0 < blob_len <= out_cap.
Example:
volatile com33_mailbox_t* mb = com33_mailbox();
while (mb->done == 0U) {} // wait for the M33 emitter
ra8_err_t rc = book_validate((const void*)mb->blob_base, mb->blob_len);
ra8_err_t book_validate(const void *base, size_t size)
Validate that a byte buffer is a well-formed, intact .rabook blob.
Definition book.c:231
static volatile com33_mailbox_t * com33_mailbox(void)
Typed pointer to the fixed-address shared mailbox.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
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 blob_len
Finalized RABOOK1 blob length, bytes.
volatile uint32_t done
Set to 1 by the M33 once the blob is published.
See also
com33_mailbox()
Since
0.1.0

Definition at line 174 of file compile_on_m33.h.

Field Documentation

◆ blob_base

volatile uint32_t com33_mailbox_t::blob_base

Address of the finalized blob (= out_base).

Definition at line 184 of file compile_on_m33.h.

Referenced by prep_mailbox(), publish_result(), and verify_blob().

◆ blob_crc

volatile uint32_t com33_mailbox_t::blob_crc

Blob header body CRC-32, echoed for cross-check.

Definition at line 186 of file compile_on_m33.h.

Referenced by prep_mailbox(), publish_result(), and verify_blob().

◆ blob_len

volatile uint32_t com33_mailbox_t::blob_len

Finalized RABOOK1 blob length, bytes.

Definition at line 185 of file compile_on_m33.h.

Referenced by main(), prep_mailbox(), publish_result(), and verify_blob().

◆ chapter_count

volatile uint32_t com33_mailbox_t::chapter_count

Chapters the M33 emitted into the blob.

Definition at line 187 of file compile_on_m33.h.

Referenced by main(), prep_mailbox(), publish_result(), and verify_blob().

◆ done

volatile uint32_t com33_mailbox_t::done

Set to 1 by the M33 once the blob is published.

Definition at line 188 of file compile_on_m33.h.

Referenced by cpu1_fault_handler(), cpu1_run_compile(), prep_mailbox(), publish_result(), and wait_for_done().

◆ epub_base

volatile uint32_t com33_mailbox_t::epub_base

M85: address of the staged source .epub bytes.

Definition at line 178 of file compile_on_m33.h.

Referenced by compile_fixture(), and prep_mailbox().

◆ epub_len

volatile uint32_t com33_mailbox_t::epub_len

M85: length of the staged .epub, bytes.

Definition at line 179 of file compile_on_m33.h.

Referenced by compile_fixture(), and prep_mailbox().

◆ m33_sig

volatile uint32_t com33_mailbox_t::m33_sig

M33 stamps k_com33_m33_sig on boot.

Definition at line 182 of file compile_on_m33.h.

Referenced by cpu1_run_compile(), prep_mailbox(), and wait_for_m33_sig().

◆ magic

volatile uint32_t com33_mailbox_t::magic

M85 stamps k_com33_magic when ready.

Definition at line 175 of file compile_on_m33.h.

Referenced by prep_mailbox().

◆ out_base

volatile uint32_t com33_mailbox_t::out_base

M85: address the M33 writes the finalized blob.

Definition at line 180 of file compile_on_m33.h.

Referenced by prep_mailbox().

◆ out_cap

volatile uint32_t com33_mailbox_t::out_cap

M85: capacity of the output buffer, bytes.

Definition at line 181 of file compile_on_m33.h.

Referenced by prep_mailbox().

◆ req_magic

volatile uint32_t com33_mailbox_t::req_magic

M85 stamps k_com33_req_magic when the job is.

staged; the M33 spins on it before compiling.

Definition at line 176 of file compile_on_m33.h.

Referenced by cpu1_run_compile(), and prep_mailbox().

◆ status

volatile uint32_t com33_mailbox_t::status

Compile outcome (com33_const_t status codes).

Definition at line 183 of file compile_on_m33.h.

Referenced by cpu1_fault_handler(), cpu1_run_compile(), main(), prep_mailbox(), publish_result(), and verify_blob().


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