xref: /DragonOS/kernel/src/arch/riscv64/interrupt/mod.rs (revision 83ed0ebc293d5a10245089f627f52770fd5b9dd4)
1 use crate::exception::{InterruptArch, IrqFlags, IrqFlagsGuard};
2 
3 pub mod ipi;
4 
5 pub struct RiscV64InterruptArch;
6 
7 impl InterruptArch for RiscV64InterruptArch {
8     unsafe fn interrupt_enable() {
9         unimplemented!("RiscV64InterruptArch::interrupt_enable")
10     }
11 
12     unsafe fn interrupt_disable() {
13         unimplemented!("RiscV64InterruptArch::interrupt_disable")
14     }
15 
16     fn is_irq_enabled() -> bool {
17         unimplemented!("RiscV64InterruptArch::is_irq_enabled")
18     }
19 
20     unsafe fn save_and_disable_irq() -> IrqFlagsGuard {
21         unimplemented!("RiscV64InterruptArch::save_and_disable_irq")
22     }
23 
24     unsafe fn restore_irq(flags: IrqFlags) {
25         unimplemented!("RiscV64InterruptArch::restore_irq")
26     }
27 }
28 
29 /// 中断栈帧结构体
30 #[repr(C)]
31 #[derive(Debug, Copy, Clone)]
32 pub struct TrapFrame {
33     // todo
34 }
35 
36 impl TrapFrame {
37     /// 判断当前中断是否来自用户模式
38     pub fn from_user(&self) -> bool {
39         unimplemented!("TrapFrame::from_user")
40     }
41 }
42