1 /* 2 ** Copyright 2002, Travis Geiselbrecht. All rights reserved. 3 ** Distributed under the terms of the NewOS License. 4 */ 5 #ifndef _KERNEL_ARCH_x86_THREAD_H 6 #define _KERNEL_ARCH_x86_THREAD_H 7 8 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 #include <arch/cpu.h> 13 14 15 void i386_push_iframe(struct thread *t, struct iframe *frame); 16 void i386_pop_iframe(struct thread *t); 17 18 void i386_return_from_signal(); 19 void i386_end_return_from_signal(); 20 21 22 static 23 inline struct thread * 24 arch_thread_get_current_thread(void) 25 { 26 struct thread *t; 27 read_dr3(t); 28 return t; 29 } 30 31 static inline void 32 arch_thread_set_current_thread(struct thread *t) 33 { 34 write_dr3(t); 35 } 36 37 #ifdef __cplusplus 38 } 39 #endif 40 41 #endif /* _KERNEL_ARCH_x86_THREAD_H */ 42 43