Commit a2d236b3 authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

[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: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1a426cb7
...@@ -253,19 +253,19 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, ...@@ -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;
} }
......
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