Lines Matching refs:ptr
34 int _atomic_xchg(int *ptr, int n);
37 int _atomic_cmpxchg(int *ptr, int o, int n);
43 #define xchg(ptr, n) \ argument
45 if (sizeof(*(ptr)) != 4) \
48 (typeof(*(ptr)))_atomic_xchg((int *)(ptr), (int)(n)); \
51 #define cmpxchg(ptr, o, n) \ argument
53 if (sizeof(*(ptr)) != 4) \
56 (typeof(*(ptr)))_atomic_cmpxchg((int *)ptr, (int)o, \
60 #define xchg64(ptr, n) \ argument
62 if (sizeof(*(ptr)) != 8) \
65 (typeof(*(ptr)))_atomic64_xchg((long long *)(ptr), \
69 #define cmpxchg64(ptr, o, n) \ argument
71 if (sizeof(*(ptr)) != 8) \
74 (typeof(*(ptr)))_atomic64_cmpxchg((long long *)ptr, \
80 #define xchg(ptr, n) \ argument
82 typeof(*(ptr)) __x; \
84 switch (sizeof(*(ptr))) { \
87 __insn_exch4((ptr), \
92 __insn_exch((ptr), (unsigned long)(n)); \
102 #define cmpxchg(ptr, o, n) \ argument
104 typeof(*(ptr)) __x; \
107 switch (sizeof(*(ptr))) { \
110 __insn_cmpexch4((ptr), \
114 __x = (typeof(__x))__insn_cmpexch((ptr), \
130 #define tas(ptr) xchg((ptr), 1) argument