1 #ifndef _LL_ARCH_ATOMIC_H
2 #define _LL_ARCH_ATOMIC_H
4 #include <lowlevel/arch-x86-common/atomic.h>
6 static inline int ll_cmpxchg_long(unsigned long *val, unsigned long oldval,
12 asm("lock; cmpxchgq %0, %1; setz %b1" :
13 "+m" (*val) : "r" (newval), "a" (oldval) : "memory");
15 asm("cmpxchgq %0, %1; setz %b1" :
16 "+m" (*val) : "r" (newval), "a" (oldval) : "memory");
21 static inline unsigned long ll_xchg_long(unsigned long *ptr,
24 asm("xchgq %0, %1" : "+r" (val), "+m" (*ptr));