#[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
impl DeviceRepr
sourcepub fn new(
kso_hdr: KsoHdr,
device_type: DeviceType,
bus_type: BusType,
device_id: DeviceId,
) -> DeviceRepr
pub fn new( kso_hdr: KsoHdr, device_type: DeviceType, bus_type: BusType, device_id: DeviceId, ) -> DeviceRepr
Construct a new device repr.
sourcepub fn wait_for_interrupt(&self, inum: usize, timeout: Option<Duration>) -> u64
pub fn wait_for_interrupt(&self, inum: usize, timeout: Option<Duration>) -> u64
Block until an interrupt fires.
pub fn setup_interrupt_sleep(&self, inum: usize) -> ThreadSyncSleep
pub fn submit_mailbox_msg(&self, mb: MailboxPriority, msg: u64)
sourcepub fn check_for_interrupt(&self, inum: usize) -> Option<u64>
pub fn check_for_interrupt(&self, inum: usize) -> Option<u64>
Poll an interrupt vector to see if it has fired.
sourcepub fn check_for_mailbox(&self, inum: usize) -> Option<u64>
pub fn check_for_mailbox(&self, inum: usize) -> Option<u64>
Poll an interrupt vector to see if it has fired.
sourcepub fn register_interrupt(
&mut self,
inum: usize,
vec: InterruptVector,
flags: DeviceInterruptFlags,
)
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
impl BaseType for DeviceRepr
source§fn init<T>(_t: T) -> DeviceRepr
fn init<T>(_t: T) -> DeviceRepr
Construct a new base type.
Returns a list of valid tags and versions for this type.
Auto Trait Implementations§
impl !DeviceSync for DeviceRepr
impl !Freeze for DeviceRepr
impl ObjSafe for DeviceRepr
impl RefUnwindSafe for DeviceRepr
impl Send for DeviceRepr
impl Sync for DeviceRepr
impl Unpin for DeviceRepr
impl UnwindSafe for DeviceRepr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more