]>
Commit | Line | Data |
---|---|---|
c02433dd MR |
1 | #ifndef __ASM_CURRENT_H |
2 | #define __ASM_CURRENT_H | |
3 | ||
4 | #include <linux/compiler.h> | |
5 | ||
c02433dd MR |
6 | #ifndef __ASSEMBLY__ |
7 | ||
8 | struct task_struct; | |
9 | ||
9d84fb27 MR |
10 | /* |
11 | * We don't use read_sysreg() as we want the compiler to cache the value where | |
12 | * possible. | |
13 | */ | |
c02433dd MR |
14 | static __always_inline struct task_struct *get_current(void) |
15 | { | |
9d84fb27 MR |
16 | unsigned long sp_el0; |
17 | ||
18 | asm ("mrs %0, sp_el0" : "=r" (sp_el0)); | |
19 | ||
20 | return (struct task_struct *)sp_el0; | |
c02433dd MR |
21 | } |
22 | ||
23 | #define current get_current() | |
24 | ||
25 | #endif /* __ASSEMBLY__ */ | |
26 | ||
27 | #endif /* __ASM_CURRENT_H */ | |
28 |