Expand description
Safe wrapper for libriscv_sys.
This crate owns the ELF binary and option storage so the underlying C API receives stable pointers for the lifetime of the machine.
Modules§
Structs§
- Error
Context - Context passed to safe error callbacks.
- Error
Handler - A safe wrapper for the error callback function pointer.
- Machine
- A running instance of the libriscv machine.
- Opaque
- Opaque pointer passed through the C API.
- Options
- Configuration for creating a RISC-V machine.
- Options
Builder - Builder for
Options. - Registers
- Borrowed access to the machine registers.
- Stdout
Context - Context passed to safe stdout callbacks.
- Stdout
Handler - A safe wrapper for the stdout callback function pointer.
- Syscall
Context - Context passed to safe syscall handlers.
- Syscall
Handler - A syscall handler that obeys libriscv’s FFI invariants.
- Syscall
Id - A validated syscall index.
- Syscall
Registers - Borrowed access to syscall registers.
- Syscall
Registry - Token that marks syscall handlers as finalized for machine creation.
- Syscall
Registry Builder - Builder for registering syscall handlers before creating machines.
- Syscall
Result - Result wrapper for syscall handlers.
Enums§
Constants§
- SYSCALLS_
MAX - Maximum number of syscall handlers supported by libriscv.
Traits§
- Syscall
Handler Output - Output handling for callback handlers.
Type Aliases§
Attribute Macros§
- error_
handler - Define a safe error handler and generate a
*_handler()constructor. - stdout_
handler - Define a safe stdout handler and generate a
*_handler()constructor. - syscall
- Define a safe syscall handler with an id and generate a
*_handler()constructor. - syscall_
handler - Define a safe syscall handler and generate a
*_handler()constructor. - syscall_
registry - Define a syscall registry for module-local handlers.