{
AO_t result;
- __asm__ __volatile__ ("lock; xadd %0, %1" :
- "=r" (result), "+m" (*p) : "0" (incr)
+ __asm__ __volatile__ ("lock; xadd %0, %1"
+ : "=r" (result), "+m" (*p)
+ : "0" (incr)
: "memory");
return result;
}
{
unsigned char result;
- __asm__ __volatile__ ("lock; xaddb %0, %1" :
- "=q" (result), "+m" (*p) : "0" (incr)
+ __asm__ __volatile__ ("lock; xaddb %0, %1"
+ : "=q" (result), "+m" (*p)
+ : "0" (incr)
: "memory");
return result;
}
{
unsigned short result;
- __asm__ __volatile__ ("lock; xaddw %0, %1" :
- "=r" (result), "+m" (*p) : "0" (incr)
+ __asm__ __volatile__ ("lock; xaddw %0, %1"
+ : "=r" (result), "+m" (*p)
+ : "0" (incr)
: "memory");
return result;
}
AO_INLINE void
AO_and_full (volatile AO_t *p, AO_t value)
{
- __asm__ __volatile__ ("lock; and %1, %0" :
- "+m" (*p) : "r" (value)
+ __asm__ __volatile__ ("lock; and %1, %0"
+ : "+m" (*p)
+ : "r" (value)
: "memory");
}
# define AO_HAVE_and_full
AO_INLINE void
AO_or_full (volatile AO_t *p, AO_t value)
{
- __asm__ __volatile__ ("lock; or %1, %0" :
- "+m" (*p) : "r" (value)
+ __asm__ __volatile__ ("lock; or %1, %0"
+ : "+m" (*p)
+ : "r" (value)
: "memory");
}
# define AO_HAVE_or_full
AO_INLINE void
AO_xor_full (volatile AO_t *p, AO_t value)
{
- __asm__ __volatile__ ("lock; xor %1, %0" :
- "+m" (*p) : "r" (value)
+ __asm__ __volatile__ ("lock; xor %1, %0"
+ : "+m" (*p)
+ : "r" (value)
: "memory");
}
# define AO_HAVE_xor_full
char result;
__asm__ __volatile__ ("lock; cmpxchg %2, %0; setz %1"
: "+m" (*addr), "=a" (result)
- : "r" (new_val), "a"(old)
+ : "r" (new_val), "a" (old)
: "memory");
return (int) result;
}