Lines Matching refs:mem

32 #define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \  argument
35 #define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \ argument
52 #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ argument
54 __typeof (*(mem)) __tmp; \
55 __typeof (mem) __memp = (mem); \
69 #define __arch_compare_and_exchange_val_32_rel(mem, newval, oldval) \ argument
71 __typeof (*(mem)) __tmp; \
72 __typeof (mem) __memp = (mem); \
86 #define __arch_atomic_exchange_32_acq(mem, value) \ argument
88 __typeof (*mem) __val; \
94 : "=&r" (__val), "=m" (*mem) \
95 : "b" (mem), "r" (value), "m" (*mem) \
100 #define __arch_atomic_exchange_32_rel(mem, value) \ argument
102 __typeof (*mem) __val; \
107 : "=&r" (__val), "=m" (*mem) \
108 : "b" (mem), "r" (value), "m" (*mem) \
113 #define __arch_atomic_exchange_and_add_32(mem, value) \ argument
115 __typeof (*mem) __val, __tmp; \
120 : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
121 : "b" (mem), "r" (value), "m" (*mem) \
126 #define __arch_atomic_exchange_and_add_32_acq(mem, value) \ argument
128 __typeof (*mem) __val, __tmp; \
134 : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
135 : "b" (mem), "r" (value), "m" (*mem) \
140 #define __arch_atomic_exchange_and_add_32_rel(mem, value) \ argument
142 __typeof (*mem) __val, __tmp; \
148 : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
149 : "b" (mem), "r" (value), "m" (*mem) \
154 #define __arch_atomic_increment_val_32(mem) \ argument
156 __typeof (*(mem)) __val; \
161 : "=&b" (__val), "=m" (*mem) \
162 : "b" (mem), "m" (*mem) \
167 #define __arch_atomic_decrement_val_32(mem) \ argument
169 __typeof (*(mem)) __val; \
174 : "=&b" (__val), "=m" (*mem) \
175 : "b" (mem), "m" (*mem) \
180 #define __arch_atomic_decrement_if_positive_32(mem) \ argument
189 : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
190 : "b" (mem), "m" (*mem) \
195 #define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ argument
197 __typeof (*(mem)) __result; \
198 if (sizeof (*mem) == 4) \
199 __result = __arch_compare_and_exchange_val_32_acq(mem, newval, oldval); \
200 else if (sizeof (*mem) == 8) \
201 __result = __arch_compare_and_exchange_val_64_acq(mem, newval, oldval); \
207 #define atomic_compare_and_exchange_val_rel(mem, newval, oldval) \ argument
209 __typeof (*(mem)) __result; \
210 if (sizeof (*mem) == 4) \
211 __result = __arch_compare_and_exchange_val_32_rel(mem, newval, oldval); \
212 else if (sizeof (*mem) == 8) \
213 __result = __arch_compare_and_exchange_val_64_rel(mem, newval, oldval); \
219 #define atomic_exchange_acq(mem, value) \ argument
221 __typeof (*(mem)) __result; \
222 if (sizeof (*mem) == 4) \
223 __result = __arch_atomic_exchange_32_acq (mem, value); \
224 else if (sizeof (*mem) == 8) \
225 __result = __arch_atomic_exchange_64_acq (mem, value); \
231 #define atomic_exchange_rel(mem, value) \ argument
233 __typeof (*(mem)) __result; \
234 if (sizeof (*mem) == 4) \
235 __result = __arch_atomic_exchange_32_rel (mem, value); \
236 else if (sizeof (*mem) == 8) \
237 __result = __arch_atomic_exchange_64_rel (mem, value); \
243 #define atomic_exchange_and_add(mem, value) \ argument
245 __typeof (*(mem)) __result; \
246 if (sizeof (*mem) == 4) \
247 __result = __arch_atomic_exchange_and_add_32 (mem, value); \
248 else if (sizeof (*mem) == 8) \
249 __result = __arch_atomic_exchange_and_add_64 (mem, value); \
254 #define atomic_exchange_and_add_acq(mem, value) \ argument
256 __typeof (*(mem)) __result; \
257 if (sizeof (*mem) == 4) \
258 __result = __arch_atomic_exchange_and_add_32_acq (mem, value); \
259 else if (sizeof (*mem) == 8) \
260 __result = __arch_atomic_exchange_and_add_64_acq (mem, value); \
265 #define atomic_exchange_and_add_rel(mem, value) \ argument
267 __typeof (*(mem)) __result; \
268 if (sizeof (*mem) == 4) \
269 __result = __arch_atomic_exchange_and_add_32_rel (mem, value); \
270 else if (sizeof (*mem) == 8) \
271 __result = __arch_atomic_exchange_and_add_64_rel (mem, value); \
277 #define atomic_increment_val(mem) \ argument
279 __typeof (*(mem)) __result; \
280 if (sizeof (*(mem)) == 4) \
281 __result = __arch_atomic_increment_val_32 (mem); \
282 else if (sizeof (*(mem)) == 8) \
283 __result = __arch_atomic_increment_val_64 (mem); \
289 #define atomic_increment(mem) ({ atomic_increment_val (mem); (void) 0; }) argument
291 #define atomic_decrement_val(mem) \ argument
293 __typeof (*(mem)) __result; \
294 if (sizeof (*(mem)) == 4) \
295 __result = __arch_atomic_decrement_val_32 (mem); \
296 else if (sizeof (*(mem)) == 8) \
297 __result = __arch_atomic_decrement_val_64 (mem); \
303 #define atomic_decrement(mem) ({ atomic_decrement_val (mem); (void) 0; }) argument
307 #define atomic_decrement_if_positive(mem) \ argument
308 ({ __typeof (*(mem)) __result; \
309 if (sizeof (*mem) == 4) \
310 __result = __arch_atomic_decrement_if_positive_32 (mem); \
311 else if (sizeof (*mem) == 8) \
312 __result = __arch_atomic_decrement_if_positive_64 (mem); \