mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 02:06:14 +08:00
[smart/syscall] fix exit(2) and add exit_group(2) (#8005)
Signed-off-by: shell <smokewood@qq.com> Signed-off-by: shell <wangxiaoyao@rt-thread.com> Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
@@ -34,7 +34,6 @@ extern long list_thread(void);
|
||||
#include <lwp_core_dump.h>
|
||||
#endif
|
||||
|
||||
void sys_exit(int value);
|
||||
void check_user_fault(struct rt_hw_exp_stack *regs, uint32_t pc_adj, char *info)
|
||||
{
|
||||
uint32_t mode = regs->cpsr;
|
||||
@@ -46,7 +45,7 @@ void check_user_fault(struct rt_hw_exp_stack *regs, uint32_t pc_adj, char *info)
|
||||
lwp_core_dump(regs, pc_adj);
|
||||
#endif
|
||||
backtrace((unsigned long)regs->pc, (unsigned long)regs->x30, (unsigned long)regs->x29);
|
||||
sys_exit(-1);
|
||||
sys_exit_group(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ extern long list_thread(void);
|
||||
#include <lwp_core_dump.h>
|
||||
#endif
|
||||
|
||||
void sys_exit(int value);
|
||||
void check_user_fault(struct rt_hw_exp_stack *regs, uint32_t pc_adj, char *info)
|
||||
{
|
||||
uint32_t mode = regs->cpsr;
|
||||
@@ -39,7 +38,7 @@ void check_user_fault(struct rt_hw_exp_stack *regs, uint32_t pc_adj, char *info)
|
||||
#ifdef LWP_USING_CORE_DUMP
|
||||
lwp_core_dump(regs, pc_adj);
|
||||
#endif
|
||||
sys_exit(-1);
|
||||
sys_exit_group(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void syscall_handler(struct rt_hw_stack_frame *regs)
|
||||
if (syscallfunc == RT_NULL)
|
||||
{
|
||||
LOG_E("unsupported syscall!\n");
|
||||
sys_exit(-1);
|
||||
sys_exit_group(-1);
|
||||
}
|
||||
|
||||
#if DBG_LVL >= DBG_INFO
|
||||
|
||||
@@ -225,7 +225,7 @@ void handle_user(rt_size_t scause, rt_size_t stval, rt_size_t sepc, struct rt_hw
|
||||
LOG_E("User Fault, killing thread: %s", rt_thread_self()->parent.name);
|
||||
|
||||
EXIT_TRAP;
|
||||
sys_exit(-1);
|
||||
sys_exit_group(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void syscall_handler(struct rt_hw_stack_frame *regs)
|
||||
if (syscallfunc == RT_NULL)
|
||||
{
|
||||
LOG_E("unsupported syscall!\n");
|
||||
sys_exit(-1);
|
||||
sys_exit_group(-1);
|
||||
}
|
||||
|
||||
#if DBG_LVL >= DBG_INFO
|
||||
|
||||
@@ -222,7 +222,7 @@ void handle_user(rt_size_t scause, rt_size_t stval, rt_size_t sepc, struct rt_hw
|
||||
LOG_E("User Fault, killing thread: %s", rt_thread_self()->parent.name);
|
||||
|
||||
EXIT_TRAP;
|
||||
sys_exit(-1);
|
||||
sys_exit_group(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user