|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Caller-supplied storage + policy + renderer for ra8_keycache_init. More...
#include <ra8_keycache.h>
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_t * | meta |
| 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. | |
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.
Definition at line 183 of file ra8_keycache.h.
| uint32_t ra8_keycache_cfg_t::bucket_count |
Number of hash buckets (>= 1).
Definition at line 193 of file ra8_keycache.h.
Referenced by internal_hash(), internal_seed_cells(), internal_validate_cfg_sizes(), ra8_glyph_atlas_init(), ra8_tile_cache_init(), and ra8_vmem_init().
| int32_t* ra8_keycache_cfg_t::buckets |
bucket_count hash-bucket heads.
Definition at line 192 of file ra8_keycache.h.
Referenced by internal_hash_insert(), internal_hash_lookup(), internal_hash_remove(), internal_seed_cells(), internal_validate_cfg_ptrs(), ra8_glyph_atlas_init(), ra8_tile_cache_init(), and ra8_vmem_init().
| uint32_t ra8_keycache_cfg_t::cell_bytes |
Bytes per cell (the rendered payload).
Definition at line 185 of file ra8_keycache.h.
Referenced by internal_cell_ptr(), internal_miss(), internal_validate_cfg_sizes(), ra8_glyph_atlas_init(), ra8_keycache_put(), ra8_tile_cache_init(), and ra8_vmem_init().
| uint32_t ra8_keycache_cfg_t::cell_count |
Number of cells.
Definition at line 186 of file ra8_keycache.h.
Referenced by internal_first_unpinned(), internal_hash_lookup(), internal_hash_remove(), internal_protected_cap(), internal_seed_cells(), internal_validate_cfg_sizes(), ra8_glyph_atlas_init(), ra8_keycache_put(), ra8_tile_cache_capacity(), ra8_tile_cache_init(), and ra8_vmem_init().
| uint8_t* ra8_keycache_cfg_t::cell_mem |
cell_count * cell_bytes of cell storage.
Definition at line 184 of file ra8_keycache.h.
Referenced by internal_cell_ptr(), internal_validate_cfg_ptrs(), ra8_glyph_atlas_init(), ra8_glyph_atlas_stats(), ra8_keycache_put(), ra8_keycache_stats(), ra8_tile_cache_capacity(), ra8_tile_cache_init(), ra8_tile_cache_stats(), and ra8_vmem_init().
| 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().
| 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().
| 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().
| uint32_t ra8_keycache_cfg_t::key_bytes |
Bytes per key (>= 1).
Definition at line 188 of file ra8_keycache.h.
Referenced by internal_hash(), internal_key_eq(), internal_key_ptr(), internal_miss(), internal_validate_cfg_sizes(), ra8_glyph_atlas_init(), ra8_tile_cache_init(), and ra8_vmem_init().
| uint8_t* ra8_keycache_cfg_t::key_mem |
cell_count * key_bytes of key storage.
Definition at line 187 of file ra8_keycache.h.
Referenced by internal_key_ptr(), internal_validate_cfg_ptrs(), ra8_glyph_atlas_init(), ra8_tile_cache_init(), and ra8_vmem_init().
| ra8_keycache_cell_t* ra8_keycache_cfg_t::meta |
cell_count link-metadata entries.
Definition at line 191 of file ra8_keycache.h.
Referenced by internal_first_unpinned(), internal_hash_insert(), internal_hash_lookup(), internal_hash_remove(), internal_miss(), internal_push_head(), internal_seed_cells(), internal_slru_access(), internal_unlink(), internal_validate_cfg_ptrs(), ra8_glyph_atlas_init(), ra8_keycache_get(), ra8_keycache_put(), ra8_tile_cache_init(), and ra8_vmem_init().
| 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().
| 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().
| 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().
| 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().
| uint8_t* ra8_keycache_cfg_t::user_mem |
cell_count * user_bytes, or NULL if none.
Definition at line 189 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().