Go to the documentation of this file.
10 #ifndef __UNICORE_CMPXCHG_H__
11 #define __UNICORE_CMPXCHG_H__
19 static inline unsigned long __xchg(
unsigned long x,
volatile void *
ptr,
26 asm volatile(
"swapb %0, %1, [%2]"
32 asm volatile(
"swapw %0, %1, [%2]"
44 #define xchg(ptr, x) \
45 ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
53 #define cmpxchg_local(ptr, o, n) \
54 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \
55 (unsigned long)(o), (unsigned long)(n), sizeof(*(ptr))))
56 #define cmpxchg64_local(ptr, o, n) \
57 __cmpxchg64_local_generic((ptr), (o), (n))