Go to the documentation of this file.
11 #ifndef _ASM_C6X_CMPXCHG_H
12 #define _ASM_C6X_CMPXCHG_H
19 static inline unsigned int __xchg(
unsigned int x,
volatile void *
ptr,
int size)
29 tmp = *((
unsigned char *) ptr);
30 *((
unsigned char *) ptr) = (
unsigned char) x;
34 tmp = *((
unsigned short *) ptr);
35 *((
unsigned short *) ptr) =
x;
39 tmp = *((
unsigned int *) ptr);
40 *((
unsigned int *) ptr) =
x;
47 #define xchg(ptr, x) \
48 ((__typeof__(*(ptr)))__xchg((unsigned int)(x), (void *) (ptr), \
50 #define tas(ptr) xchg((ptr), 1)
59 #define cmpxchg_local(ptr, o, n) \
60 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \
64 #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))