Lines Matching +full:3 +full:v

78  * atomic_add(p, v)
79 * { *p += v; }
82 #define __atomic_add_int(p, v, t) \
85 " add %0, %3, %0\n" \
89 : "r" (p), "r" (v), "m" (*p) \
94 #define __atomic_add_long(p, v, t) \
97 " add %0, %3, %0\n" \
101 : "r" (p), "r" (v), "m" (*p) \
105 #define __atomic_add_long(p, v, t) \
108 " add %0, %3, %0\n" \
112 : "r" (p), "r" (v), "m" (*p) \
119 atomic_add_##type(volatile u_##type *p, u_##type v) { \
121 __atomic_add_##type(p, v, t); \
125 atomic_add_acq_##type(volatile u_##type *p, u_##type v) { \
127 __atomic_add_##type(p, v, t); \
132 atomic_add_rel_##type(volatile u_##type *p, u_##type v) { \
135 __atomic_add_##type(p, v, t); \
164 * atomic_clear(p, v)
165 * { *p &= ~v; }
168 #define __atomic_clear_int(p, v, t) \
171 " andc %0, %0, %3\n" \
175 : "r" (p), "r" (v), "m" (*p) \
180 #define __atomic_clear_long(p, v, t) \
183 " andc %0, %0, %3\n" \
187 : "r" (p), "r" (v), "m" (*p) \
191 #define __atomic_clear_long(p, v, t) \
194 " andc %0, %0, %3\n" \
198 : "r" (p), "r" (v), "m" (*p) \
205 atomic_clear_##type(volatile u_##type *p, u_##type v) { \
207 __atomic_clear_##type(p, v, t); \
211 atomic_clear_acq_##type(volatile u_##type *p, u_##type v) { \
213 __atomic_clear_##type(p, v, t); \
218 atomic_clear_rel_##type(volatile u_##type *p, u_##type v) { \
221 __atomic_clear_##type(p, v, t); \
265 * atomic_set(p, v)
266 * { *p |= v; }
269 #define __atomic_set_int(p, v, t) \
272 " or %0, %3, %0\n" \
276 : "r" (p), "r" (v), "m" (*p) \
281 #define __atomic_set_long(p, v, t) \
284 " or %0, %3, %0\n" \
288 : "r" (p), "r" (v), "m" (*p) \
292 #define __atomic_set_long(p, v, t) \
295 " or %0, %3, %0\n" \
299 : "r" (p), "r" (v), "m" (*p) \
306 atomic_set_##type(volatile u_##type *p, u_##type v) { \
308 __atomic_set_##type(p, v, t); \
312 atomic_set_acq_##type(volatile u_##type *p, u_##type v) { \
314 __atomic_set_##type(p, v, t); \
319 atomic_set_rel_##type(volatile u_##type *p, u_##type v) { \
322 __atomic_set_##type(p, v, t); \
351 * atomic_subtract(p, v)
352 * { *p -= v; }
355 #define __atomic_subtract_int(p, v, t) \
358 " subf %0, %3, %0\n" \
362 : "r" (p), "r" (v), "m" (*p) \
367 #define __atomic_subtract_long(p, v, t) \
370 " subf %0, %3, %0\n" \
374 : "r" (p), "r" (v), "m" (*p) \
378 #define __atomic_subtract_long(p, v, t) \
381 " subf %0, %3, %0\n" \
385 : "r" (p), "r" (v), "m" (*p) \
392 atomic_subtract_##type(volatile u_##type *p, u_##type v) { \
394 __atomic_subtract_##type(p, v, t); \
398 atomic_subtract_acq_##type(volatile u_##type *p, u_##type v) { \
400 __atomic_subtract_##type(p, v, t); \
405 atomic_subtract_rel_##type(volatile u_##type *p, u_##type v) { \
408 __atomic_subtract_##type(p, v, t); \
437 * atomic_store_rel(p, v)
452 "1:\tlwarx %0, 0, %3\n\t" /* load old value */
454 "stwcx. %1, 0, %3\n\t" /* attempt to store */
471 "1:\tldarx %0, 0, %3\n\t" /* load old value */
473 "stdcx. %1, 0, %3\n\t" /* attempt to store */
507 u_##TYPE v; \
509 v = *p; \
511 return (v); \
515 atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) \
519 *p = v; \
568 "cmplw %3, %0\n\t" /* compare */
573 "b 3f\n\t" /* we've succeeded */
577 "3:\n\t"
592 "cmplw %3, %0\n\t" /* compare */
597 "b 3f\n\t" /* we've succeeded */
601 "3:\n\t"
617 "1:\tlwarx %2, 0, %3\n\t" /* load old value */
623 "stwcx. %2, 0, %3\n\t" /* attempt to store */
626 "b 3f\n\t" /* we've succeeded */
628 "stwcx. %2, 0, %3\n\t" /* clear reservation (74xx) */
630 "3:\n\t"
639 #define _atomic_cmpset_masked_word(a,o,v,m) atomic_cmpset_masked(a, o, v, m)
649 "cmplw %3, %0\n\t" /* compare */
654 "b 3f\n\t" /* we've succeeded */
658 "3:\n\t"
673 "cmpld %3, %0\n\t" /* compare */
678 "cmplw %3, %0\n\t" /* compare */
684 "b 3f\n\t" /* we've succeeded */
692 "3:\n\t"
765 "lbarx %0, 0, %3\n\t" /* load old value */
768 "stbcx. %5, 0, %3\n\t" /* attempt to store */
773 "stbcx. %0, 0, %3\n\t" /* clear reservation (74xx) */
790 "lharx %0, 0, %3\n\t" /* load old value */
793 "sthcx. %5, 0, %3\n\t" /* attempt to store */
798 "sthcx. %0, 0, %3\n\t" /* clear reservation (74xx) */
816 "lwarx %0, 0, %3\n\t" /* load old value */
819 "stwcx. %5, 0, %3\n\t" /* attempt to store */
824 "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */
841 "ldarx %0, 0, %3\n\t" /* load old value */
844 "stdcx. %5, 0, %3\n\t" /* attempt to store */
846 "lwarx %0, 0, %3\n\t" /* load old value */
849 "stwcx. %5, 0, %3\n\t" /* attempt to store */
856 "stdcx. %0, 0, %3\n\t" /* clear reservation (74xx) */
859 "stwcx. %0, 0, %3\n\t" /* clear reservation (74xx) */
924 atomic_fetchadd_int(volatile u_int *p, u_int v)
930 } while (!atomic_cmpset_int(p, value, value + v));
935 atomic_fetchadd_long(volatile u_long *p, u_long v)
941 } while (!atomic_cmpset_long(p, value, value + v));
946 atomic_swap_32(volatile u_int *p, u_int v)
952 " stwcx. %3,0,%2\n"
955 : "r" (p), "r" (v)
963 atomic_swap_64(volatile u_long *p, u_long v)
969 " stdcx. %3,0,%2\n"
972 : "r" (p), "r" (v)
987 #define atomic_swap_long(p,v) atomic_swap_32((volatile u_int *)(p), v)
988 #define atomic_swap_ptr(p,v) atomic_swap_32((volatile u_int *)(p), v)
992 atomic_testandset_int(volatile u_int *p, u_int v)
994 u_int m = (1u << (v & 0x1f));
999 "1: lwarx %0,0,%3\n"
1002 " stwcx. %0,0,%3\n"
1012 atomic_testandclear_int(volatile u_int *p, u_int v)
1014 u_int m = (1u << (v & 0x1f));
1019 "1: lwarx %0,0,%3\n"
1022 " stwcx. %0,0,%3\n"
1033 atomic_testandset_long(volatile u_long *p, u_int v)
1035 u_long m = (1ul << (v & 0x3f));
1040 "1: ldarx %0,0,%3\n"
1043 " stdcx. %0,0,%3\n"
1053 atomic_testandclear_long(volatile u_long *p, u_int v)
1055 u_long m = (1ul << (v & 0x3f));
1060 "1: ldarx %0,0,%3\n"
1063 " stdcx. %0,0,%3\n"
1073 atomic_testandset_long(volatile u_long *p, u_int v)
1075 return (atomic_testandset_int((volatile u_int *)p, v));
1079 atomic_testandclear_long(volatile u_long *p, u_int v)
1081 return (atomic_testandclear_int((volatile u_int *)p, v));
1089 atomic_testandset_acq_long(volatile u_long *p, u_int v)
1091 u_int a = atomic_testandset_long(p, v);
1100 #define atomic_testandclear_ptr(p,v) \
1101 atomic_testandclear_32((volatile u_int *)(p), v)
1102 #define atomic_testandset_ptr(p,v) \
1103 atomic_testandset_32((volatile u_int *)(p), v)