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 void x86_push_iframe(struct iframe_stack *stack, struct iframe *frame); 20 void x86_pop_iframe(struct iframe_stack *stack); 21 struct iframe *i386_get_user_iframe(void); 22 void *x86_next_page_directory(struct thread *from, struct thread *to); 23 24 void i386_return_from_signal(); 25 void i386_end_return_from_signal(); 26 27 28 static 29 inline struct thread * 30 arch_thread_get_current_thread(void) 31 { 32 struct thread *t; 33 read_dr3(t); 34 return t; 35 } 36 37 static inline void 38 arch_thread_set_current_thread(struct thread *t) 39 { 40 write_dr3(t); 41 } 42 43 #ifdef __cplusplus 44 } 45 #endif 46 47 #endif /* _KERNEL_ARCH_x86_THREAD_H */ 48 49