summaryrefslogtreecommitdiff
path: root/libcpu
diff options
context:
space:
mode:
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/risc-v/common/interrupt_gcc.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcpu/risc-v/common/interrupt_gcc.S b/libcpu/risc-v/common/interrupt_gcc.S
index 6eb0ef371f..dad8cac424 100644
--- a/libcpu/risc-v/common/interrupt_gcc.S
+++ b/libcpu/risc-v/common/interrupt_gcc.S
@@ -102,12 +102,18 @@ SW_handler:
/* interrupt handle */
call rt_interrupt_enter
/* Do the work after saving the above */
- jal rt_hw_do_after_save_above
+ call rt_hw_do_after_save_above
call rt_interrupt_leave
/* switch to from thread stack */
csrrw sp,mscratch,sp
+ /* Check if we are in interrupt nesting, if so, skip task switching */
+ la t0, rt_interrupt_nest
+ lw t1, 0(t0)
+ li t2, 1
+ bge t1, t2, 1f
+
/* Determine whether to trigger scheduling at the interrupt function */
la t0, rt_thread_switch_interrupt_flag
lw t2, 0(t0)