blob: d3524853991203c36b2bbcc75671facabe59263e [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}
14
15#define current get_current()
16
17#endif /* !(_I386_CURRENT_H) */