diff options
Diffstat (limited to 'arch/arm/include/asm/percpu.h')
-rw-r--r-- | arch/arm/include/asm/percpu.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/include/asm/percpu.h b/arch/arm/include/asm/percpu.h index 968c0a14e0a3..209e6504922e 100644 --- a/arch/arm/include/asm/percpu.h +++ b/arch/arm/include/asm/percpu.h | |||
@@ -30,8 +30,15 @@ static inline void set_my_cpu_offset(unsigned long off) | |||
30 | static inline unsigned long __my_cpu_offset(void) | 30 | static inline unsigned long __my_cpu_offset(void) |
31 | { | 31 | { |
32 | unsigned long off; | 32 | unsigned long off; |
33 | /* Read TPIDRPRW */ | 33 | register unsigned long *sp asm ("sp"); |
34 | asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : : "memory"); | 34 | |
35 | /* | ||
36 | * Read TPIDRPRW. | ||
37 | * We want to allow caching the value, so avoid using volatile and | ||
38 | * instead use a fake stack read to hazard against barrier(). | ||
39 | */ | ||
40 | asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : "Q" (*sp)); | ||
41 | |||
35 | return off; | 42 | return off; |
36 | } | 43 | } |
37 | #define __my_cpu_offset __my_cpu_offset() | 44 | #define __my_cpu_offset __my_cpu_offset() |