瀏覽代碼

arm64: LLVMLinux: Use global stack register variable for aarch64

To support both Clang and GCC, use the global stack register variable vs
a local register variable.

Author: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Mark Charlebois 11 年之前
父節點
當前提交
34ccf8f455
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      arch/arm64/include/asm/percpu.h

+ 2 - 2
arch/arm64/include/asm/percpu.h

@@ -26,13 +26,13 @@ static inline void set_my_cpu_offset(unsigned long off)
 static inline unsigned long __my_cpu_offset(void)
 static inline unsigned long __my_cpu_offset(void)
 {
 {
 	unsigned long off;
 	unsigned long off;
-	register unsigned long *sp asm ("sp");
 
 
 	/*
 	/*
 	 * We want to allow caching the value, so avoid using volatile and
 	 * We want to allow caching the value, so avoid using volatile and
 	 * instead use a fake stack read to hazard against barrier().
 	 * instead use a fake stack read to hazard against barrier().
 	 */
 	 */
-	asm("mrs %0, tpidr_el1" : "=r" (off) : "Q" (*sp));
+	asm("mrs %0, tpidr_el1" : "=r" (off) :
+		"Q" (*(const unsigned long *)current_stack_pointer));
 
 
 	return off;
 	return off;
 }
 }