From a02a5888af17e257161fa59ac3b8ca663b5a2673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 18 Apr 2003 09:21:22 +0000 Subject: [PATCH] Added another argument parameter for the thread creation code. Helps implementing a more efficient on_exit_thread(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3073 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/thread.h | 2 +- headers/private/kernel/arch/x86/arch_cpu.h | 2 +- headers/private/kernel/syscalls.h | 2 +- headers/private/kernel/thread.h | 2 +- headers/private/kernel/thread_types.h | 2 +- headers/private/kernel/tls.h | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/headers/private/kernel/arch/thread.h b/headers/private/kernel/arch/thread.h index f03f3fbb46..d3329735eb 100644 --- a/headers/private/kernel/arch/thread.h +++ b/headers/private/kernel/arch/thread.h @@ -13,7 +13,7 @@ void arch_thread_init_tls(struct thread *thread); void arch_thread_context_switch(struct thread *t_from, struct thread *t_to); int arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void), void (*entry_func)(void), void (*exit_func)(void)); void arch_thread_dump_info(void *info); -void arch_thread_enter_uspace(struct thread *t, addr entry, void *args); +void arch_thread_enter_uspace(struct thread *t, addr entry, void *args1, void *args2); void arch_thread_switch_kstack_and_call(struct thread *t, addr new_kstack, void (*func)(void *), void *arg); //struct thread *arch_thread_get_current_thread(void); diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index 9bfbafaa6d..87d355b4ca 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -90,7 +90,7 @@ struct iframe { void setup_system_time(unsigned int cv_factor); void i386_context_switch(struct arch_thread *old_state, struct arch_thread *new_state, addr new_pgdir); -void i386_enter_uspace(addr entry, void *args, addr ustack_top); +void i386_enter_uspace(addr entry, void *args1, void *args2, addr ustack_top); void i386_set_tss_and_kstack(addr kstack); void i386_switch_stack_and_call(addr stack, void (*func)(void *), void *arg); void i386_swap_pgdir(addr new_pgdir); diff --git a/headers/private/kernel/syscalls.h b/headers/private/kernel/syscalls.h index 8c5a544a37..c1cf495be4 100644 --- a/headers/private/kernel/syscalls.h +++ b/headers/private/kernel/syscalls.h @@ -42,7 +42,7 @@ int sys_set_sem_owner(sem_id id, team_id proc); void sys_exit(int retcode); team_id sys_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority); -thread_id sys_spawn_thread(int32 (*func)(void*), const char *, int32, void *); +thread_id sys_spawn_thread(int32 (*func)(thread_func, void *), const char *, int32, void *, void *); thread_id sys_get_current_thread_id(void); int sys_suspend_thread(thread_id tid); int sys_resume_thread(thread_id tid); diff --git a/headers/private/kernel/thread.h b/headers/private/kernel/thread.h index 46fbcedb84..dea76e5edf 100755 --- a/headers/private/kernel/thread.h +++ b/headers/private/kernel/thread.h @@ -71,7 +71,7 @@ int user_team_wait_for_team(team_id id, int *uretcode); status_t user_set_thread_priority(thread_id thread, int32 newPriority); status_t user_suspend_thread(thread_id thread); status_t user_resume_thread(thread_id thread); -thread_id user_spawn_thread(thread_func func, const char *name, int32 priority, void *arg); +thread_id user_spawn_thread(thread_func func, const char *name, int32 priority, void *arg1, void *arg2); status_t user_wait_for_thread(thread_id id, status_t *returnCode); status_t user_wait_for_team(team_id id, status_t *returnCode); status_t user_snooze_etc(bigtime_t timeout, int timebase, uint32 flags); diff --git a/headers/private/kernel/thread_types.h b/headers/private/kernel/thread_types.h index 15de2ea278..8dec82db91 100644 --- a/headers/private/kernel/thread_types.h +++ b/headers/private/kernel/thread_types.h @@ -113,7 +113,7 @@ struct thread { /* this field may only stay in debug builds in the future*/ thread_func entry; - void *args; + void *args1, *args2; struct team *team; status_t return_code; sem_id return_code_sem; diff --git a/headers/private/kernel/tls.h b/headers/private/kernel/tls.h index 0f51ebc393..1a33abd168 100644 --- a/headers/private/kernel/tls.h +++ b/headers/private/kernel/tls.h @@ -16,6 +16,7 @@ enum { TLS_THREAD_ID_SLOT, TLS_ERRNO_SLOT, + TLS_ON_EXIT_THREAD_SLOT, // Note: these entries can safely be changed between // releases; 3rd party code always calls tls_allocate()