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