1/* 2 * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 * 5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. 6 * Distributed under the terms of the NewOS License. 7 */ 8#ifndef KERNEL_ARCH_THREAD_H 9#define KERNEL_ARCH_THREAD_H 10 11 12#include <thread_types.h> 13 14 15#ifdef __cplusplus 16extern "C" { 17#endif 18 19status_t arch_thread_init(struct kernel_args *args); 20status_t arch_team_init_team_struct(Team *t, bool kernel); 21status_t arch_thread_init_thread_struct(Thread *t); 22status_t arch_thread_init_tls(Thread *thread); 23void arch_thread_context_switch(Thread *t_from, Thread *t_to); 24void arch_thread_init_kthread_stack(Thread *thread, void *stack, 25 void *stackTop, void (*function)(void*), const void *data); 26void arch_thread_dump_info(void *info); 27status_t arch_thread_enter_userspace(Thread *t, addr_t entry, 28 void *args1, void *args2); 29 30bool arch_on_signal_stack(Thread *thread); 31status_t arch_setup_signal_frame(Thread *thread, struct sigaction *action, 32 struct signal_frame_data *signalFrameData); 33int64 arch_restore_signal_frame(struct signal_frame_data* signalFrameData); 34 35void arch_store_fork_frame(struct arch_fork_arg *arg); 36void arch_restore_fork_frame(struct arch_fork_arg *arg); 37 38#define arch_syscall_64_bit_return_value() 39 // overridden by architectures that need special handling 40 41#ifdef __cplusplus 42} 43#endif 44 45// for any inline overrides 46#include <arch_thread.h> 47 48#endif /* KERNEL_ARCH_THREAD_H */ 49