|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Caller-buffer transaction adapter for C6 media source bytes. More...
#include "ra8_mdl_storage_ram.h"#include <stddef.h>#include <stdint.h>#include <string.h>#include "ra8_attributes.h"Go to the source code of this file.
Functions | |
| static ra8_err_t | internal_ram_begin (void *context, const char *destination) |
| Start a fresh private object in the bound caller buffer. | |
| static ra8_err_t | internal_ram_write (void *context, const uint8_t *data, uint16_t length, uint16_t *written) |
| Append one complete transfer fragment to private RAM storage. | |
| static ra8_err_t | internal_ram_commit (void *context) |
| Publish the current private extent to the caller. | |
| static ra8_err_t | internal_ram_abort (void *context) |
| Discard the logical extent of one active private object. | |
| ra8_err_t | ra8_mdl_storage_ram_init (ra8_mdl_storage_ram_t *storage, ra8_mdl_storage_iface_t *output, uint8_t *data, size_t capacity) |
| Bind a caller buffer as one transactional media destination. | |
| ra8_err_t | ra8_mdl_storage_ram_view (const ra8_mdl_storage_ram_t *storage, const uint8_t **data, size_t *length) |
| Expose the complete committed source as an immutable byte view. | |
Caller-buffer transaction adapter for C6 media source bytes.
Implements private begin/write state, explicit logical publication, and failure cleanup over storage supplied entirely by the caller.
Definition in file ra8_mdl_storage_ram.c.
|
static |
Discard the logical extent of one active private object.
Clears lifecycle metadata without spending time overwriting the caller buffer; no view is available after the operation.
| [in,out] | context | Bound ra8_mdl_storage_ram_t. |
| k_ra8_ok | Active private state was discarded. |
| k_ra8_err_null_ptr | context is NULL. |
| k_ra8_err_invalid_state | No transaction is active. |
Definition at line 147 of file ra8_mdl_storage_ram.c.
References ra8_mdl_storage_ram_t::active, ra8_mdl_storage_ram_t::committed, k_ra8_err_invalid_state, k_ra8_err_null_ptr, k_ra8_ok, ra8_mdl_storage_ram_t::length, and RA8_INTERNAL.
Referenced by ra8_mdl_storage_ram_init().
|
static |
Start a fresh private object in the bound caller buffer.
Rejects overlapping transactions and resets the logical extent only after validating the nonempty coordinator destination label.
| [in,out] | context | Bound ra8_mdl_storage_ram_t. |
| [in] | destination | Nonempty coordinator destination label. |
| k_ra8_ok | The private object is empty and writable. |
| k_ra8_err_null_ptr | A required pointer is NULL. |
| k_ra8_err_invalid_arg | The destination label is empty. |
| k_ra8_err_invalid_state | A transaction is already active. |
context was initialized by ra8_mdl_storage_ram_init. Definition at line 38 of file ra8_mdl_storage_ram.c.
References ra8_mdl_storage_ram_t::active, ra8_mdl_storage_ram_t::committed, k_ra8_err_invalid_arg, k_ra8_err_invalid_state, k_ra8_err_null_ptr, k_ra8_ok, ra8_mdl_storage_ram_t::length, and RA8_INTERNAL.
Referenced by ra8_mdl_storage_ram_init().
|
static |
Publish the current private extent to the caller.
Publication is a state transition only; the bytes already reside in caller memory and no pointer escapes until the view operation.
| [in,out] | context | Bound ra8_mdl_storage_ram_t. |
| k_ra8_ok | A nonempty immutable view is now available. |
| k_ra8_err_null_ptr | context is NULL. |
| k_ra8_err_invalid_state | No active nonempty transaction exists. |
Definition at line 117 of file ra8_mdl_storage_ram.c.
References ra8_mdl_storage_ram_t::active, ra8_mdl_storage_ram_t::committed, k_ra8_err_invalid_state, k_ra8_err_null_ptr, k_ra8_ok, ra8_mdl_storage_ram_t::length, and RA8_INTERNAL.
Referenced by ra8_mdl_storage_ram_init().
|
static |
Append one complete transfer fragment to private RAM storage.
Proves addition and capacity before copying, then reports progress exactly equal to the accepted fragment length.
| [in,out] | context | Bound ra8_mdl_storage_ram_t. |
| [in] | data | Ordered source bytes. |
| [in] | length | Requested byte count. |
| [out] | written | Exact accepted byte count. |
| k_ra8_ok | Every byte was copied and reported. |
| k_ra8_err_null_ptr | A required pointer is NULL. |
| k_ra8_err_invalid_state | No transaction is active. |
| k_ra8_err_no_mem | The complete fragment exceeds remaining capacity. |
length implies data spans that many readable bytes. written is writable and the context is exclusively owned. length. Definition at line 77 of file ra8_mdl_storage_ram.c.
References ra8_mdl_storage_ram_t::active, ra8_mdl_storage_ram_t::capacity, ra8_mdl_storage_ram_t::data, k_ra8_err_invalid_state, k_ra8_err_no_mem, k_ra8_err_null_ptr, k_ra8_ok, ra8_mdl_storage_ram_t::length, and memcpy().
Referenced by lx_nor_ram_init(), and ra8_mdl_storage_ram_init().
|
nodiscard |
Bind a caller buffer as one transactional media destination.
| [out] | storage | Caller-owned adapter state. |
| [out] | output | Bound coordinator interface. |
| [in,out] | data | Writable source-buffer backing. |
| [in] | capacity | Backing capacity in bytes. |
| k_ra8_ok | The idle adapter and complete interface are ready. |
| k_ra8_err_null_ptr | A required pointer is NULL. |
| k_ra8_err_invalid_size | capacity is zero. |
data spans capacity writable bytes. storage or data. output unchanged. Definition at line 164 of file ra8_mdl_storage_ram.c.
References internal_ram_abort(), internal_ram_begin(), internal_ram_commit(), internal_ram_write(), k_ra8_err_invalid_size, k_ra8_err_null_ptr, and k_ra8_ok.
Referenced by priv_media_download_image_run().
|
nodiscard |
Expose the complete committed source as an immutable byte view.
| [in] | storage | Initialized adapter state. |
| [out] | data | Receives the first committed byte. |
| [out] | length | Receives the exact committed byte count. |
| k_ra8_ok | A nonempty committed view was returned. |
| k_ra8_err_null_ptr | A required pointer is NULL. |
| k_ra8_err_invalid_state | No completed transaction is committed. |
storage is not concurrently mutated by a transfer. Definition at line 188 of file ra8_mdl_storage_ram.c.
References ra8_mdl_storage_ram_t::active, ra8_mdl_storage_ram_t::committed, ra8_mdl_storage_ram_t::data, k_ra8_err_invalid_state, k_ra8_err_null_ptr, k_ra8_ok, and ra8_mdl_storage_ram_t::length.
Referenced by internal_format().