Skip to contentSkip to conversation

Generic Mutex Subsystem, add-atomic-xchg-x86_64.patch

PATCH In review Ingo Molnar 1 participant 1 message Dec 19, 2005 Atomic infrastructure

lore
Share & tools
lore
#0 lore raw

PATCH 2/15 Generic Mutex Subsystem, add-atomic-xchg-x86_64.patch

add atomic_cmpxchg() to x86_64. Needed by the new mutex code.

----

 include/asm-x86_64/atomic.h |    1 +
 1 files changed, 1 insertion(+)
include/asm-x86_64/atomic.h +1 -0
Index: linux/include/asm-x86_64/atomic.h
===================================================================
@@ -389,6 +389,7 @@ static __inline__ long atomic64_sub_retu
 #define atomic64_dec_return(v)  (atomic64_sub_return(1,v))
 
 #define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
 /**
  * atomic_add_unless - add unless the number is a given value