Lines Matching refs:ptr
74 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
77 case 4: return __cmpxchg_u32(ptr, old, new);
83 #define arch_cmpxchg(ptr,o,n) \
84 ({ __typeof__(*(ptr)) _o_ = (o); \
85 __typeof__(*(ptr)) _n_ = (n); \
86 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
87 (unsigned long)_n_, sizeof (*(ptr))); \
92 static inline unsigned long __cmpxchg_local(volatile void *ptr,
98 return __cmpxchg_u32(ptr, old, new);
100 return __generic_cmpxchg_local(ptr, old, new, size);
110 #define arch_cmpxchg_local(ptr, o, n) \
111 ((__typeof__(*(ptr)))__generic_cmpxchg_local((ptr), (unsigned long)(o),\
112 (unsigned long)(n), sizeof(*(ptr))))
113 #define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n))
114 #define arch_cmpxchg64(ptr, o, n) arch_cmpxchg64_local((ptr), (o), (n))
172 #define arch_xchg(ptr,x) \
173 ((__typeof__(*(ptr)))__arch_xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
175 static inline u32 xchg_small(volatile void *ptr, u32 x, int size)
177 int off = (unsigned long)ptr % sizeof(u32);
178 volatile u32 *p = ptr - off;
206 __arch_xchg(unsigned long x, volatile void * ptr, int size)
210 return xchg_small(ptr, x, 1);
212 return xchg_small(ptr, x, 2);
214 return xchg_u32(ptr, x);