H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_CURRENT_H |
| 2 | #define _ASM_X86_CURRENT_H |
Christoph Lameter | f076644 | 2008-05-09 19:09:48 -0700 | [diff] [blame] | 3 | |
Christoph Lameter | f076644 | 2008-05-09 19:09:48 -0700 | [diff] [blame] | 4 | #include <linux/compiler.h> |
| 5 | #include <asm/percpu.h> |
| 6 | |
Brian Gerst | c6f5e0a | 2009-01-19 00:38:58 +0900 | [diff] [blame] | 7 | #ifndef __ASSEMBLY__ |
Christoph Lameter | f076644 | 2008-05-09 19:09:48 -0700 | [diff] [blame] | 8 | struct task_struct; |
| 9 | |
| 10 | DECLARE_PER_CPU(struct task_struct *, current_task); |
Brian Gerst | c6f5e0a | 2009-01-19 00:38:58 +0900 | [diff] [blame] | 11 | |
Christoph Lameter | f076644 | 2008-05-09 19:09:48 -0700 | [diff] [blame] | 12 | static __always_inline struct task_struct *get_current(void) |
| 13 | { |
Linus Torvalds | ed8d9ad | 2009-08-03 14:08:48 +0900 | [diff] [blame] | 14 | return percpu_read_stable(current_task); |
Christoph Lameter | f076644 | 2008-05-09 19:09:48 -0700 | [diff] [blame] | 15 | } |
| 16 | |
Brian Gerst | c6f5e0a | 2009-01-19 00:38:58 +0900 | [diff] [blame] | 17 | #define current get_current() |
Christoph Lameter | f076644 | 2008-05-09 19:09:48 -0700 | [diff] [blame] | 18 | |
| 19 | #endif /* __ASSEMBLY__ */ |
| 20 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 21 | #endif /* _ASM_X86_CURRENT_H */ |