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

Bounded flat-memory backing for unarch_read_fn. More...

#include <unarch_io.h>

Data Fields

const uint8_t * base
 First readable byte of the flat view.
size_t len
 Readable length in bytes.

Detailed Description

Bounded flat-memory backing for unarch_read_fn.

Describes [base, base + len) as a readable archive. Used by the wrapped-open paths: the unwrapped (decompressed) bytes live in a caller arena and this descriptor re-presents them through the common read seam. The descriptor must out-live every read through it, so callers embed it next to the arena it describes.

Invariant
base addresses at least len readable bytes while any reader holds this descriptor.
Example:
unarch_mem_t mem = {.base = arena, .len = unwrapped_len};
size_t got = unarch_mem_read(&mem, 0U, hdr, sizeof(hdr));
Bounded flat-memory backing for unarch_read_fn.
Definition unarch_io.h:79
size_t unarch_mem_read(void *ctx, uint64_t offset, void *buf, size_t len)
unarch_read_fn over a flat unarch_mem_t view.
Definition unarch_io.c:24
See also
unarch_mem_read()
Since
Version 0.1.0

Definition at line 79 of file unarch_io.h.

Field Documentation

◆ base

const uint8_t* unarch_mem_t::base

First readable byte of the flat view.

Definition at line 80 of file unarch_io.h.

Referenced by internal_open_unwrapped(), and unarch_mem_read().

◆ len

size_t unarch_mem_t::len

Readable length in bytes.

Definition at line 81 of file unarch_io.h.

Referenced by internal_open_unwrapped(), and unarch_mem_read().


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