Skip to content

stdlib/virtioView source ↗

virtio

22 items · generated by scribe fromstdlib/virtio.fd· synced 2026-11-15

stdlib/virtio22 items

Contents

VQ_F_NEXT

pub fn VQ_F_NEXT() -> i64 {

Returns: i64

Defined at line 9


VQ_F_WRITE

pub fn VQ_F_WRITE() -> i64 {

Returns: i64

Defined at line 12


VQ_F_INDIRECT

pub fn VQ_F_INDIRECT() -> i64 {

Returns: i64

Defined at line 15


vq_desc_off

Byte offset of the descriptor table inside a queue block.

pub fn vq_desc_off() -> i64 {

Returns: i64

Defined at line 22


vq_avail_off

Byte offset of the avail ring (driver area) — right after 16-byte descriptors.

pub fn vq_avail_off(qsz: i64) -> i64 {

Parameters:

  • qsz: i64

Returns: i64

Defined at line 28


vq_used_off

Byte offset of the used ring (device area): avail ring is 4 + 2*qsz + 2 bytes, then padded to the 4-byte alignment used by virtio’s avail-side alignment rule.

pub fn vq_used_off(qsz: i64) -> i64 {

Parameters:

  • qsz: i64

Returns: i64

Defined at line 35


vq_total_size

Total queue-block bytes for queue size qsz (used ring is 4 + 8*qsz + 2 bytes of used elems and avail_event).

pub fn vq_total_size(qsz: i64) -> i64 {

Parameters:

  • qsz: i64

Returns: i64

Defined at line 46


vq_desc

Write descriptor i: {addr:u64, len:u32, flags:u16, next:u16}.

pub fn vq_desc(q: & mut Vec<i64>, qsz: i64, i: i64, addr: i64, len: i64, flags: i64, next: i64) {

Parameters:

  • q: & mut Vec<i64>
  • qsz: i64
  • i: i64
  • addr: i64
  • len: i64
  • flags: i64
  • next: i64

Defined at line 78


vq_desc_flags

pub fn vq_desc_flags(q: Vec<i64>, i: i64) -> i64 {

Parameters:

  • q: Vec<i64>
  • i: i64

Returns: i64

Defined at line 86


vq_avail_idx

Avail: number of entries pushed so far (idx field).

pub fn vq_avail_idx(q: Vec<i64>, qsz: i64) -> i64 {

Parameters:

  • q: Vec<i64>
  • qsz: i64

Returns: i64

Defined at line 91


vq_avail_push

Push descriptor head head into the avail ring.

pub fn vq_avail_push(q: & mut Vec<i64>, qsz: i64, head: i64) {

Parameters:

  • q: & mut Vec<i64>
  • qsz: i64
  • head: i64

Defined at line 96


vq_used_idx

Used: number of completions the device has written.

pub fn vq_used_idx(q: Vec<i64>, qsz: i64) -> i64 {

Parameters:

  • q: Vec<i64>
  • qsz: i64

Returns: i64

Defined at line 104


vq_used_id

Read used element i as id*4294967296+len… not portable for len near 2^31; use vq_used_id / vq_used_len instead.

pub fn vq_used_id(q: Vec<i64>, qsz: i64, i: i64) -> i64 {

Parameters:

  • q: Vec<i64>
  • qsz: i64
  • i: i64

Returns: i64

Defined at line 110


vq_used_len

pub fn vq_used_len(q: Vec<i64>, qsz: i64, i: i64) -> i64 {

Parameters:

  • q: Vec<i64>
  • qsz: i64
  • i: i64

Returns: i64

Defined at line 114


VqFree

A chain-head tracker for the driver side: which descriptor ids are free, and the head of the free list.

pub struct VqFree {

Fields:

NameType
qszi64
headi64
counti64
nextVec<i64>

Defined at line 120


vq_free_new

All qsz descriptors initially free (0 -> 1 -> … -> -1).

pub fn vq_free_new(qsz: i64) -> VqFree {

Parameters:

  • qsz: i64

Returns: VqFree

Defined at line 129


vq_free_take

Take n free descriptor ids into a caller Vec; returns false when the queue has fewer than n.

pub fn vq_free_take(f: & mut VqFree, n: i64, into: & mut Vec<i64>) -> bool {

Parameters:

  • f: & mut VqFree
  • n: i64
  • into: & mut Vec<i64>

Returns: bool

Defined at line 147


vq_free_chain

Return a chain head’s descriptors to the free list (follows NEXT flags in the queue block).

pub fn vq_free_chain(f: & mut VqFree, q: Vec<i64>, head: i64) {

Parameters:

  • f: & mut VqFree
  • q: Vec<i64>
  • head: i64

Defined at line 164


Generated by scribe, the Fides documentation generator