aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Charlebois <charlebm@gmail.com>2014-08-27 05:29:33 +0100
committerMark Brown <broonie@kernel.org>2015-01-22 21:48:45 +0000
commit0fab209aac128615dd2a8e88188073f89fba6dab (patch)
tree2becef5bb7a3513eb331f3df184ea8dc4351143f
parent29769603ea7b06e98f229b87bc0a67058cea394d (diff)
downloadlinux-linaro-stable-0fab209aac128615dd2a8e88188073f89fba6dab.tar.gz
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> (cherry picked from commit 34ccf8f455f1ae7761810a74308f82daca67ced1) Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--arch/arm64/include/asm/percpu.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h
index 453a179469a3..5279e5733386 100644
--- a/arch/arm64/include/asm/percpu.h
+++ b/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)
{
unsigned long off;
- register unsigned long *sp asm ("sp");
/*
* We want to allow caching the value, so avoid using volatile and
* 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;
}