Lines Matching +full:1 +full:v

10  * 1. Redistributions of source code must retain the above copyright
79 * atomic_set_char(P, V) (*(u_char *)(P) |= (V))
80 * atomic_clear_char(P, V) (*(u_char *)(P) &= ~(V))
81 * atomic_add_char(P, V) (*(u_char *)(P) += (V))
82 * atomic_subtract_char(P, V) (*(u_char *)(P) -= (V))
84 * atomic_set_short(P, V) (*(u_short *)(P) |= (V))
85 * atomic_clear_short(P, V) (*(u_short *)(P) &= ~(V))
86 * atomic_add_short(P, V) (*(u_short *)(P) += (V))
87 * atomic_subtract_short(P, V) (*(u_short *)(P) -= (V))
89 * atomic_set_int(P, V) (*(u_int *)(P) |= (V))
90 * atomic_clear_int(P, V) (*(u_int *)(P) &= ~(V))
91 * atomic_add_int(P, V) (*(u_int *)(P) += (V))
92 * atomic_subtract_int(P, V) (*(u_int *)(P) -= (V))
93 * atomic_swap_int(P, V) (return (*(u_int *)(P)); *(u_int *)(P) = (V);)
96 * atomic_set_long(P, V) (*(u_long *)(P) |= (V))
97 * atomic_clear_long(P, V) (*(u_long *)(P) &= ~(V))
98 * atomic_add_long(P, V) (*(u_long *)(P) += (V))
99 * atomic_subtract_long(P, V) (*(u_long *)(P) -= (V))
100 * atomic_swap_long(P, V) (return (*(u_long *)(P)); *(u_long *)(P) = (V);)
113 #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ argument
115 atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
119 : CONS (V) \
124 atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
128 : CONS (V) \
155 " lock; cmpxchg %3,%1 ; " \
158 "+m" (*dst), /* 1 */ \
171 " lock; cmpxchg %3,%1 ; " \
174 "+m" (*dst), /* 1 */ \
187 * Atomically add the value of v to the integer pointed to by p and return
191 atomic_fetchadd_int(volatile u_int *p, u_int v) in atomic_fetchadd_int() argument
195 " lock; xaddl %0,%1 ; " in atomic_fetchadd_int()
197 : "+r" (v), /* 0 */ in atomic_fetchadd_int()
198 "+m" (*p) /* 1 */ in atomic_fetchadd_int()
200 return (v); in atomic_fetchadd_int()
204 * Atomically add the value of v to the long integer pointed to by p and return
208 atomic_fetchadd_long(volatile u_long *p, u_long v) in atomic_fetchadd_long() argument
212 " lock; xaddq %0,%1 ; " in atomic_fetchadd_long()
214 : "+r" (v), /* 0 */ in atomic_fetchadd_long()
215 "+m" (*p) /* 1 */ in atomic_fetchadd_long()
217 return (v); in atomic_fetchadd_long()
221 atomic_testandset_int(volatile u_int *p, u_int v) in atomic_testandset_int() argument
226 " lock; btsl %2,%1 ; " in atomic_testandset_int()
229 "+m" (*p) /* 1 */ in atomic_testandset_int()
230 : "Ir" (v & 0x1f) /* 2 */ in atomic_testandset_int()
236 atomic_testandset_long(volatile u_long *p, u_int v) in atomic_testandset_long() argument
241 " lock; btsq %2,%1 ; " in atomic_testandset_long()
244 "+m" (*p) /* 1 */ in atomic_testandset_long()
245 : "Jr" ((u_long)(v & 0x3f)) /* 2 */ in atomic_testandset_long()
251 atomic_testandclear_int(volatile u_int *p, u_int v) in atomic_testandclear_int() argument
256 " lock; btrl %2,%1 ; " in atomic_testandclear_int()
259 "+m" (*p) /* 1 */ in atomic_testandclear_int()
260 : "Ir" (v & 0x1f) /* 2 */ in atomic_testandclear_int()
266 atomic_testandclear_long(volatile u_long *p, u_int v) in atomic_testandclear_long() argument
271 " lock; btrq %2,%1 ; " in atomic_testandclear_long()
274 "+m" (*p) /* 1 */ in atomic_testandclear_long()
275 : "Jr" ((u_long)(v & 0x3f)) /* 2 */ in atomic_testandclear_long()
319 atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) \
323 *p = v; \
355 ATOMIC_ASM(set, char, "orb %b1,%0", "iq", v);
356 ATOMIC_ASM(clear, char, "andb %b1,%0", "iq", ~v);
357 ATOMIC_ASM(add, char, "addb %b1,%0", "iq", v);
358 ATOMIC_ASM(subtract, char, "subb %b1,%0", "iq", v);
360 ATOMIC_ASM(set, short, "orw %w1,%0", "ir", v);
361 ATOMIC_ASM(clear, short, "andw %w1,%0", "ir", ~v);
362 ATOMIC_ASM(add, short, "addw %w1,%0", "ir", v);
363 ATOMIC_ASM(subtract, short, "subw %w1,%0", "ir", v);
365 ATOMIC_ASM(set, int, "orl %1,%0", "ir", v);
366 ATOMIC_ASM(clear, int, "andl %1,%0", "ir", ~v);
367 ATOMIC_ASM(add, int, "addl %1,%0", "ir", v);
368 ATOMIC_ASM(subtract, int, "subl %1,%0", "ir", v);
370 ATOMIC_ASM(set, long, "orq %1,%0", "er", v);
371 ATOMIC_ASM(clear, long, "andq %1,%0", "er", ~v);
372 ATOMIC_ASM(add, long, "addq %1,%0", "er", v);
373 ATOMIC_ASM(subtract, long, "subq %1,%0", "er", v);
391 atomic_swap_int(volatile u_int *p, u_int v) in atomic_swap_int() argument
395 " xchgl %1,%0 ; " in atomic_swap_int()
397 : "+r" (v), /* 0 */ in atomic_swap_int()
398 "+m" (*p)); /* 1 */ in atomic_swap_int()
399 return (v); in atomic_swap_int()
403 atomic_swap_long(volatile u_long *p, u_long v) in atomic_swap_long() argument
407 " xchgq %1,%0 ; " in atomic_swap_long()
409 : "+r" (v), /* 0 */ in atomic_swap_long()
410 "+m" (*p)); /* 1 */ in atomic_swap_long()
411 return (v); in atomic_swap_long()