aboutsummaryrefslogtreecommitdiff
path: root/tests/common/test.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-08-26 18:51:10 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-08-26 18:51:10 +0300
commitb25156373cd89792b1c457b77699bb7f9beb430d (patch)
tree56816903fcedc9fe35786b9baf43499d4ec3d19f /tests/common/test.h
parent260fc4c790ca25ee1ffab4edd9c6488d3bcb441c (diff)
downloadkmi-b25156373cd89792b1c457b77699bb7f9beb430d.tar.gz
kmi-b25156373cd89792b1c457b77699bb7f9beb430d.zip
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.
Diffstat (limited to 'tests/common/test.h')
-rw-r--r--tests/common/test.h10
1 files changed, 2 insertions, 8 deletions
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;
}