ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_vmem_stream.h
Go to the documentation of this file.
1
36
37#pragma once
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43#include <stddef.h>
44#include <stdint.h>
45
46#include "ra8_err.h"
47#include "ra8_vmem.h"
48
59typedef struct {
61 uint32_t object_id;
62 uint32_t frame_bytes;
63 uint64_t size;
65
87[[nodiscard]] ra8_err_t
88ra8_vmem_stream_init(ra8_vmem_stream_t* st, ra8_vmem_t* vm, uint32_t object_id, uint64_t size);
89
117size_t ra8_vmem_stream_read(void* ctx, uint64_t offset, void* buf, size_t len);
118
119#ifdef __cplusplus
120}
121#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Byte-range page cache with SLRU eviction (Layer 2, #147).
ra8_err_t ra8_vmem_stream_init(ra8_vmem_stream_t *st, ra8_vmem_t *vm, uint32_t object_id, uint64_t size)
Bind a page-cached paged object to the byte-stream reader.
size_t ra8_vmem_stream_read(void *ctx, uint64_t offset, void *buf, size_t len)
Read len bytes at absolute offset through the page cache.
Binds one page-cached object to the byte-stream read adapter.
uint32_t object_id
Paged object id registered in the cache's source.
ra8_vmem_t * vm
Initialised page cache (fixed pool = RAM budget).
uint64_t size
Object length in bytes.
uint32_t frame_bytes
Cache frame size, cached from vm->cfg at init.
Page-cache state (caller-owned; treat as private).
Definition ra8_vmem.h:179