xref: /haiku/headers/private/kernel/arch/x86/arch_thread.h (revision 11fe0cb8de932243324b119e4567e7d5d69c4540)
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 
19 static
20 inline struct thread *
21 arch_thread_get_current_thread(void)
22 {
23 	struct thread *t;
24 	read_dr3(t);
25 	return t;
26 }
27 
28 static inline void
29 arch_thread_set_current_thread(struct thread *t)
30 {
31 	write_dr3(t);
32 }
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #endif /* _KERNEL_ARCH_x86_THREAD_H */
39 
40