Crate libriscv

Crate libriscv 

Source
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§

sys

Structs§

ErrorContext
Context passed to safe error callbacks.
ErrorHandler
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.
OptionsBuilder
Builder for Options.
Registers
Borrowed access to the machine registers.
StdoutContext
Context passed to safe stdout callbacks.
StdoutHandler
A safe wrapper for the stdout callback function pointer.
SyscallContext
Context passed to safe syscall handlers.
SyscallHandler
A syscall handler that obeys libriscv’s FFI invariants.
SyscallId
A validated syscall index.
SyscallRegisters
Borrowed access to syscall registers.
SyscallRegistry
Token that marks syscall handlers as finalized for machine creation.
SyscallRegistryBuilder
Builder for registering syscall handlers before creating machines.
SyscallResult
Result wrapper for syscall handlers.

Enums§

Error
ErrorType
Known error types reported by libriscv.

Constants§

SYSCALLS_MAX
Maximum number of syscall handlers supported by libriscv.

Traits§

SyscallHandlerOutput
Output handling for callback handlers.

Type Aliases§

Result

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.