Lines Matching defs:p
44 #define atomic_set(p, v) WRITE_ONCE(*(p), (v))
45 #define atomic_read(p) READ_ONCE(*(p))
46 #define atomic_inc(p) __sync_fetch_and_add(p, 1)
47 #define atomic_dec(p) __sync_fetch_and_sub(p, 1)
48 #define atomic_add(n, p) __sync_fetch_and_add(p, n)
49 #define atomic_sub(n, p) __sync_fetch_and_sub(p, n)
50 #define atomic_and(n, p) __sync_fetch_and_and(p, n)
51 #define atomic_or(n, p) atomic_setbits_int(p, n)
52 #define atomic_add_return(n, p) __sync_add_and_fetch(p, n)
53 #define atomic_sub_return(n, p) __sync_sub_and_fetch(p, n)
54 #define atomic_sub_and_test(n, p) (atomic_sub_return(n, p) == 0)
59 #define atomic_cmpxchg(p, o, n) __sync_val_compare_and_swap(p, o, n)
60 #define cmpxchg(p, o, n) __sync_val_compare_and_swap(p, o, n)
61 #define cmpxchg64(p, o, n) __sync_val_compare_and_swap(p, o, n)
62 #define atomic_set_release(p, v) atomic_set((p), (v))
63 #define atomic_andnot(bits, p) atomic_clearbits_int(p,bits)
64 #define atomic_fetch_inc(p) __sync_fetch_and_add(p, 1)
65 #define atomic_fetch_xor(n, p) __sync_fetch_and_xor(p, n)
67 #define try_cmpxchg(p, op, n) \
69 __typeof(p) __op = (__typeof((p)))(op); \
70 __typeof(*(p)) __o = *__op; \
71 __typeof(*(p)) __p = __sync_val_compare_and_swap((p), (__o), (n)); \
78 atomic_try_cmpxchg(volatile int *p, int *op, int n)
80 return try_cmpxchg(p, op, n);
123 #define atomic_long_read(p) READ_ONCE(*(p))
132 #define atomic64_set(p, v) WRITE_ONCE(*(p), (v))
133 #define atomic64_read(p) READ_ONCE(*(p))
148 #define atomic64_add(n, p) __sync_fetch_and_add_8(p, n)
149 #define atomic64_sub(n, p) __sync_fetch_and_sub_8(p, n)
150 #define atomic64_inc(p) __sync_fetch_and_add_8(p, 1)
151 #define atomic64_add_return(n, p) __sync_add_and_fetch_8(p, n)
152 #define atomic64_inc_return(p) __sync_add_and_fetch_8(p, 1)
205 #define atomic64_inc(p) atomic64_add(p, 1)
220 #define atomic64_inc_return(p) atomic64_add_return(1, p)
233 #define atomic_long_set(p, v) atomic64_set(p, v)
235 #define atomic_long_cmpxchg(p, o, n) atomic_cmpxchg(p, o, n)
240 #define atomic_long_set(p, v) atomic_set(p, v)
242 #define atomic_long_cmpxchg(p, o, n) atomic_cmpxchg(p, o, n)
248 test_and_set_bit(u_int b, volatile void *p)
251 unsigned int prev = __sync_fetch_and_or((volatile u_int *)p + (b >> 5), m);
256 clear_bit(u_int b, volatile void *p)
258 atomic_clearbits_int(((volatile u_int *)p) + (b >> 5), 1 << (b & 0x1f));
262 clear_bit_unlock(u_int b, volatile void *p)
265 clear_bit(b, p);
269 set_bit(u_int b, volatile void *p)
271 atomic_setbits_int(((volatile u_int *)p) + (b >> 5), 1 << (b & 0x1f));
275 __clear_bit(u_int b, volatile void *p)
277 volatile u_int *ptr = (volatile u_int *)p;
282 __set_bit(u_int b, volatile void *p)
284 volatile u_int *ptr = (volatile u_int *)p;
289 test_bit(u_int b, const volatile void *p)
291 return !!(((volatile u_int *)p)[b >> 5] & (1 << (b & 0x1f)));
295 __test_and_set_bit(u_int b, volatile void *p)
298 volatile u_int *ptr = (volatile u_int *)p;
306 test_and_clear_bit(u_int b, volatile void *p)
309 unsigned int prev = __sync_fetch_and_and((volatile u_int *)p + (b >> 5), ~m);
314 __test_and_clear_bit(u_int b, volatile void *p)
316 volatile u_int *ptr = (volatile u_int *)p;
323 find_first_zero_bit(volatile void *p, int max)
326 volatile u_int *ptr = (volatile u_int *)p;
341 find_next_zero_bit(volatile void *p, int max, int b)
343 volatile u_int *ptr = (volatile u_int *)p;
358 find_first_bit(volatile void *p, int max)
361 volatile u_int *ptr = (volatile u_int *)p;
376 find_next_bit(const volatile void *p, int max, int b)
378 volatile u_int *ptr = (volatile u_int *)p;
392 #define for_each_set_bit(b, p, max) \
393 for ((b) = find_first_bit((p), (max)); \
395 (b) = find_next_bit((p), (max), (b) + 1))
397 #define for_each_clear_bit(b, p, max) \
398 for ((b) = find_first_zero_bit((p), (max)); \
400 (b) = find_next_zero_bit((p), (max), (b) + 1))