[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:
Shell
2023-09-09 09:35:56 +08:00
committed by GitHub
parent b8e332fa2d
commit 47b183a297
12 changed files with 58 additions and 22 deletions
+1 -2
View File
@@ -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);
}
}
+1 -2
View File
@@ -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);
}
}
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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