[PATCH] x86-64: Lose constraints on cmpxchg
While only cosmetic for x86-64, this adjusts the cmpxchg code appearantly inherited from i386 to use more generic constraints. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
1a426cb764
commit
a2d236b3ac
|
@ -253,19 +253,19 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
|
||||||
case 2:
|
case 2:
|
||||||
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
|
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
|
||||||
: "=a"(prev)
|
: "=a"(prev)
|
||||||
: "q"(new), "m"(*__xg(ptr)), "0"(old)
|
: "r"(new), "m"(*__xg(ptr)), "0"(old)
|
||||||
: "memory");
|
: "memory");
|
||||||
return prev;
|
return prev;
|
||||||
case 4:
|
case 4:
|
||||||
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
|
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
|
||||||
: "=a"(prev)
|
: "=a"(prev)
|
||||||
: "q"(new), "m"(*__xg(ptr)), "0"(old)
|
: "r"(new), "m"(*__xg(ptr)), "0"(old)
|
||||||
: "memory");
|
: "memory");
|
||||||
return prev;
|
return prev;
|
||||||
case 8:
|
case 8:
|
||||||
__asm__ __volatile__(LOCK_PREFIX "cmpxchgq %1,%2"
|
__asm__ __volatile__(LOCK_PREFIX "cmpxchgq %1,%2"
|
||||||
: "=a"(prev)
|
: "=a"(prev)
|
||||||
: "q"(new), "m"(*__xg(ptr)), "0"(old)
|
: "r"(new), "m"(*__xg(ptr)), "0"(old)
|
||||||
: "memory");
|
: "memory");
|
||||||
return prev;
|
return prev;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue