Expand description
§Thruput syscall dispatch
The raw guest-exit boundary for Thruput syscalls. This crate contains the
single dispatch chokepoint, syscall_wrapper, which leaves the guest and
executes a system call. It speaks only in integer words (SyscallWord) and
raw i32 error codes — the typed SyscallNo / SysErr layer lives in
thruput-xdr.
A dispatch path exists only when the target is riscv32, or when the
syscalls_mock feature is enabled. On any other target (a plain host
without the mock) there is no way to leave the guest, so the dispatch
chokepoint syscall_wrapper is not exported. This keeps a feature-less host
build (and cargo build -p, cargo hack, rust-analyzer) clean without a
compile_error! guard. The SyscallWord type alias, by contrast, is a pure
pointer-width type with no dispatch dependency, so it is always defined.
There are two guest dispatch paths, selected by target:
- riscv32:
syscall_wrapperissues the RISC-Vecalltrap instruction directly, passing the syscall number ina0and arguments ina1..a7(the host returns the error code ina0). - native mock (
syscalls_mock):syscall_wrappercalls a nativesyscall_wrapper_implsymbol, used bynative_execin the SDK and by the syscall tests.
You should never need to invoke syscall_wrapper directly; instead use the
typed bindings generated in thruput-xdr.
Functions§
- syscall_
wrapper - The single dispatch chokepoint: leaves the guest and executes a syscall.