From b25156373cd89792b1c457b77699bb7f9beb430d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 26 Aug 2024 18:51:10 +0300 Subject: improve killing processes/threads, test + Remove sys_kill() as we should be using a two-stage process where a thread is first orphaned by sys_detach(), and then the thread itself calls sys_exit() after it has done all necessary cleanup in init. --- tests/common/test.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/common/test.h') diff --git a/tests/common/test.h b/tests/common/test.h index 18ac388..0b53b52 100644 --- a/tests/common/test.h +++ b/tests/common/test.h @@ -249,12 +249,6 @@ static inline id_t sys_spawn(uintptr_t bin, uintptr_t interp) return r.s; } -static inline enum sys_status sys_kill(id_t pid) -{ - struct sys_ret r = syscall1(SYS_KILL, pid); - return r.s; -} - static inline enum sys_status sys_swap(id_t tid) { struct sys_ret r = syscall1(SYS_SWAP, tid); @@ -323,9 +317,9 @@ static inline enum sys_status sys_detach(id_t tid) return r.s; } -static inline enum sys_status sys_exit() +static inline enum sys_status sys_exit(id_t tid) { - struct sys_ret r = syscall0(SYS_EXIT); + struct sys_ret r = syscall1(SYS_EXIT, tid); return r.s; } -- cgit v1.3