sparreal_kernel/driver/
irq.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
pub use driver_interface::irq::*;
use driver_interface::DriverKind;
use log::info;

use crate::{platform, struct_driver};

use super::{irq_chip_list, probe_by_register, register_by_kind};

pub(super) async fn init_irq() {
    for reg in register_by_kind(DriverKind::InteruptChip) {
        let _ = probe_by_register(reg).await;
    }

    for chip in irq_chip_list() {
        info!("CPU {} IRQ init", unsafe { platform::cpu_id_display() });
        chip.spec.read().current_cpu_setup();
        info!("IRQ chip init success!");
    }
}

struct_driver!(DriverIrqChip, BoxDriver);