Go to the documentation of this file. 1 #ifndef __ASM_SH_CMPXCHG_H
2 #define __ASM_SH_CMPXCHG_H
9 #include <linux/compiler.h>
10 #include <linux/types.h>
12 #if defined(CONFIG_GUSA_RB)
14 #elif defined(CONFIG_CPU_SH4A)
22 #define __xchg(ptr, x, size) \
24 unsigned long __xchg__res; \
25 volatile void *__xchg_ptr = (ptr); \
28 __xchg__res = xchg_u32(__xchg_ptr, x); \
31 __xchg__res = xchg_u8(__xchg_ptr, x); \
34 __xchg_called_with_bad_pointer(); \
43 ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
49 #define __HAVE_ARCH_CMPXCHG 1
51 static inline unsigned long __cmpxchg(
volatile void *
ptr,
unsigned long old,
52 unsigned long new,
int size)
62 #define cmpxchg(ptr,o,n) \
64 __typeof__(*(ptr)) _o_ = (o); \
65 __typeof__(*(ptr)) _n_ = (n); \
66 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
67 (unsigned long)_n_, sizeof(*(ptr))); \