Lines Matching defs:sq

147 	syncq_t		*sq;
174 sq = qp->q_syncq;
175 ASSERT(sq != NULL);
176 ASSERT(MUTEX_NOT_HELD(SQLOCK(sq)));
179 if (sq->sq_ciputctrl != NULL) {
181 ASSERT(sq->sq_flags & SQ_CIPUT);
182 ix = CPU->cpu_seqid & sq->sq_nciputctrl;
183 sqciplock = &sq->sq_ciputctrl[ix].ciputctrl_lock;
184 sqcipcount = &sq->sq_ciputctrl[ix].ciputctrl_count;
187 (sq->sq_flags & (SQ_STAYAWAY|SQ_EXCL|SQ_EVENTS))) {
200 mutex_enter(SQLOCK(sq));
202 flags = sq->sq_flags;
207 sq->sq_count++;
208 ASSERT(sq->sq_count != 0); /* Wraparound */
219 (sq->sq_needexcl != 0) || PUT_STACK_NOTENOUGH()) {
223 qp, mp, sq);
230 mutex_exit(SQLOCK(sq));
232 qfill_syncq(sq, qp, mp);
235 * closed, both qp and sq should not be referenced at
255 ASSERT((sq->sq_flags & SQ_EXCL) == 0);
256 ASSERT(!(sq->sq_type & SQ_CIPUT));
257 sq->sq_flags |= SQ_EXCL;
259 mutex_exit(SQLOCK(sq));
262 ASSERT((sq->sq_flags & (SQ_EXCL|SQ_CIPUT)));
263 ASSERT(MUTEX_NOT_HELD(SQLOCK(sq)));
275 ASSERT(MUTEX_NOT_HELD(SQLOCK(sq)));
288 ASSERT(MUTEX_NOT_HELD(SQLOCK(sq)));
314 qdrain_syncq(sq, qp);
324 if (sq->sq_flags & (SQ_EXCL)) {
332 flags = sq->sq_flags;
335 if ((flags & (SQ_EXCL|SQ_TAIL)) || sq->sq_needexcl) {
350 if (mutex_tryenter(SQLOCK(sq)) == 0) {
352 mutex_enter(SQLOCK(sq));
355 flags = sq->sq_flags;
364 "putnext_end:(%p, %p, %p) done", qp, mp, sq);
368 mutex_enter(SQLOCK(sq));
369 flags = sq->sq_flags;
370 ASSERT(sq->sq_count != 0);
371 sq->sq_count--;
373 if ((flags & (SQ_TAIL)) || sq->sq_needexcl) {
374 putnext_tail(sq, qp, (flags & ~drain_mask));
379 ASSERT(sq != NULL);
382 ASSERT((sq->sq_flags & (SQ_EXCL|SQ_CIPUT)) || queued);
395 * sq->sq_count == 0);
408 sq->sq_flags = flags & ~SQ_EXCL;
409 mutex_exit(SQLOCK(sq));
411 "putnext_end:(%p, %p, %p) done", qp, mp, sq);
429 syncq_t *sq;
444 sq = qp->q_syncq;
445 ASSERT(sq != NULL);
448 if (UseFastlocks && sq->sq_ciputctrl != NULL) {
450 ASSERT(sq->sq_flags & SQ_CIPUT);
451 ix = CPU->cpu_seqid & sq->sq_nciputctrl;
452 sqciplock = &sq->sq_ciputctrl[ix].ciputctrl_lock;
453 sqcipcount = &sq->sq_ciputctrl[ix].ciputctrl_count;
456 (sq->sq_flags & (SQ_STAYAWAY|SQ_EXCL|SQ_EVENTS))) {
468 mutex_enter(SQLOCK(sq));
469 flags = sq->sq_flags;
474 sq->sq_count++;
475 ASSERT(sq->sq_count != 0); /* Wraparound */
486 (sq->sq_needexcl != 0) || PUT_STACK_NOTENOUGH()) {
490 qp, mp, sq);
497 mutex_exit(SQLOCK(sq));
499 qfill_syncq(sq, qp, mp);
502 * closed, both qp and sq should not be referenced at
522 ASSERT((sq->sq_flags & SQ_EXCL) == 0);
523 ASSERT(!(sq->sq_type & SQ_CIPUT));
524 sq->sq_flags |= SQ_EXCL;
526 mutex_exit(SQLOCK(sq));
529 ASSERT((sq->sq_flags & (SQ_EXCL|SQ_CIPUT)));
530 ASSERT(MUTEX_NOT_HELD(SQLOCK(sq)));
542 ASSERT(MUTEX_NOT_HELD(SQLOCK(sq)));
555 ASSERT(MUTEX_NOT_HELD(SQLOCK(sq)));
581 qdrain_syncq(sq, qp);
591 if (sq->sq_flags & (SQ_EXCL)) {
599 flags = sq->sq_flags;
602 if ((flags & (SQ_EXCL|SQ_TAIL)) || sq->sq_needexcl) {
617 if (mutex_tryenter(SQLOCK(sq)) == 0) {
619 mutex_enter(SQLOCK(sq));
622 flags = sq->sq_flags;
631 "putnext_end:(%p, %p, %p) done", qp, mp, sq);
635 mutex_enter(SQLOCK(sq));
636 flags = sq->sq_flags;
637 ASSERT(sq->sq_count != 0);
638 sq->sq_count--;
640 if ((flags & (SQ_TAIL)) || sq->sq_needexcl) {
641 putnext_tail(sq, qp, (flags & ~drain_mask));
646 ASSERT(sq != NULL);
649 ASSERT((sq->sq_flags & (SQ_EXCL|SQ_CIPUT)) || queued);
662 * sq->sq_count == 0);
675 sq->sq_flags = flags & ~SQ_EXCL;
676 mutex_exit(SQLOCK(sq));
678 "putnext_end:(%p, %p, %p) done", qp, mp, sq);