mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-05-21 01:24:35 +08:00
[lwp][rv64] riscv: fix potential signal handler infinite loop
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
This commit is contained in:
@@ -75,12 +75,20 @@ arch_crt_start_umode:
|
||||
* we handle following things here:
|
||||
* 1. restoring user mode debug state (not support yet)
|
||||
* 2. handling thread's exit request
|
||||
* 3. handling POSIX signal
|
||||
* 3. handling POSIX signal (skipped for signal quit path)
|
||||
* 4. restoring user context
|
||||
* 5. jump to user mode
|
||||
*/
|
||||
.global arch_ret_to_user
|
||||
arch_ret_to_user:
|
||||
li s0, 1 // flag=1 (normal path)
|
||||
j arch_ret_to_user_impl
|
||||
|
||||
.global arch_signal_quit_ret_to_user
|
||||
arch_signal_quit_ret_to_user:
|
||||
li s0, 0 // flag=0 (signal quit path)
|
||||
|
||||
arch_ret_to_user_impl:
|
||||
// TODO: we don't support kernel gdb server in risc-v yet
|
||||
// so we don't check debug state here and handle debugging bussiness
|
||||
|
||||
@@ -90,6 +98,8 @@ arch_ret_to_user:
|
||||
call sys_exit
|
||||
|
||||
1:
|
||||
// Skip signal handling if coming from arch_signal_quit
|
||||
beqz s0, ret_to_user_exit
|
||||
mv a0, sp
|
||||
call lwp_thread_signal_catch
|
||||
|
||||
@@ -119,7 +129,7 @@ arch_signal_quit:
|
||||
|
||||
RESTORE_ALL
|
||||
SAVE_ALL
|
||||
j arch_ret_to_user
|
||||
j arch_signal_quit_ret_to_user
|
||||
|
||||
/**
|
||||
* rt_noreturn
|
||||
|
||||
Reference in New Issue
Block a user