File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
components/lwp/arch/risc-v/rv64 Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,20 @@ arch_crt_start_umode:
75
75
* we handle following things here:
76
76
* 1. restoring user mode debug state (not support yet)
77
77
* 2. handling thread's exit request
78
- * 3. handling POSIX signal
78
+ * 3. handling POSIX signal (skipped for signal quit path)
79
79
* 4. restoring user context
80
80
* 5. jump to user mode
81
81
*/
82
82
.global arch_ret_to_user
83
83
arch_ret_to_user:
84
+ li s0, 1 // flag=1 (normal path)
85
+ j arch_ret_to_user_impl
86
+
87
+ .global arch_signal_quit_ret_to_user
88
+ arch_signal_quit_ret_to_user:
89
+ li s0, 0 // flag=0 (signal quit path)
90
+
91
+ arch_ret_to_user_impl:
84
92
// TODO: we don't support kernel gdb server in risc-v yet
85
93
// so we don't check debug state here and handle debugging bussiness
86
94
@@ -90,6 +98,8 @@ arch_ret_to_user:
90
98
call sys_exit
91
99
92
100
1:
101
+ // Skip signal handling if coming from arch_signal_quit
102
+ beqz s0, ret_to_user_exit
93
103
mv a0, sp
94
104
call lwp_thread_signal_catch
95
105
@@ -119,7 +129,7 @@ arch_signal_quit:
119
129
120
130
RESTORE_ALL
121
131
SAVE_ALL
122
- j arch_ret_to_user
132
+ j arch_signal_quit_ret_to_user
123
133
124
134
/**
125
135
* rt_noreturn
You can’t perform that action at this time.
0 commit comments