Lines Matching refs:ptr

67 extern unsigned long __xchg_small(volatile void *ptr, unsigned long val,
71 unsigned long __xchg(volatile void *ptr, unsigned long x, int size) in __xchg() argument
76 return __xchg_small(ptr, x, size); in __xchg()
79 return __xchg_asm("ll", "sc", (volatile u32 *)ptr, x); in __xchg()
85 return __xchg_asm("lld", "scd", (volatile u64 *)ptr, x); in __xchg()
92 #define arch_xchg(ptr, x) \ argument
94 __typeof__(*(ptr)) __res; \
104 __res = (__typeof__(*(ptr))) \
105 __xchg((ptr), (unsigned long)(x), sizeof(*(ptr))); \
148 extern unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
152 unsigned long __cmpxchg(volatile void *ptr, unsigned long old, in __cmpxchg() argument
158 return __cmpxchg_small(ptr, old, new, size); in __cmpxchg()
161 return __cmpxchg_asm("ll", "sc", (volatile u32 *)ptr, in __cmpxchg()
169 return __cmpxchg_asm("lld", "scd", (volatile u64 *)ptr, in __cmpxchg()
177 #define arch_cmpxchg_local(ptr, old, new) \ argument
178 ((__typeof__(*(ptr))) \
179 __cmpxchg((ptr), \
180 (unsigned long)(__typeof__(*(ptr)))(old), \
181 (unsigned long)(__typeof__(*(ptr)))(new), \
182 sizeof(*(ptr))))
184 #define arch_cmpxchg(ptr, old, new) \ argument
186 __typeof__(*(ptr)) __res; \
196 __res = arch_cmpxchg_local((ptr), (old), (new)); \
210 #define arch_cmpxchg64_local(ptr, o, n) \ argument
212 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
213 arch_cmpxchg_local((ptr), (o), (n)); \
216 #define arch_cmpxchg64(ptr, o, n) \ argument
218 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
219 arch_cmpxchg((ptr), (o), (n)); \
224 # define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n)) argument
228 static inline unsigned long __cmpxchg64(volatile void *ptr, in __cmpxchg64() argument
289 "=" GCC_OFF_SMALL_ASM() (*(unsigned long long *)ptr) in __cmpxchg64()
290 : GCC_OFF_SMALL_ASM() (*(unsigned long long *)ptr), in __cmpxchg64()
299 # define arch_cmpxchg64(ptr, o, n) ({ \ argument
300 unsigned long long __old = (__typeof__(*(ptr)))(o); \
301 unsigned long long __new = (__typeof__(*(ptr)))(n); \
302 __typeof__(*(ptr)) __res; \
312 __res = __cmpxchg64((ptr), __old, __new); \
322 # define arch_cmpxchg64(ptr, o, n) arch_cmpxchg64_local((ptr), (o), (n)) argument