Lines Matching refs:ptr

25 static inline unsigned int __xchg_small(volatile void *ptr, unsigned int val,  in __xchg_small()  argument
41 shift = (unsigned long)ptr & 0x3; in __xchg_small()
49 ptr32 = (volatile u32 *)((unsigned long)ptr & ~0x3); in __xchg_small()
65 __xchg(volatile void *ptr, unsigned long x, int size) in __xchg() argument
70 return __xchg_small(ptr, x, size); in __xchg()
73 return __xchg_asm("amswap_db.w", (volatile u32 *)ptr, (u32)x); in __xchg()
76 return __xchg_asm("amswap_db.d", (volatile u64 *)ptr, (u64)x); in __xchg()
85 #define arch_xchg(ptr, x) \ argument
87 __typeof__(*(ptr)) __res; \
89 __res = (__typeof__(*(ptr))) \
90 __xchg((ptr), (unsigned long)(x), sizeof(*(ptr))); \
114 static inline unsigned int __cmpxchg_small(volatile void *ptr, unsigned int old, in __cmpxchg_small() argument
131 shift = (unsigned long)ptr & 0x3; in __cmpxchg_small()
141 ptr32 = (volatile u32 *)((unsigned long)ptr & ~0x3); in __cmpxchg_small()
163 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, unsigned int size) in __cmpxchg() argument
168 return __cmpxchg_small(ptr, old, new, size); in __cmpxchg()
171 return __cmpxchg_asm("ll.w", "sc.w", (volatile u32 *)ptr, in __cmpxchg()
175 return __cmpxchg_asm("ll.d", "sc.d", (volatile u64 *)ptr, in __cmpxchg()
185 #define arch_cmpxchg_local(ptr, old, new) \ argument
186 ((__typeof__(*(ptr))) \
187 __cmpxchg((ptr), \
188 (unsigned long)(__typeof__(*(ptr)))(old), \
189 (unsigned long)(__typeof__(*(ptr)))(new), \
190 sizeof(*(ptr))))
192 #define arch_cmpxchg(ptr, old, new) \ argument
194 __typeof__(*(ptr)) __res; \
196 __res = arch_cmpxchg_local((ptr), (old), (new)); \
202 #define arch_cmpxchg64_local(ptr, o, n) \ argument
204 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
205 arch_cmpxchg_local((ptr), (o), (n)); \
208 #define arch_cmpxchg64(ptr, o, n) \ argument
210 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
211 arch_cmpxchg((ptr), (o), (n)); \
215 #define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n)) argument
216 #define arch_cmpxchg64(ptr, o, n) arch_cmpxchg64_local((ptr), (o), (n)) argument