diff options
Diffstat (limited to 'include/asm-x86_64/current.h')
-rw-r--r-- | include/asm-x86_64/current.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/asm-x86_64/current.h b/include/asm-x86_64/current.h new file mode 100644 index 000000000000..7db560ee6f70 --- /dev/null +++ b/include/asm-x86_64/current.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef _X86_64_CURRENT_H | ||
2 | #define _X86_64_CURRENT_H | ||
3 | |||
4 | #if !defined(__ASSEMBLY__) | ||
5 | struct task_struct; | ||
6 | |||
7 | #include <asm/pda.h> | ||
8 | |||
9 | static inline struct task_struct *get_current(void) | ||
10 | { | ||
11 | struct task_struct *t = read_pda(pcurrent); | ||
12 | return t; | ||
13 | } | ||
14 | |||
15 | #define current get_current() | ||
16 | |||
17 | #else | ||
18 | |||
19 | #ifndef ASM_OFFSET_H | ||
20 | #include <asm/offset.h> | ||
21 | #endif | ||
22 | |||
23 | #define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg | ||
24 | |||
25 | #endif | ||
26 | |||
27 | #endif /* !(_X86_64_CURRENT_H) */ | ||