Lines Matching refs:ptr
24 static inline unsigned long __xchg(volatile void *ptr, unsigned long x, in __xchg() argument
29 return __xchg_asm("amswap_db.w", (volatile u32 *)ptr, (u32)x); in __xchg()
32 return __xchg_asm("amswap_db.d", (volatile u64 *)ptr, (u64)x); in __xchg()
41 #define arch_xchg(ptr, x) \ argument
43 __typeof__(*(ptr)) __res; \
45 __res = (__typeof__(*(ptr))) \
46 __xchg((ptr), (unsigned long)(x), sizeof(*(ptr))); \
70 static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, in __cmpxchg() argument
75 return __cmpxchg_asm("ll.w", "sc.w", (volatile u32 *)ptr, in __cmpxchg()
79 return __cmpxchg_asm("ll.d", "sc.d", (volatile u64 *)ptr, in __cmpxchg()
89 #define arch_cmpxchg_local(ptr, old, new) \ argument
90 ((__typeof__(*(ptr))) \
91 __cmpxchg((ptr), \
92 (unsigned long)(__typeof__(*(ptr)))(old), \
93 (unsigned long)(__typeof__(*(ptr)))(new), \
94 sizeof(*(ptr))))
96 #define arch_cmpxchg(ptr, old, new) \ argument
98 __typeof__(*(ptr)) __res; \
100 __res = arch_cmpxchg_local((ptr), (old), (new)); \
106 #define arch_cmpxchg64_local(ptr, o, n) \ argument
108 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
109 arch_cmpxchg_local((ptr), (o), (n)); \
112 #define arch_cmpxchg64(ptr, o, n) \ argument
114 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
115 arch_cmpxchg((ptr), (o), (n)); \
119 #define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n)) argument
120 #define arch_cmpxchg64(ptr, o, n) arch_cmpxchg64_local((ptr), (o), (n)) argument