diff options
author | Will Deacon <will.deacon@arm.com> | 2016-10-17 08:38:14 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-10-17 14:38:30 -0400 |
commit | 91cb163e4d141c74e99639fbee7c2a6332c92901 (patch) | |
tree | b4f85befdc215470c060563371eba88fae33463e | |
parent | 8fe88a4145cdeee486af60e61f5d5a14f804fa45 (diff) |
arm64: sysreg: Fix use of XZR in write_sysreg_s
Commit 8a71f0c656e0 ("arm64: sysreg: replace open-coded mrs_s/msr_s with
{read,write}_sysreg_s") introduced a write_sysreg_s macro for writing
to system registers that are not supported by binutils.
Unfortunately, this was implemented with the wrong template (%0 vs %x0),
so in the case that we are writing a constant 0, we will generate
invalid instruction syntax and bail with a cryptic assembler error:
| Error: constant expression required
This patch fixes the template.
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/include/asm/sysreg.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index e8d46e8e6079..6c80b3699cb8 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h | |||
@@ -286,7 +286,7 @@ asm( | |||
286 | 286 | ||
287 | #define write_sysreg_s(v, r) do { \ | 287 | #define write_sysreg_s(v, r) do { \ |
288 | u64 __val = (u64)v; \ | 288 | u64 __val = (u64)v; \ |
289 | asm volatile("msr_s " __stringify(r) ", %0" : : "rZ" (__val)); \ | 289 | asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val)); \ |
290 | } while (0) | 290 | } while (0) |
291 | 291 | ||
292 | static inline void config_sctlr_el1(u32 clear, u32 set) | 292 | static inline void config_sctlr_el1(u32 clear, u32 set) |