Minimal type-safe definitions of the virtio data structures.
Contains definitions and type-safe accessors and manipulators of the virtio data structures.
For the leaf data structures like descriptors these definitions are simply the in
memory layout as a Rust
Unfortunately the virtqueues are a variable sized data structure, whose length is not known till
run time as the size is determined by the driver. Representing the virtqueue as ‘just’ a Rust
struct is therefore not possible.
These abstractions are intended to be type-safe, but not enforce correct implementation of the
virtio protocols. As such reading the [virtio specification]
is required to correctly use this module. Most likely you do not want to use these directly and
want to use the higher level
chain modules that
provide easier to use wrappers.
- Virtio descriptor data structure
- Represents the device owned data.
- Representation of driver owned data.
- Representation of an entry in the used ring.
- Describes descriptor access direction.
- Descriptor contains a list of buffer descriptors.
- Descriptor has a next field.
- Descriptor is device write-only (otherwise device read-only).