Module devices::virtio::iommu::protocol

source ·
Expand description

This file was generated by the following commands and modified manually.

$ bindgen virtio_iommu.h              \
    --allowlist-type "virtio_iommu.*" \
    --allowlist-var "VIRTIO_IOMMU_.*" \
    --with-derive-default            \
    --no-layout-tests                \
    --no-prepend-enum-name > protocol.rs
$ sed -i "s/__u/u/g" protocol.rs
$ sed -i "s/__le/Le/g" protocol.rs

The main points of the manual modifications are as follows:
* Removed `head` and `tail` from each command struct. Instead, we process
  them as separate payloads.
* Derive implementations of zerocopy::{AsBytes, FromZeroes, FromBytes} as needed.
* Use of `packed` because removing `head` and `tail` introduces paddings
* Remove `IncompleteArrayField`
* Convert padding of [u8; 64usize] to [u64; 8usize]. According to the rust
  doc, "Arrays of sizes from 0 to 32 (inclusive) implement the Default trait
  if the element type allows it."

Structs§

Constants§