et-abi
Shared host/device ABI types for the Esperanto ET-SoC-1, used by the
et-rs host driver and the
et-k-rs device-side kernel library.
A kernel launch passes its arguments by pointer: the host stages an argument
struct in device memory and the firmware delivers its address to the kernel (in
register a0). This crate defines those argument structs once, so the host
launcher and the device kernel cannot drift on field order, sizes, or padding.
Because both the host (x86-64) and the device (RV64) are little-endian, the
in-memory #[repr(C)] layout is the wire layout: the host takes the struct's
bytes with [DeviceArgs::as_bytes] and the kernel reinterprets the pointer with
[DeviceArgs::from_ptr]. No serialisation step is involved.
The crate is no_std with no dependencies, so it builds for the host and for the
riscv64imac-unknown-none-elf device target alike.
use ;
// Host: build the args the kernel will read.
let args = ReduceArgs ;
let bytes: & = args.as_bytes;
// Device: recover them from the pointer the firmware passed in a0.
// let args = unsafe { ReduceArgs::from_ptr(a0 as *const u8) };
Licence
Apache-2.0.