]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
arm: LLVMLinux: Use global stack register variable for percpu
authorMark Charlebois <charlebm@gmail.com>
Thu, 4 Sep 2014 21:16:17 +0000 (14:16 -0700)
committerBehan Webster <behanw@converseincode.com>
Thu, 27 Nov 2014 19:09:49 +0000 (11:09 -0800)
Using global current_stack_pointer works on both clang and gcc.
current_stack_pointer is an unsigned long and needs to be cast
as a pointer to dereference.

KernelVersion: 3.17.0-rc6
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
arch/arm/include/asm/percpu.h

index 209e6504922e1c0b5a63733572055af723e37119..a89b4076cde4769db52d0ec3fbc83aed9346361e 100644 (file)
@@ -30,14 +30,14 @@ static inline void set_my_cpu_offset(unsigned long off)
 static inline unsigned long __my_cpu_offset(void)
 {
        unsigned long off;
-       register unsigned long *sp asm ("sp");
 
        /*
         * Read TPIDRPRW.
         * We want to allow caching the value, so avoid using volatile and
         * instead use a fake stack read to hazard against barrier().
         */
-       asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : "Q" (*sp));
+       asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off)
+               : "Q" (*(const unsigned long *)current_stack_pointer));
 
        return off;
 }