From 3dc706ee3eb375797ca6eee372ad35ecffc7ba48 Mon Sep 17 00:00:00 2001 From: acevest Date: Fri, 24 Apr 2020 10:09:25 +0800 Subject: [PATCH] fix the bug of checking whether the task needs to be switched when the riscv irq returns --- arch/risc-v/rv32i/gcc/port_s.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/risc-v/rv32i/gcc/port_s.S b/arch/risc-v/rv32i/gcc/port_s.S index c4adb91d..00b96851 100644 --- a/arch/risc-v/rv32i/gcc/port_s.S +++ b/arch/risc-v/rv32i/gcc/port_s.S @@ -208,10 +208,10 @@ port_context_switch: sw t0, __reg_mstatus_OFFSET(sp) +switch_task: la t0, k_curr_task // t0 = &k_curr_task la t1, k_next_task // t1 = &k_next_task -switch_task: // save sp to k_curr_task.sp lw t2, (t0) sw sp, (t2) @@ -311,8 +311,8 @@ rv32_exception_entry: // switch back to task stack lw sp, (sp) - la t0, k_curr_task - la t1, k_next_task + lw t0, k_curr_task + lw t1, k_next_task // unlikely bne t0, t1, irq_task_switch