Lines Matching refs:ptr
25 static inline unsigned long cmpxchg_u32(volatile void *ptr,
38 : "r"(ptr), "r"(old), "r"(new)
44 static inline unsigned long xchg_u32(volatile void *ptr,
53 : "r"(ptr), "r"(val)
59 static inline u32 cmpxchg_small(volatile void *ptr, u32 old, u32 new,
62 int off = (unsigned long)ptr % sizeof(u32);
63 volatile u32 *p = ptr - off;
92 static inline u32 xchg_small(volatile void *ptr, u32 x, int size)
94 int off = (unsigned long)ptr % sizeof(u32);
95 volatile u32 *p = ptr - off;
121 static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
127 return cmpxchg_small(ptr, old, new, size);
129 return cmpxchg_u32(ptr, old, new);
135 #define cmpxchg(ptr, o, n) \
137 (__typeof__(*(ptr))) __cmpxchg((ptr), \
140 sizeof(*(ptr))); \
150 static inline unsigned long __xchg(volatile void *ptr, unsigned long with,
156 return xchg_small(ptr, with, size);
158 return xchg_u32(ptr, with);
164 #define xchg(ptr, with) \
166 (__typeof__(*(ptr))) __xchg((ptr), \
168 sizeof(*(ptr))); \