Lines Matching refs:mem

45 #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \  argument
46 ({ __typeof (*(mem)) __result; \
57 : "=&r" (__result) : "u" (mem), "u" (newval), "u" (oldval) \
61 #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ argument
62 ({ __typeof (*(mem)) __result; \
74 : "=&r" (__result) : "u" (mem), "u" (newval), "u" (oldval) \
78 #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ argument
79 ({ __typeof (*(mem)) __result; \
90 : "=&r" (__result) : "u" (mem), "u" (newval), "u" (oldval) \
99 # define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ argument
100 (abort (), (__typeof (*mem)) 0)
102 #define atomic_exchange_and_add(mem, value) \ argument
103 ({ __typeof (*(mem)) __result, __tmp, __value = (value); \
104 if (sizeof (*(mem)) == 1) \
115 : "=&r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
117 else if (sizeof (*(mem)) == 2) \
128 : "=&r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
130 else if (sizeof (*(mem)) == 4) \
141 : "=&r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
145 __typeof (mem) memp = (mem); \
154 #define atomic_add(mem, value) \ argument
155 (void) ({ __typeof (*(mem)) __tmp, __value = (value); \
156 if (sizeof (*(mem)) == 1) \
166 : "=&r" (__tmp) : "u" (mem), "0" (__value) \
168 else if (sizeof (*(mem)) == 2) \
178 : "=&r" (__tmp) : "u" (mem), "0" (__value) \
180 else if (sizeof (*(mem)) == 4) \
190 : "=&r" (__tmp) : "u" (mem), "0" (__value) \
194 __typeof (*(mem)) oldval; \
195 __typeof (mem) memp = (mem); \
204 #define atomic_add_negative(mem, value) \ argument
206 __typeof (*(mem)) __tmp, __value = (value); \
207 if (sizeof (*(mem)) == 1) \
219 : "=r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
221 else if (sizeof (*(mem)) == 2) \
233 : "=r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
235 else if (sizeof (*(mem)) == 4) \
247 : "=r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
253 #define atomic_add_zero(mem, value) \ argument
255 __typeof (*(mem)) __tmp, __value = (value); \
256 if (sizeof (*(mem)) == 1) \
268 : "=r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
270 else if (sizeof (*(mem)) == 2) \
282 : "=r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
284 else if (sizeof (*(mem)) == 4) \
296 : "=r" (__result), "=&r" (__tmp) : "u" (mem), "1" (__value) \
302 #define atomic_increment_and_test(mem) atomic_add_zero((mem), 1) argument
303 #define atomic_decrement_and_test(mem) atomic_add_zero((mem), -1) argument
305 #define atomic_bit_set(mem, bit) \ argument
307 if (sizeof (*(mem)) == 1) \
317 : : "u" (mem), "u" (__mask) \
319 else if (sizeof (*(mem)) == 2) \
329 : : "u" (mem), "u" (__mask) \
331 else if (sizeof (*(mem)) == 4) \
341 : : "u" (mem), "u" (__mask) \
347 #define atomic_bit_test_set(mem, bit) \ argument
350 if (sizeof (*(mem)) == 1) \
363 : "u" (mem), "0" (__result), "1" (__mask) \
365 else if (sizeof (*(mem)) == 2) \
378 : "u" (mem), "0" (__result), "1" (__mask) \
380 else if (sizeof (*(mem)) == 4) \
393 : "u" (mem), "0" (__result), "1" (__mask) \