squib_virtio/feature_bits.rs
1//! Common virtio feature bits.
2//!
3//! Per [virtio v1.2 § 6 ("Reserved Feature Bits")][spec]. Only the bits squib
4//! actually negotiates appear here; per-device features live alongside their
5//! respective device modules in [`crate::devices`].
6//!
7//! Each constant carries the **shift** in the section header so the doc
8//! tracks the actual `1 << N` value below it.
9//!
10//! [spec]: https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-2680006
11
12/// `24` — `VIRTIO_F_NOTIFY_ON_EMPTY`. Device sends interrupt when the queue
13/// is fully consumed (used in legacy block; squib's edge-pulse model
14/// trivially satisfies it).
15pub const NOTIFY_ON_EMPTY: u64 = 1 << 24;
16/// `27` — `VIRTIO_F_ANY_LAYOUT`. Driver may pack request headers and bodies
17/// into a single descriptor; required for modern net / block.
18pub const ANY_LAYOUT: u64 = 1 << 27;
19/// `32` — `VIRTIO_F_VERSION_1`. The device offers v1.0+ semantics. Squib
20/// **always** offers this; legacy mode is not supported.
21pub const VERSION_1: u64 = 1 << 32;
22/// `33` — `VIRTIO_F_ACCESS_PLATFORM`. Required when the platform interposes
23/// IOMMU or memory protection. Off on squib (HVF stage-2 is direct-mapped).
24pub const ACCESS_PLATFORM: u64 = 1 << 33;
25/// `34` — `VIRTIO_F_RING_PACKED`. Packed-ring layout. Off on squib for 1.0;
26/// classic split-ring keeps the queue handler simple.
27pub const RING_PACKED: u64 = 1 << 34;
28/// `35` — `VIRTIO_F_IN_ORDER`. Used buffers ack in submission order.
29pub const IN_ORDER: u64 = 1 << 35;
30/// `36` — `VIRTIO_F_ORDER_PLATFORM`. Memory ordering follows platform rules.
31pub const ORDER_PLATFORM: u64 = 1 << 36;
32/// `38` — `VIRTIO_F_NOTIFICATION_DATA`. Driver writes notification data
33/// alongside the queue index.
34pub const NOTIFICATION_DATA: u64 = 1 << 38;