1 /* 2 * Copyright 2002-2005, The Haiku Team. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Copyright 2002, Travis Geiselbrecht. All rights reserved. 6 * Distributed under the terms of the NewOS License. 7 */ 8 #ifndef _KERNEL_ARCH_x86_THREAD_H 9 #define _KERNEL_ARCH_x86_THREAD_H 10 11 12 #include <arch/cpu.h> 13 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 struct iframe *i386_get_user_iframe(void); 20 void *x86_next_page_directory(struct thread *from, struct thread *to); 21 22 void i386_return_from_signal(); 23 void i386_end_return_from_signal(); 24 25 // override empty macro 26 #undef arch_syscall_64_bit_return_value 27 void arch_syscall_64_bit_return_value(); 28 29 30 static 31 inline struct thread * 32 arch_thread_get_current_thread(void) 33 { 34 struct thread *t; 35 read_dr3(t); 36 return t; 37 } 38 39 static inline void 40 arch_thread_set_current_thread(struct thread *t) 41 { 42 write_dr3(t); 43 } 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif /* _KERNEL_ARCH_x86_THREAD_H */ 50 51