ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
cache_bench_io.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <stdarg.h>
16#include <stddef.h>
17#include <stdint.h>
18
20typedef enum : uint8_t {
26
29 *cb_source_read_fn)(void* ctx, uint64_t offset, uint8_t* dst, size_t capacity, size_t* out_read);
30
32typedef struct {
34 void* ctx;
35 uint64_t size;
37
39typedef cb_io_status_t (*cb_sink_write_fn)(void* ctx,
40 const uint8_t* data,
41 size_t length,
42 size_t* out_written);
43
45typedef struct {
47 void* ctx;
48} cb_sink_t;
49
51typedef cb_io_status_t (*cb_scratch_io_fn)(void* ctx, uint64_t offset, void* data, size_t length);
52
60
79cb_io_status_t cb_sink_write_all(cb_sink_t* sink, const void* data, size_t length);
80
99cb_io_status_t cb_sink_vformat(cb_sink_t* sink, const char* format, va_list args);
100
102cb_io_status_t cb_sink_format(cb_sink_t* sink, const char* format, ...);
cb_io_status_t cb_sink_write_all(cb_sink_t *sink, const void *data, size_t length)
Write every byte, retrying bounded short writes.
cb_io_status_t cb_sink_format(cb_sink_t *sink, const char *format,...)
Format one bounded record and publish it atomically to the sink seam.
cb_io_status_t
Status returned by tool-local injected I/O callbacks.
@ k_cb_io_ok
Operation completed.
@ k_cb_io_fault
Backing device or sink failed.
@ k_cb_io_mutated
A replay source changed between passes.
@ k_cb_io_capacity
Caller-owned storage was too small.
cb_io_status_t cb_sink_vformat(cb_sink_t *sink, const char *format, va_list args)
Format one bounded record and publish it atomically to the sink seam.
cb_io_status_t(* cb_sink_write_fn)(void *ctx, const uint8_t *data, size_t length, size_t *out_written)
Write callback; short writes are permitted.
cb_io_status_t(* cb_source_read_fn)(void *ctx, uint64_t offset, uint8_t *dst, size_t capacity, size_t *out_read)
Read-at callback; zero bytes is EOF, short reads are permitted.
cb_io_status_t(* cb_scratch_io_fn)(void *ctx, uint64_t offset, void *data, size_t length)
Random-access scratch-file callback.
-proof
Injected bounded random-access scratch transaction.
void * ctx
Caller-owned binding.
uint64_t size
Logical bytes written.
cb_scratch_io_fn read
Complete read-at callback.
Injected output sink.
void * ctx
Caller-owned binding.
Immutable injected byte source with a snapshotted length.
void * ctx
Caller-owned binding.
uint64_t size
Size observed when bound.
cb_source_read_fn read
Read-at implementation.