| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _I386_CURRENT_H | 
|  | 2 | #define _I386_CURRENT_H | 
|  | 3 |  | 
| Jeremy Fitzhardinge | ec7fcaa | 2006-12-07 02:14:03 +0100 | [diff] [blame] | 4 | #include <linux/compiler.h> | 
| Jeremy Fitzhardinge | 7c3576d | 2007-05-02 19:27:16 +0200 | [diff] [blame] | 5 | #include <asm/percpu.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 |  | 
|  | 7 | struct task_struct; | 
|  | 8 |  | 
| Jeremy Fitzhardinge | 7c3576d | 2007-05-02 19:27:16 +0200 | [diff] [blame] | 9 | DECLARE_PER_CPU(struct task_struct *, current_task); | 
| Jeremy Fitzhardinge | ec7fcaa | 2006-12-07 02:14:03 +0100 | [diff] [blame] | 10 | static __always_inline struct task_struct *get_current(void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | { | 
| Jeremy Fitzhardinge | 7c3576d | 2007-05-02 19:27:16 +0200 | [diff] [blame] | 12 | return x86_read_percpu(current_task); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | } | 
| Joe Perches | 83ecfdd | 2008-03-23 01:01:55 -0700 | [diff] [blame] | 14 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #define current get_current() | 
|  | 16 |  | 
|  | 17 | #endif /* !(_I386_CURRENT_H) */ |