From 3b27725385614d44add9351191765181edc3f4c1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 31 Jan 2016 16:33:44 +0100 Subject: better a_sc inline asm constraint on aarch64 and arm "Q" input constraint was used for the written object, instead of "=Q" output constraint. this should not cause problems because "memory" is on the clobber list, but "=Q" better documents the intent and more consistent with the actual asm code. this changes the generated code, because different registers are used, but other than the register names nothing should change. --- arch/arm/atomic_arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/atomic_arch.h') diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h index 21db6b22..706fa1f2 100644 --- a/arch/arm/atomic_arch.h +++ b/arch/arm/atomic_arch.h @@ -16,7 +16,7 @@ static inline int a_ll(volatile int *p) static inline int a_sc(volatile int *p, int v) { int r; - __asm__ __volatile__ ("strex %0,%1,%2" : "=&r"(r) : "r"(v), "Q"(*p) : "memory"); + __asm__ __volatile__ ("strex %0,%2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "memory"); return !r; } -- cgit v1.2.1