blob: 9476c04ee6357e79ba0a9c59c8b4001d32c653eb [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{
Alex Shic6ae41e2012-05-11 15:35:27 +080014 return this_cpu_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 */