ARM: make get_current() and __my_cpu_offset() __always_inline
The get_current() and __my_cpu_offset() accessors evaluate to only a single instruction emitted inline, but due to the size of the asm string that is created for SMP+v6 configurations, the compiler assumes otherwise, and may emit the functions out of line instead. So use __always_inline to avoid this. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
This commit is contained in:
parent
57a420435e
commit
4d5a643e73
@ -14,7 +14,7 @@ struct task_struct;
|
|||||||
|
|
||||||
extern struct task_struct *__current;
|
extern struct task_struct *__current;
|
||||||
|
|
||||||
static inline __attribute_const__ struct task_struct *get_current(void)
|
static __always_inline __attribute_const__ struct task_struct *get_current(void)
|
||||||
{
|
{
|
||||||
struct task_struct *cur;
|
struct task_struct *cur;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ static inline void set_my_cpu_offset(unsigned long off)
|
|||||||
asm volatile("mcr p15, 0, %0, c13, c0, 4" : : "r" (off) : "memory");
|
asm volatile("mcr p15, 0, %0, c13, c0, 4" : : "r" (off) : "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long __my_cpu_offset(void)
|
static __always_inline unsigned long __my_cpu_offset(void)
|
||||||
{
|
{
|
||||||
unsigned long off;
|
unsigned long off;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user