Lines Matching refs:sx_lock
217 x = sx->sx_lock;
239 ASSERT_ATOMIC_LOAD_PTR(sx->sx_lock,
240 ("%s: sx_lock not aligned for %s: %p", __func__, description,
241 &sx->sx_lock));
258 sx->sx_lock = SX_LOCK_UNLOCKED;
266 KASSERT(sx->sx_lock == SX_LOCK_UNLOCKED, ("sx lock still held"));
268 sx->sx_lock = SX_LOCK_DESTROYED;
284 x = sx->sx_lock;
290 if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, x + SX_ONE_SHARER)) {
322 KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
328 if (!atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid))
359 KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
366 if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid))
372 atomic_set_ptr(&sx->sx_lock, SX_LOCK_RECURSED);
403 KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
432 KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
447 if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x,
481 KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
502 x = sx->sx_lock;
504 atomic_cmpset_rel_ptr(&sx->sx_lock, x, SX_SHARERS_LOCK(1) |
518 x = sx->sx_lock;
519 atomic_store_rel_ptr(&sx->sx_lock, SX_SHARERS_LOCK(1) |
597 if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid))
624 atomic_set_ptr(&sx->sx_lock, SX_LOCK_RECURSED);
632 sx->lock_object.lo_name, (void *)sx->sx_lock, file, line);
654 if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid))
666 if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid))
706 if (!atomic_fcmpset_ptr(&sx->sx_lock, &x,
780 * woken up and acquired the lock yet, sx_lock will be
790 if (!atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid | setx))
810 if (!atomic_fcmpset_ptr(&sx->sx_lock, &x,
824 if (!atomic_fcmpset_ptr(&sx->sx_lock, &x,
933 atomic_clear_ptr(&sx->sx_lock, SX_LOCK_RECURSED);
941 atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED))
967 atomic_store_rel_ptr(&sx->sx_lock, setx);
1003 if (atomic_fcmpset_acq_ptr(&sx->sx_lock, xp,
1188 if (!atomic_fcmpset_ptr(&sx->sx_lock, &x,
1273 KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
1307 if (atomic_fcmpset_rel_ptr(&sx->sx_lock, xp,
1355 if (!atomic_fcmpset_rel_ptr(&sx->sx_lock, &x, setx))
1375 KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
1437 if (sx->sx_lock == SX_LOCK_UNLOCKED ||
1438 (!(sx->sx_lock & SX_LOCK_SHARED) && (slocked ||
1444 if (!(sx->sx_lock & SX_LOCK_SHARED)) {
1501 if (sx->sx_lock == SX_LOCK_UNLOCKED)
1503 else if (sx->sx_lock == SX_LOCK_DESTROYED) {
1506 } else if (sx->sx_lock & SX_LOCK_SHARED)
1507 db_printf("SLOCK: %ju\n", (uintmax_t)SX_SHARERS(sx->sx_lock));
1517 switch(sx->sx_lock &
1556 if (sx->sx_lock & SX_LOCK_SHARED)
1558 (uintmax_t)SX_SHARERS(sx->sx_lock));