blob: 5af9bdb97a16265cbac640675fd12613287a4031 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _I386_CURRENT_H
2#define _I386_CURRENT_H
3
Jeremy Fitzhardingeec7fcaa2006-12-07 02:14:03 +01004#include <linux/compiler.h>
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +02005#include <asm/percpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7struct task_struct;
8
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +02009DECLARE_PER_CPU(struct task_struct *, current_task);
Jeremy Fitzhardingeec7fcaa2006-12-07 02:14:03 +010010static __always_inline struct task_struct *get_current(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070011{
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +020012 return x86_read_percpu(current_task);
Linus Torvalds1da177e2005-04-16 15:20:36 -070013}
Joe Perches83ecfdd2008-03-23 01:01:55 -070014
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#define current get_current()
16
17#endif /* !(_I386_CURRENT_H) */