fix the bug of checking whether the task needs to be switched when the riscv irq returns

This commit is contained in:
acevest
2020-04-24 10:09:25 +08:00
parent 051613f8a8
commit 3dc706ee3e

View File

@@ -208,10 +208,10 @@ port_context_switch:
sw t0, __reg_mstatus_OFFSET(sp) sw t0, __reg_mstatus_OFFSET(sp)
switch_task:
la t0, k_curr_task // t0 = &k_curr_task la t0, k_curr_task // t0 = &k_curr_task
la t1, k_next_task // t1 = &k_next_task la t1, k_next_task // t1 = &k_next_task
switch_task:
// save sp to k_curr_task.sp // save sp to k_curr_task.sp
lw t2, (t0) lw t2, (t0)
sw sp, (t2) sw sp, (t2)
@@ -311,8 +311,8 @@ rv32_exception_entry:
// switch back to task stack // switch back to task stack
lw sp, (sp) lw sp, (sp)
la t0, k_curr_task lw t0, k_curr_task
la t1, k_next_task lw t1, k_next_task
// unlikely // unlikely
bne t0, t1, irq_task_switch bne t0, t1, irq_task_switch