| 219 | */ |
| 220 | #ifndef atomic_testandset_acq_long |
| 221 | static __inline int |
| 222 | atomic_testandset_acq_long(volatile u_long *p, u_int v) |
| 223 | { |
| 224 | u_long bit, old; |
| 225 | bool ret; |
| 226 | |
| 227 | bit = (1ul << (v % (sizeof(*p) * NBBY))); |
| 228 | |
| 229 | old = atomic_load_acq_long(p); |
| 230 | ret = false; |
| 231 | while (!ret && (old & bit) == 0) |
| 232 | ret = atomic_fcmpset_acq_long(p, &old, old | bit); |
| 233 | |
| 234 | return (!ret); |
| 235 | } |
| 236 | #endif |
| 237 | |
| 238 | #ifndef atomic_testandset_long |
nothing calls this directly
no test coverage detected