blob: 4d447b732d82df76b4c55d77fde42cd4024c2971 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_CURRENT_H
2#define _ASM_X86_CURRENT_H
Christoph Lameterf0766442008-05-09 19:09:48 -07003
Christoph Lameterf0766442008-05-09 19:09:48 -07004#include <linux/compiler.h>
5#include <asm/percpu.h>
6
Brian Gerstc6f5e0a2009-01-19 00:38:58 +09007#ifndef __ASSEMBLY__
Christoph Lameterf0766442008-05-09 19:09:48 -07008struct task_struct;
9
10DECLARE_PER_CPU(struct task_struct *, current_task);
Brian Gerstc6f5e0a2009-01-19 00:38:58 +090011
Christoph Lameterf0766442008-05-09 19:09:48 -070012static __always_inline struct task_struct *get_current(void)
13{
Linus Torvaldsed8d9ad2009-08-03 14:08:48 +090014 return percpu_read_stable(current_task);
Christoph Lameterf0766442008-05-09 19:09:48 -070015}
16
Brian Gerstc6f5e0a2009-01-19 00:38:58 +090017#define current get_current()
Christoph Lameterf0766442008-05-09 19:09:48 -070018
19#endif /* __ASSEMBLY__ */
20
H. Peter Anvin1965aae2008-10-22 22:26:29 -070021#endif /* _ASM_X86_CURRENT_H */