From cfe7c4a3bcf58b8a5a6d99a6a616b9fd9183c81d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 27 Mar 2020 16:21:46 +0800 Subject: [PATCH] kernel: irq: take() previous process pair This prevents us from continuously resuming the same task Signed-off-by: Sean Cross --- kernel/src/arch/riscv/irq.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/arch/riscv/irq.rs b/kernel/src/arch/riscv/irq.rs index 7d70adb16..a1862cbfd 100644 --- a/kernel/src/arch/riscv/irq.rs +++ b/kernel/src/arch/riscv/irq.rs @@ -177,7 +177,7 @@ pub extern "C" fn trap_handler( // we're in an interrupt context, it is safe to access this // global variable. let (previous_pid, previous_context) = unsafe { - PREVIOUS_PAIR.expect("got an instruction page fault with no previous PID") + PREVIOUS_PAIR.take().expect("got an instruction page fault with no previous PID") }; println!( "ISR: Resuming previous pair of ({}, {})",