From f3f347f90d942f07974b071c8389554b5ac46bbb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 15 Jan 2025 14:52:15 -0500 Subject: [PATCH] kernel & libroot: Drop wait_for_thread syscall in favor of wait_for_thread_etc. We don't have many etc and non-etc syscall pairs in this file (the semaphores seem to be a notable exception), so drop wait_for_thread and just call wait_for_thread_etc instead. This breaks syscall ABI, but we've already broken it since beta5 anyway. --- headers/private/system/syscalls.h | 2 -- src/system/kernel/thread.cpp | 20 -------------------- src/system/libroot/os/thread.c | 2 +- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/headers/private/system/syscalls.h b/headers/private/system/syscalls.h index 6501316cc8..b80ee04774 100644 --- a/headers/private/system/syscalls.h +++ b/headers/private/system/syscalls.h @@ -173,8 +173,6 @@ extern void _kern_exit_thread(status_t returnValue); extern status_t _kern_cancel_thread(thread_id threadID, void (*cancelFunction)(int)); extern void _kern_thread_yield(void); -extern status_t _kern_wait_for_thread(thread_id thread, - status_t *_returnCode); extern status_t _kern_wait_for_thread_etc(thread_id thread, uint32 flags, bigtime_t timeout, status_t *_returnCode); extern bool _kern_has_data(thread_id thread); diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index 53dcd03502..7064b950d8 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -3717,26 +3717,6 @@ _user_find_thread(const char *userName) } -status_t -_user_wait_for_thread(thread_id id, status_t *userReturnCode) -{ - status_t returnCode; - status_t status; - - if (userReturnCode != NULL && !IS_USER_ADDRESS(userReturnCode)) - return B_BAD_ADDRESS; - - status = wait_for_thread_etc(id, B_CAN_INTERRUPT, 0, &returnCode); - - if (status == B_OK && userReturnCode != NULL - && user_memcpy(userReturnCode, &returnCode, sizeof(status_t)) < B_OK) { - return B_BAD_ADDRESS; - } - - return syscall_restart_handle_post(status); -} - - status_t _user_wait_for_thread_etc(thread_id id, uint32 flags, bigtime_t timeout, status_t *userReturnCode) { diff --git a/src/system/libroot/os/thread.c b/src/system/libroot/os/thread.c index 9c1cfa0ee8..66dfc6d284 100644 --- a/src/system/libroot/os/thread.c +++ b/src/system/libroot/os/thread.c @@ -179,7 +179,7 @@ exit_thread(status_t status) status_t wait_for_thread(thread_id thread, status_t *_returnCode) { - return _kern_wait_for_thread(thread, _returnCode); + return _kern_wait_for_thread_etc(thread, 0, 0, _returnCode); }