Lines Matching refs:pt

334 	struct pt_ttys *pt = NULL;  in pt_ttys_alloc()  local
382 pt = kmem_cache_alloc(ptms_cache, KM_NOSLEEP); in pt_ttys_alloc()
383 if (pt == NULL) { in pt_ttys_alloc()
388 pt->pt_minor = dminor; in pt_ttys_alloc()
389 pt->pt_pid = curproc->p_pid; /* For debugging */ in pt_ttys_alloc()
390 pt->pt_state = (PTMOPEN | PTLOCK); in pt_ttys_alloc()
391 pt->pt_zoneid = getzoneid(); in pt_ttys_alloc()
392 pt->pt_ruid = 0; /* we don't know uid/gid yet. Report as root */ in pt_ttys_alloc()
393 pt->pt_rgid = 0; in pt_ttys_alloc()
395 ptms_slots[dminor - 1] = pt; in pt_ttys_alloc()
399 return (pt); in pt_ttys_alloc()
409 struct pt_ttys *pt = NULL; in ptms_minor2ptty() local
413 pt = ptms_slots[dminor - 1]; in ptms_minor2ptty()
415 return (pt); in ptms_minor2ptty()
425 struct pt_ttys *pt; in ptms_set_owner() local
441 pt = ptms_minor2ptty(dminor); in ptms_set_owner()
442 if (pt != NULL && pt->pt_zoneid == getzoneid()) { in ptms_set_owner()
443 pt->pt_ruid = ruid; in ptms_set_owner()
444 pt->pt_rgid = rgid; in ptms_set_owner()
460 struct pt_ttys *pt; in ptms_minor_valid() local
481 pt = ptms_minor2ptty(dminor); in ptms_minor_valid()
482 if (pt != NULL) { in ptms_minor_valid()
483 ASSERT(pt->pt_ruid >= 0); in ptms_minor_valid()
484 ASSERT(pt->pt_rgid >= 0); in ptms_minor_valid()
485 if (pt->pt_zoneid == getzoneid()) { in ptms_minor_valid()
487 *ruid = pt->pt_ruid; in ptms_minor_valid()
488 *rgid = pt->pt_rgid; in ptms_minor_valid()
519 ptms_close(struct pt_ttys *pt, uint_t flags_to_clear) in ptms_close() argument
524 ASSERT(pt != NULL); in ptms_close()
528 mutex_enter(&pt->pt_lock); in ptms_close()
529 pt->pt_state &= ~flags_to_clear; in ptms_close()
530 flags = pt->pt_state; in ptms_close()
531 mutex_exit(&pt->pt_lock); in ptms_close()
536 ASSERT(pt->ptm_rdq == NULL); in ptms_close()
537 ASSERT(pt->pts_rdq == NULL); in ptms_close()
538 ASSERT(pt->pt_nullmsg == NULL); in ptms_close()
539 ASSERT(pt->pt_refcnt == 0); in ptms_close()
540 ASSERT(pt->pt_minor <= ptms_nslots); in ptms_close()
541 ASSERT(ptms_slots[pt->pt_minor - 1] == pt); in ptms_close()
546 pt->pt_pid = 0; in ptms_close()
548 ptms_slots[pt->pt_minor - 1] = NULL; in ptms_close()
550 vmem_free(ptms_minor_arena, (void *)(uintptr_t)pt->pt_minor, 1); in ptms_close()
552 kmem_cache_free(ptms_cache, pt); in ptms_close()
606 struct pt_ttys *pt = maddr; in ptms_constructor() local
608 pt->pts_rdq = NULL; in ptms_constructor()
609 pt->ptm_rdq = NULL; in ptms_constructor()
610 pt->pt_nullmsg = NULL; in ptms_constructor()
611 pt->pt_pid = NULL; in ptms_constructor()
612 pt->pt_minor = NULL; in ptms_constructor()
613 pt->pt_refcnt = 0; in ptms_constructor()
614 pt->pt_state = 0; in ptms_constructor()
615 pt->pt_zoneid = GLOBAL_ZONEID; in ptms_constructor()
617 cv_init(&pt->pt_cv, NULL, CV_DEFAULT, NULL); in ptms_constructor()
618 mutex_init(&pt->pt_lock, NULL, MUTEX_DEFAULT, NULL); in ptms_constructor()
626 struct pt_ttys *pt = maddr; in ptms_destructor() local
628 ASSERT(pt->pt_refcnt == 0); in ptms_destructor()
629 ASSERT(pt->pt_state == 0); in ptms_destructor()
630 ASSERT(pt->ptm_rdq == NULL); in ptms_destructor()
631 ASSERT(pt->pts_rdq == NULL); in ptms_destructor()
633 mutex_destroy(&pt->pt_lock); in ptms_destructor()
634 cv_destroy(&pt->pt_cv); in ptms_destructor()