blob: c68c361697e144649f9d0b40e69921d40ca2cbb8 [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{
Ingo Molnar6dbde352009-01-15 22:15:53 +090014 return percpu_read(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 */