Commit 34ccf8f4 authored by Mark Charlebois's avatar Mark Charlebois Committed by Will Deacon

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: default avatarMark Charlebois <charlebm@gmail.com>
Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 2128df14
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment