twizzler_abi::device

Struct DeviceRepr

source
#[repr(C)]
pub struct DeviceRepr { pub device_type: DeviceType, pub bus_type: BusType, pub device_id: DeviceId, pub interrupts: [DeviceInterrupt; 32], pub mailboxes: [AtomicU64; 3], /* private fields */ }
Expand description

The base struct for a device object.

Fields§

§device_type: DeviceType§bus_type: BusType§device_id: DeviceId§interrupts: [DeviceInterrupt; 32]§mailboxes: [AtomicU64; 3]

Implementations§

source§

impl DeviceRepr

source

pub fn new( kso_hdr: KsoHdr, device_type: DeviceType, bus_type: BusType, device_id: DeviceId, ) -> Self

Construct a new device repr.

source

pub fn wait_for_interrupt(&self, inum: usize, timeout: Option<Duration>) -> u64

Block until an interrupt fires.

source

pub fn setup_interrupt_sleep(&self, inum: usize) -> ThreadSyncSleep

source

pub fn submit_mailbox_msg(&self, mb: MailboxPriority, msg: u64)

source

pub fn check_for_interrupt(&self, inum: usize) -> Option<u64>

Poll an interrupt vector to see if it has fired.

source

pub fn check_for_mailbox(&self, inum: usize) -> Option<u64>

Poll an interrupt vector to see if it has fired.

source

pub fn register_interrupt( &mut self, inum: usize, vec: InterruptVector, flags: DeviceInterruptFlags, )

Register an interrupt vector with this device.

Trait Implementations§

source§

impl BaseType for DeviceRepr

source§

fn init<T>(_t: T) -> Self

Construct a new base type.
source§

fn tags() -> &'static [(BaseVersion, BaseTag)]

Returns a list of valid tags and versions for this type.
source§

impl Display for DeviceRepr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.