(_trap_cx: &TrapContext)
| 145 | |
| 146 | #[no_mangle] |
| 147 | pub fn trap_from_kernel(_trap_cx: &TrapContext) { |
| 148 | let scause = scause::read(); |
| 149 | let stval = stval::read(); |
| 150 | match scause.cause() { |
| 151 | Trap::Interrupt(Interrupt::SupervisorExternal) => { |
| 152 | crate::board::irq_handler(); |
| 153 | } |
| 154 | Trap::Interrupt(Interrupt::SupervisorTimer) => { |
| 155 | set_next_trigger(); |
| 156 | check_timer(); |
| 157 | // do not schedule now |
| 158 | } |
| 159 | _ => { |
| 160 | panic!( |
| 161 | "Unsupported trap from kernel: {:?}, stval = {:#x}!", |
| 162 | scause.cause(), |
| 163 | stval |
| 164 | ); |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | pub use context::TrapContext; |
nothing calls this directly
no test coverage detected