Lines Matching defs:ptr

25 __arch_xchg(unsigned long x, volatile void *ptr, int size)
29 case 8: return __xchg64(x, (volatile unsigned long *) ptr);
31 case 4: return __xchg32((int) x, (volatile int *) ptr);
32 case 1: return __xchg8((char) x, (volatile char *) ptr);
40 ** o need to test sizeof(*ptr) to avoid clearing adjacent bytes
47 #define arch_xchg(ptr, x) \
49 __typeof__(*(ptr)) __ret; \
50 __typeof__(*(ptr)) _x_ = (x); \
51 __ret = (__typeof__(*(ptr))) \
52 __arch_xchg((unsigned long)_x_, (ptr), sizeof(*(ptr))); \
60 extern u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new_);
61 extern u16 __cmpxchg_u16(volatile u16 *ptr, u16 old, u16 new_);
63 extern u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new_);
67 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
71 size == 8 ? __cmpxchg_u64(ptr, old, new_) :
73 size == 4 ? __cmpxchg_u32(ptr, old, new_) :
74 size == 2 ? __cmpxchg_u16(ptr, old, new_) :
75 size == 1 ? __cmpxchg_u8(ptr, old, new_) :
79 #define arch_cmpxchg(ptr, o, n) \
81 __typeof__(*(ptr)) _o_ = (o); \
82 __typeof__(*(ptr)) _n_ = (n); \
83 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
84 (unsigned long)_n_, sizeof(*(ptr))); \
89 static inline unsigned long __cmpxchg_local(volatile void *ptr,
95 case 8: return __cmpxchg_u64((u64 *)ptr, old, new_);
97 case 4: return __cmpxchg_u32(ptr, old, new_);
99 return __generic_cmpxchg_local(ptr, old, new_, size);
107 #define arch_cmpxchg_local(ptr, o, n) \
108 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
109 (unsigned long)(n), sizeof(*(ptr))))
111 #define arch_cmpxchg64_local(ptr, o, n) \
113 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
114 cmpxchg_local((ptr), (o), (n)); \
117 #define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n))
120 #define arch_cmpxchg64(ptr, o, n) __cmpxchg_u64(ptr, o, n)