summaryrefslogtreecommitdiff
path: root/libcpu
diff options
context:
space:
mode:
authorheyuanjie87 <[email protected]>2024-11-05 16:00:36 +0800
committerRbb666 <[email protected]>2024-11-15 14:34:32 +0800
commit2b21b095f9d759602262c929bf1ccb154d3fd3ce (patch)
tree64b941f4cf01252287a58b703e5570cd26dbc396 /libcpu
parent0d9185bd5a6d83b79f84d4abef68b8b05f42b6fc (diff)
[libcpu]riscv使用call指令解决长跳转问题
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/risc-v/common64/context_gcc.S8
-rw-r--r--libcpu/risc-v/common64/interrupt_gcc.S6
2 files changed, 8 insertions, 6 deletions
diff --git a/libcpu/risc-v/common64/context_gcc.S b/libcpu/risc-v/common64/context_gcc.S
index 8858f6c104..ed216716b0 100644
--- a/libcpu/risc-v/common64/context_gcc.S
+++ b/libcpu/risc-v/common64/context_gcc.S
@@ -77,11 +77,11 @@
rt_hw_context_switch_to:
LOAD sp, (a0)
- jal rt_thread_self
+ call rt_thread_self
mv s1, a0
#ifdef RT_USING_SMART
- jal lwp_aspace_switch
+ call lwp_aspace_switch
#endif
RESTORE_CONTEXT
@@ -104,11 +104,11 @@ rt_hw_context_switch:
LOAD sp, (a1)
// restore Address Space
- jal rt_thread_self
+ call rt_thread_self
mv s1, a0
#ifdef RT_USING_SMART
- jal lwp_aspace_switch
+ call lwp_aspace_switch
#endif
RESTORE_CONTEXT
diff --git a/libcpu/risc-v/common64/interrupt_gcc.S b/libcpu/risc-v/common64/interrupt_gcc.S
index 16778523d9..015900a16d 100644
--- a/libcpu/risc-v/common64/interrupt_gcc.S
+++ b/libcpu/risc-v/common64/interrupt_gcc.S
@@ -46,7 +46,8 @@ _distinguish_syscall:
#ifdef RT_USING_SMART
// TODO swap 8 with config macro name
li t1, 8
- beq t0, t1, syscall_entry
+ bne t0, t1, _handle_interrupt_and_exception
+ call syscall_entry
// syscall never return here
#endif
@@ -78,7 +79,8 @@ _resume_execution:
#ifdef RT_USING_SMART
LOAD t0, FRAME_OFF_SSTATUS(sp)
andi t0, t0, SSTATUS_SPP
- beqz t0, arch_ret_to_user
+ bnez t0, _resume_kernel
+ call arch_ret_to_user
#endif
_resume_kernel: