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

Caller-supplied storage + policy + renderer for ra8_keycache_init. More...

#include <ra8_keycache.h>

Collaboration diagram for ra8_keycache_cfg_t:

Data Fields

uint8_t * cell_mem
 cell_count * cell_bytes of cell storage.
uint32_t cell_bytes
 Bytes per cell (the rendered payload).
uint32_t cell_count
 Number of cells.
uint8_t * key_mem
 cell_count * key_bytes of key storage.
uint32_t key_bytes
 Bytes per key (>= 1).
uint8_t * user_mem
 cell_count * user_bytes, or NULL if none.
uint32_t user_bytes
 Bytes per user descriptor (may be 0).
ra8_keycache_cell_tmeta
 cell_count link-metadata entries.
int32_t * buckets
 bucket_count hash-bucket heads.
uint32_t bucket_count
 Number of hash buckets (>= 1).
ra8_keycache_render_fn render
 Render-on-miss callback.
void * render_ctx
 Opaque context passed to render.
ra8_keycache_evict_t evict
 Eviction policy (0 => LRU; SLRU opt-in).
uint8_t protected_pct
 SLRU protected share 1..100; 0 => 75%.
ra8_keycache_hash_fn hash
 Key hash; NULL selects built-in FNV-1a.
void * hash_ctx
 Opaque context passed to hash.

Detailed Description

Caller-supplied storage + policy + renderer for ra8_keycache_init.

Every array is caller-owned and must out-live the cache. user_mem is required only when user_bytes > 0; pass NULL with user_bytes == 0 for a cache that needs no per-cell descriptor. evict, hash, and protected_pct all default to their zero value (LRU, built-in FNV-1a, and the SLRU 75% default respectively), so an LRU cache need only zero-fill the struct and set the storage fields.

Since
0.1.0

Definition at line 183 of file ra8_keycache.h.

Field Documentation

◆ bucket_count

uint32_t ra8_keycache_cfg_t::bucket_count

◆ buckets

◆ cell_bytes

uint32_t ra8_keycache_cfg_t::cell_bytes

◆ cell_count

◆ cell_mem

◆ evict

ra8_keycache_evict_t ra8_keycache_cfg_t::evict

Eviction policy (0 => LRU; SLRU opt-in).

Definition at line 196 of file ra8_keycache.h.

Referenced by internal_access(), internal_validate_cfg_policy(), ra8_keycache_init(), and ra8_vmem_init().

◆ hash

ra8_keycache_hash_fn ra8_keycache_cfg_t::hash

Key hash; NULL selects built-in FNV-1a.

Definition at line 199 of file ra8_keycache.h.

Referenced by internal_hash(), and ra8_vmem_init().

◆ hash_ctx

void* ra8_keycache_cfg_t::hash_ctx

Opaque context passed to hash.

Definition at line 200 of file ra8_keycache.h.

Referenced by internal_hash(), and ra8_vmem_init().

◆ key_bytes

uint32_t ra8_keycache_cfg_t::key_bytes

◆ key_mem

uint8_t* ra8_keycache_cfg_t::key_mem

◆ meta

◆ protected_pct

uint8_t ra8_keycache_cfg_t::protected_pct

SLRU protected share 1..100; 0 => 75%.

Ignored under LRU.

Definition at line 197 of file ra8_keycache.h.

Referenced by internal_protected_cap(), internal_validate_cfg_policy(), and ra8_vmem_init().

◆ render

ra8_keycache_render_fn ra8_keycache_cfg_t::render

Render-on-miss callback.

Definition at line 194 of file ra8_keycache.h.

Referenced by internal_miss(), internal_validate_cfg_ptrs(), ra8_glyph_atlas_init(), ra8_tile_cache_init(), and ra8_vmem_init().

◆ render_ctx

void* ra8_keycache_cfg_t::render_ctx

Opaque context passed to render.

Definition at line 195 of file ra8_keycache.h.

Referenced by internal_miss(), ra8_glyph_atlas_init(), ra8_tile_cache_init(), and ra8_vmem_init().

◆ user_bytes

uint32_t ra8_keycache_cfg_t::user_bytes

Bytes per user descriptor (may be 0).

Definition at line 190 of file ra8_keycache.h.

Referenced by internal_user_ptr(), internal_validate_cfg_ptrs(), ra8_glyph_atlas_init(), ra8_tile_cache_init(), and ra8_vmem_init().

◆ user_mem

uint8_t* ra8_keycache_cfg_t::user_mem

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