Trait dbs_interrupt::InterruptManager
source · pub trait InterruptManager {
// Required methods
fn create_group(
&self,
type_: InterruptSourceType,
base: InterruptIndex,
count: InterruptIndex
) -> Result<Arc<Box<dyn InterruptSourceGroup>>>;
fn destroy_group(
&self,
group: Arc<Box<dyn InterruptSourceGroup>>
) -> Result<()>;
}
Expand description
Trait to manage interrupt sources for virtual device backends.
The InterruptManager implementations should protect itself from concurrent accesses internally, so it could be invoked from multi-threaded context.
Required Methods§
sourcefn create_group(
&self,
type_: InterruptSourceType,
base: InterruptIndex,
count: InterruptIndex
) -> Result<Arc<Box<dyn InterruptSourceGroup>>>
fn create_group( &self, type_: InterruptSourceType, base: InterruptIndex, count: InterruptIndex ) -> Result<Arc<Box<dyn InterruptSourceGroup>>>
Create an InterruptSourceGroup object to manage interrupt sources for a virtual device.
An InterruptSourceGroup object manages all interrupt sources of the same type for a virtual device.
Arguments
- type_: type of interrupt source.
- base: base Interrupt Source ID to be managed by the group object.
- count: number of Interrupt Sources to be managed by the group object.
sourcefn destroy_group(&self, group: Arc<Box<dyn InterruptSourceGroup>>) -> Result<()>
fn destroy_group(&self, group: Arc<Box<dyn InterruptSourceGroup>>) -> Result<()>
Destroy an InterruptSourceGroup object created by create_group().
Assume the caller takes the responsibility to disable all interrupt sources of the group before calling destroy_group(). This assumption helps to simplify InterruptSourceGroup implementations.