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§
Sourcefn trigger(
&self,
interrupt_type: VirtioInterruptType,
) -> Result<(), InterruptError>
fn trigger( &self, interrupt_type: VirtioInterruptType, ) -> Result<(), InterruptError>
Trigger a VirtIO interrupt.
Provided Methods§
Sourcefn trigger_queues(&self, queues: &[u16]) -> Result<(), InterruptError>
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.
Sourcefn notifier(&self, _interrupt_type: VirtioInterruptType) -> Option<&EventFd>
fn notifier(&self, _interrupt_type: VirtioInterruptType) -> Option<&EventFd>
Get the EventFd (if any) that backs the underlying interrupt.