Go to the documentation of this file. 1 #ifndef __ASM_CRIS_CMPXCHG__
2 #define __ASM_CRIS_CMPXCHG__
6 static inline unsigned long __xchg(
unsigned long x,
volatile void *
ptr,
int size)
14 *((
unsigned char *)&temp) =
x;
15 x = *(
unsigned char *)ptr;
16 *(
unsigned char *)ptr = *((
unsigned char *)&
temp);
19 *((
unsigned short *)&temp) =
x;
20 x = *(
unsigned short *)ptr;
21 *(
unsigned short *)ptr = *((
unsigned short *)&
temp);
25 x = *(
unsigned long *)ptr;
26 *(
unsigned long *)ptr = temp;
34 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
36 #define tas(ptr) (xchg((ptr),1))
44 #define cmpxchg_local(ptr, o, n) \
45 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
46 (unsigned long)(n), sizeof(*(ptr))))
47 #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))