pub trait IrqScheme: Scheme {
fn is_valid_irq(&self, irq_num: usize) -> bool;
fn mask(&self, irq_num: usize) -> Result<(), DeviceError>;
fn unmask(&self, irq_num: usize) -> Result<(), DeviceError>;
fn register_handler(
&self,
irq_num: usize,
handler: Box<dyn Fn() + Sync + Send + 'static, Global>
) -> Result<(), DeviceError>;
fn unregister(&self, irq_num: usize) -> Result<(), DeviceError>;
fn configure(
&self,
_irq_num: usize,
_tm: IrqTriggerMode,
_pol: IrqPolarity
) -> Result<(), DeviceError> { ... }
fn register_device(
&self,
irq_num: usize,
dev: Arc<dyn Scheme + 'static>
) -> Result<(), DeviceError> { ... }
fn msi_alloc_block(
&self,
_requested_irqs: usize
) -> Result<Range<usize>, DeviceError> { ... }
fn msi_free_block(&self, _block: Range<usize>) -> Result<(), DeviceError> { ... }
fn msi_register_handler(
&self,
_block: Range<usize>,
_msi_id: usize,
_handler: Box<dyn Fn() + Sync + Send + 'static, Global>
) -> Result<(), DeviceError> { ... }
fn init_hart(&self) { ... }
fn apic_timer_enable(&self) { ... }
}
Required Methods
fn is_valid_irq(&self, irq_num: usize) -> bool
fn is_valid_irq(&self, irq_num: usize) -> bool
Is a valid IRQ number.
Add an interrupt handler to an IRQ.
fn unregister(&self, irq_num: usize) -> Result<(), DeviceError>
fn unregister(&self, irq_num: usize) -> Result<(), DeviceError>
Remove the interrupt handler to an IRQ.
Provided Methods
fn configure(
&self,
_irq_num: usize,
_tm: IrqTriggerMode,
_pol: IrqPolarity
) -> Result<(), DeviceError>
fn configure(
&self,
_irq_num: usize,
_tm: IrqTriggerMode,
_pol: IrqPolarity
) -> Result<(), DeviceError>
Configure the specified interrupt vector. If it is invoked, it must be invoked prior to interrupt registration.
fn register_device(
&self,
irq_num: usize,
dev: Arc<dyn Scheme + 'static>
) -> Result<(), DeviceError>
fn register_device(
&self,
irq_num: usize,
dev: Arc<dyn Scheme + 'static>
) -> Result<(), DeviceError>
Register the device to delivery an IRQ.
fn msi_alloc_block(
&self,
_requested_irqs: usize
) -> Result<Range<usize>, DeviceError>
fn msi_alloc_block(
&self,
_requested_irqs: usize
) -> Result<Range<usize>, DeviceError>
Method used for platform allocation of blocks of MSI and MSI-X compatible IRQ targets.
fn msi_free_block(&self, _block: Range<usize>) -> Result<(), DeviceError>
fn msi_free_block(&self, _block: Range<usize>) -> Result<(), DeviceError>
Method used to free a block of MSI IRQs previously allocated by msi_alloc_block(). This does not unregister IRQ handlers.
Register a handler function for a given msi_id within an msi_block_t. Passing a NULL handler will effectively unregister a handler for a given msi_id within the block.
Init irq for current cpu. Some IRQ hardware requires per-CPU initialization.
fn apic_timer_enable(&self)
fn apic_timer_enable(&self)
[for x86_64] enable apic timer