Linux 4.18.10
[linux/fpc-iii.git] / arch / arm64 / include / asm / current.h
blob54ceae0874c7e247a63d44350a884cd47a80001c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_CURRENT_H
3 #define __ASM_CURRENT_H
5 #include <linux/compiler.h>
7 #ifndef __ASSEMBLY__
9 struct task_struct;
12 * We don't use read_sysreg() as we want the compiler to cache the value where
13 * possible.
15 static __always_inline struct task_struct *get_current(void)
17 unsigned long sp_el0;
19 asm ("mrs %0, sp_el0" : "=r" (sp_el0));
21 return (struct task_struct *)sp_el0;
24 #define current get_current()
26 #endif /* __ASSEMBLY__ */
28 #endif /* __ASM_CURRENT_H */