|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
POSIX raw-descriptor composition bindings for cache_bench. More...
Go to the source code of this file.
Data Structures | |
| struct | cb_host_source_t |
| Borrowed raw descriptor source binding. More... | |
| struct | cb_host_output_t |
| Output transaction or borrowed standard descriptor. More... | |
| struct | cb_host_scratch_t |
| Unlinked raw-descriptor scratch binding. More... | |
Enumerations | |
| enum | cb_host_limit_t : uint16_t { k_cb_host_path_capacity = 4096U } |
Functions | |
| void | cb_host_standard_sinks (cb_sink_t *output, cb_sink_t *error) |
| Bind the process standard-output and standard-error descriptor sinks. | |
| cb_io_status_t | cb_host_source_open (const char *path, cb_host_source_t *binding, cb_source_t *source) |
| Open a captured-trace path and publish its source seam. | |
| cb_io_status_t | cb_host_source_close (cb_host_source_t *binding) |
| Close a source binding. | |
| cb_io_status_t | cb_host_output_open (const char *path, cb_host_output_t *binding, cb_sink_t *sink) |
| Open a sibling output transaction, or bind descriptor one for NULL. | |
| cb_io_status_t | cb_host_output_commit (cb_host_output_t *binding) |
| Flush and atomically publish a transactional output. | |
| void | cb_host_output_abort (cb_host_output_t *binding) |
| Abandon a temporary sibling while preserving the destination. | |
| cb_io_status_t | cb_host_scratch_open (cb_host_scratch_t *binding, cb_scratch_t *scratch) |
| Create an unlinked raw-descriptor scratch transaction. | |
| cb_io_status_t | cb_host_scratch_close (cb_host_scratch_t *binding) |
| Close the scratch transaction. | |
POSIX raw-descriptor composition bindings for cache_bench.
Publishes the host-only adapters that bind portable benchmark I/O seams to borrowed or explicitly owned POSIX descriptors.
[Ring 7 / Tooling] {World: NS}
Definition in file cache_bench_host.h.
| enum cb_host_limit_t : uint16_t |
| Enumerator | |
|---|---|
| k_cb_host_path_capacity | Bounded host path copy. |
Definition at line 19 of file cache_bench_host.h.
| void cb_host_output_abort | ( | cb_host_output_t * | binding | ) |
Abandon a temporary sibling while preserving the destination.
Closes owned descriptors, unlinks a live sibling, and clears the transaction marker; NULL and repeated calls are safe.
| [in,out] | binding | Transaction to abandon; NULL is accepted. |
binding is NULL or initialized output state. binding. Definition at line 315 of file cache_bench_host.c.
References cb_host_output_t::dir_fd, cb_host_output_t::fd, cb_host_output_t::temporary, and cb_host_output_t::transactional.
Referenced by cb_host_output_open(), and main().
| cb_io_status_t cb_host_output_commit | ( | cb_host_output_t * | binding | ) |
Flush and atomically publish a transactional output.
Syncs and closes the temporary file, renames it over the destination, then syncs the parent directory.
| [in,out] | binding | Open output transaction or borrowed standard output. |
| k_cb_io_ok | Publication completed or no transaction was required. |
| k_cb_io_fault | The binding or a durability operation failed. |
binding is non-NULL and initialized by cb_host_output_open. binding. Definition at line 289 of file cache_bench_host.c.
References cb_host_output_t::destination, cb_host_output_t::dir_fd, cb_host_output_t::fd, k_cb_io_fault, k_cb_io_ok, cb_host_output_t::temporary, and cb_host_output_t::transactional.
Referenced by main().
| cb_io_status_t cb_host_output_open | ( | const char * | path, |
| cb_host_output_t * | binding, | ||
| cb_sink_t * | sink ) |
Open a sibling output transaction, or bind descriptor one for NULL.
Creates a bounded exclusive temporary sibling for pathname output; standard output remains a borrowed non-transactional binding.
| [in] | path | Destination path, or NULL for standard output. |
| [out] | binding | Receives transaction state. |
| [out] | sink | Receives the writable sink seam. |
| k_cb_io_ok | The sink is ready for publication. |
| k_cb_io_capacity | A path component exceeds fixed storage. |
| k_cb_io_fault | An argument or host operation failed. |
binding and sink are non-NULL. path is NUL-terminated. Definition at line 254 of file cache_bench_host.c.
References cb_host_output_abort(), cb_host_output_t::destination, cb_host_output_t::dir_fd, cb_host_output_t::fd, internal_create_temp_exclusive(), internal_sink_write(), internal_split_path(), k_cb_host_path_capacity, k_cb_io_capacity, k_cb_io_fault, k_cb_io_ok, memcpy(), O_CLOEXEC, O_DIRECTORY, and strlen().
Referenced by main().
| cb_io_status_t cb_host_scratch_close | ( | cb_host_scratch_t * | binding | ) |
Close the scratch transaction.
Releases the sole descriptor backing the already-unlinked file.
| [in,out] | binding | Open scratch descriptor binding. |
| k_cb_io_ok | The descriptor closed successfully. |
| k_cb_io_fault | The binding was invalid/closed or close failed. |
binding is non-NULL and initialized by cb_host_scratch_open. Definition at line 447 of file cache_bench_host.c.
References cb_host_scratch_t::fd, k_cb_io_fault, and k_cb_io_ok.
Referenced by internal_run_sweep().
| cb_io_status_t cb_host_scratch_open | ( | cb_host_scratch_t * | binding, |
| cb_scratch_t * | scratch ) |
Create an unlinked raw-descriptor scratch transaction.
Creates a host temporary file, immediately unlinks its pathname, and publishes exact positional read/write callbacks.
| [out] | binding | Receives the owned scratch descriptor. |
| [out] | scratch | Receives the injected scratch seam. |
| k_cb_io_ok | The unlinked transaction is open and bound. |
| k_cb_io_fault | An argument, create, or unlink operation failed. |
binding and scratch are non-NULL and writable. binding. Definition at line 427 of file cache_bench_host.c.
References cb_host_scratch_t::fd, internal_scratch_read(), internal_scratch_write(), k_cb_io_fault, and k_cb_io_ok.
Referenced by internal_run_sweep().
| cb_io_status_t cb_host_source_close | ( | cb_host_source_t * | binding | ) |
Close a source binding.
Releases the owned descriptor and marks the binding closed.
| [in,out] | binding | Open host source binding. |
| k_cb_io_ok | The descriptor closed successfully. |
| k_cb_io_fault | The binding was invalid/closed or close failed. |
binding is non-NULL and was initialized by cb_host_source_open. binding. binding. Definition at line 153 of file cache_bench_host.c.
References cb_host_source_t::fd, k_cb_io_fault, and k_cb_io_ok.
Referenced by internal_close_sources(), and internal_load_argv_traces().
| cb_io_status_t cb_host_source_open | ( | const char * | path, |
| cb_host_source_t * | binding, | ||
| cb_source_t * | source ) |
Open a captured-trace path and publish its source seam.
Opens a non-symlink regular file read-only and snapshots its size for mutation checks on every injected read.
| [in] | path | NUL-terminated host path. |
| [out] | binding | Receives the owned descriptor binding. |
| [out] | source | Receives the borrowed source seam. |
| k_cb_io_ok | The source is open and bound. |
| k_cb_io_fault | An argument, open, type, or metadata check failed. |
path names a regular file directly, not a final symlink. binding owns one descriptor until close. binding. binding and must not outlive it. Definition at line 133 of file cache_bench_host.c.
References internal_source_read(), k_cb_io_fault, k_cb_io_ok, O_CLOEXEC, O_NOFOLLOW, and cb_host_source_t::size.
Referenced by internal_load_argv_traces().
Bind the process standard-output and standard-error descriptor sinks.
Publishes non-owning sink callbacks over descriptors one and two.
| [out] | output | Standard-output sink; NULL is accepted. |
| [out] | error | Standard-error sink; NULL is accepted. |
Definition at line 74 of file cache_bench_host.c.
References internal_sink_write().
Referenced by main().