Skip to main content

SubmitRing

Struct SubmitRing 

Source
#[repr(C)]
pub struct SubmitRing { pub submit_head: u32, pub submit_tail: u32, pub complete_head: u32, pub complete_tail: u32, pub _pad: [u8; 48], }
Expand description

Shared-memory ring buffer mapped into both kernel and domain.

This struct defines the memory layout. The actual ring is initialized by the kernel and mapped at RING_VADDR in the domain’s address space.

Synchronization protocol:

  1. Domain writes entries, advances submit_head (Release)
  2. Domain calls SYS_SUBMIT
  3. Kernel reads entries from submit_tail to submit_head (Acquire)
  4. Kernel writes completions, advances complete_head (Release)
  5. Domain reads completions from complete_tail to complete_head (Acquire)

Fields§

§submit_head: u32

Next slot for userspace to write (producer).

§submit_tail: u32

Next slot for kernel to process (consumer).

§complete_head: u32

Next completion slot for kernel to write (producer).

§complete_tail: u32

Next completion slot for userspace to read (consumer).

§_pad: [u8; 48]

Padding to cache-line boundary.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.