2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2004-03-16 05:24:42 +03:00
|
|
|
** Copyright 2002-2004, The OpenBeOS Team. All rights reserved.
|
|
|
|
** Distributed under the terms of the OpenBeOS License.
|
|
|
|
**
|
2002-07-09 16:24:59 +04:00
|
|
|
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
** Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2003-05-03 18:12:16 +04:00
|
|
|
#ifndef KERNEL_ARCH_THREAD_H
|
|
|
|
#define KERNEL_ARCH_THREAD_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#include <thread.h>
|
|
|
|
|
2004-03-16 05:24:42 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-08-03 04:41:27 +04:00
|
|
|
int arch_team_init_team_struct(struct team *t, bool kernel);
|
2002-07-09 16:24:59 +04:00
|
|
|
int arch_thread_init_thread_struct(struct thread *t);
|
2003-01-07 12:17:31 +03:00
|
|
|
void arch_thread_init_tls(struct thread *thread);
|
2002-07-09 16:24:59 +04:00
|
|
|
void arch_thread_context_switch(struct thread *t_from, struct thread *t_to);
|
2003-01-07 12:17:31 +03:00
|
|
|
int arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void), void (*entry_func)(void), void (*exit_func)(void));
|
2002-07-09 16:24:59 +04:00
|
|
|
void arch_thread_dump_info(void *info);
|
2003-04-18 13:21:22 +04:00
|
|
|
void arch_thread_enter_uspace(struct thread *t, addr entry, void *args1, void *args2);
|
2002-07-09 16:24:59 +04:00
|
|
|
void arch_thread_switch_kstack_and_call(struct thread *t, addr new_kstack, void (*func)(void *), void *arg);
|
|
|
|
|
2003-05-03 18:12:16 +04:00
|
|
|
// ToDo: doing this this way is an ugly hack - please fix me!
|
|
|
|
// (those functions are "static inline" for x86 - since
|
|
|
|
// "extern inline" doesn't work for "gcc -g"...)
|
|
|
|
#ifndef ARCH_x86
|
|
|
|
struct thread *arch_thread_get_current_thread(void);
|
|
|
|
void arch_thread_set_current_thread(struct thread *t);
|
|
|
|
#endif
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2004-03-14 20:58:11 +03:00
|
|
|
status_t arch_setup_signal_frame(struct thread *t, struct sigaction *sa, int sig, int sig_mask);
|
2002-10-23 21:31:10 +04:00
|
|
|
int64 arch_restore_signal_frame(void);
|
|
|
|
void arch_check_syscall_restart(struct thread *t);
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
// for any inline overrides
|
|
|
|
#include <arch_thread.h>
|
|
|
|
|
2004-03-16 05:24:42 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-05-03 18:12:16 +04:00
|
|
|
#endif /* KERNEL_ARCH_THREAD_H */
|