xref: /openbmc/linux/arch/x86/include/asm/current.h (revision 0bf49ffb)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_CURRENT_H
3 #define _ASM_X86_CURRENT_H
4 
5 #include <linux/compiler.h>
6 #include <asm/percpu.h>
7 
8 #ifndef __ASSEMBLY__
9 struct task_struct;
10 
11 DECLARE_PER_CPU(struct task_struct *, current_task);
12 
13 static __always_inline struct task_struct *get_current(void)
14 {
15 	return this_cpu_read_stable(current_task);
16 }
17 
18 #define current get_current()
19 
20 #endif /* __ASSEMBLY__ */
21 
22 #endif /* _ASM_X86_CURRENT_H */
23