diff --git a/headers/private/kernel/syscalls.h b/headers/private/kernel/syscalls.h index 2885d5e11a..604e1f054e 100644 --- a/headers/private/kernel/syscalls.h +++ b/headers/private/kernel/syscalls.h @@ -54,7 +54,7 @@ int sys_get_next_sem_info(team_id team, uint32 *cookie, struct sem_info *info, size_t size); int sys_set_sem_owner(sem_id id, team_id proc); -/* thread syscalls */ +/* team & thread syscalls */ extern void _kern_exit(int returnCode); extern team_id _kern_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority); @@ -62,11 +62,6 @@ extern status_t _kern_kill_team(team_id team); extern team_id _kern_get_current_team(); extern status_t _kern_wait_for_team(team_id team, status_t *_returnCode); -// XXX: We should decide to either keep the first parameter of the syscall like -// it is (this is what is actually passed) and adjust _user_spawn_thread() to -// do the same or change _kern_spawn_thread() and cast in spawn_thread(). -// The magically changing of parameter types between _kern_spawn_thread() -// and _user_spawn_thread() is definitely ugly. extern thread_id _kern_spawn_thread(int32 (*func)(thread_func, void *), const char *name, int32 priority, void *data1, void *data2); extern thread_id _kern_find_thread(const char *name); diff --git a/headers/private/kernel/thread.h b/headers/private/kernel/thread.h index 52fb8cb98f..ff48475613 100755 --- a/headers/private/kernel/thread.h +++ b/headers/private/kernel/thread.h @@ -58,7 +58,7 @@ status_t _user_rename_thread(thread_id thread, const char *name); status_t _user_suspend_thread(thread_id thread); status_t _user_resume_thread(thread_id thread); status_t _user_rename_thread(thread_id thread, const char *name); -thread_id _user_spawn_thread(thread_func func, const char *name, int32 priority, void *arg1, void *arg2); +thread_id _user_spawn_thread(thread_entry_func entry, const char *name, int32 priority, void *arg1, void *arg2); status_t _user_wait_for_thread(thread_id id, status_t *_returnCode); status_t _user_snooze_etc(bigtime_t timeout, int timebase, uint32 flags); status_t _user_kill_thread(thread_id thread); diff --git a/headers/private/kernel/thread_types.h b/headers/private/kernel/thread_types.h index 1608c79c48..12a1a79745 100644 --- a/headers/private/kernel/thread_types.h +++ b/headers/private/kernel/thread_types.h @@ -76,6 +76,8 @@ struct team { struct arch_team arch_info; }; +typedef int32 (*thread_entry_func)(thread_func, void *); + struct thread { struct thread *all_next; struct thread *team_next; @@ -114,7 +116,7 @@ struct thread { int32 page_faults_allowed; /* this field may only stay in debug builds in the future */ - thread_func entry; + thread_entry_func entry; void *args1, *args2; struct team *team; status_t return_code;