axhal/irq.rs
1//! Interrupt management.
2
3use axcpu::trap::{IRQ, register_trap_handler};
4
5pub use axplat::irq::{handle, register, set_enable, unregister};
6
7#[cfg(feature = "ipi")]
8pub use axplat::irq::{IpiTarget, send_ipi};
9
10#[cfg(feature = "ipi")]
11pub use axconfig::devices::IPI_IRQ;
12
13/// IRQ handler.
14///
15/// # Warn
16///
17/// Make sure called in an interrupt context or hypervisor VM exit handler.
18#[register_trap_handler(IRQ)]
19pub fn irq_handler(vector: usize) -> bool {
20 let guard = kernel_guard::NoPreempt::new();
21 handle(vector);
22 drop(guard); // rescheduling may occur when preemption is re-enabled.
23 true
24}