Skip to content

Commit 2b21b09

Browse files
heyuanjie87Rbb666
authored andcommitted
[libcpu]riscv使用call指令解决长跳转问题
1 parent 0d9185b commit 2b21b09

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

libcpu/risc-v/common64/context_gcc.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@
7777
rt_hw_context_switch_to:
7878
LOAD sp, (a0)
7979

80-
jal rt_thread_self
80+
call rt_thread_self
8181
mv s1, a0
8282

8383
#ifdef RT_USING_SMART
84-
jal lwp_aspace_switch
84+
call lwp_aspace_switch
8585
#endif
8686

8787
RESTORE_CONTEXT
@@ -104,11 +104,11 @@ rt_hw_context_switch:
104104
LOAD sp, (a1)
105105

106106
// restore Address Space
107-
jal rt_thread_self
107+
call rt_thread_self
108108
mv s1, a0
109109

110110
#ifdef RT_USING_SMART
111-
jal lwp_aspace_switch
111+
call lwp_aspace_switch
112112
#endif
113113

114114
RESTORE_CONTEXT

libcpu/risc-v/common64/interrupt_gcc.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ _distinguish_syscall:
4646
#ifdef RT_USING_SMART
4747
// TODO swap 8 with config macro name
4848
li t1, 8
49-
beq t0, t1, syscall_entry
49+
bne t0, t1, _handle_interrupt_and_exception
50+
call syscall_entry
5051
// syscall never return here
5152
#endif
5253

@@ -78,7 +79,8 @@ _resume_execution:
7879
#ifdef RT_USING_SMART
7980
LOAD t0, FRAME_OFF_SSTATUS(sp)
8081
andi t0, t0, SSTATUS_SPP
81-
beqz t0, arch_ret_to_user
82+
bnez t0, _resume_kernel
83+
call arch_ret_to_user
8284
#endif
8385

8486
_resume_kernel:

0 commit comments

Comments
 (0)