VirtioInterrupt

Trait VirtioInterrupt 

Source
pub trait VirtioInterrupt:
    Debug
    + Send
    + Sync {
    // Required methods
    fn trigger(
        &self,
        interrupt_type: VirtioInterruptType,
    ) -> Result<(), InterruptError>;
    fn status(&self) -> Arc<AtomicU32>;

    // Provided methods
    fn trigger_queues(&self, queues: &[u16]) -> Result<(), InterruptError> { ... }
    fn notifier(&self, _interrupt_type: VirtioInterruptType) -> Option<&EventFd> { ... }
}
Expand description

API of interrupt types used by VirtIO devices

Required Methods§

Source

fn trigger( &self, interrupt_type: VirtioInterruptType, ) -> Result<(), InterruptError>

Trigger a VirtIO interrupt.

Source

fn status(&self) -> Arc<AtomicU32>

Get the current device interrupt status.

Provided Methods§

Source

fn trigger_queues(&self, queues: &[u16]) -> Result<(), InterruptError>

Trigger multiple Virtio interrupts for selected queues. The caller needs to ensure that [queues] does not include duplicate entries to avoid sending multiple interrupts for the same queue. This is to allow sending a single interrupt for implementations that don’t distinguish different queues, like IrqTrigger, instead of sending multiple same interrupts.

Source

fn notifier(&self, _interrupt_type: VirtioInterruptType) -> Option<&EventFd>

Get the EventFd (if any) that backs the underlying interrupt.

Implementors§