Lines Matching defs:sip
743 selrecord(lwp_t *selector, struct selinfo *sip)
751 other = sip->sel_lwp;
757 KASSERT(sip->sel_cluster == sc);
767 sip->sel_lwp = selector;
768 SLIST_INSERT_HEAD(&selector->l_selwait, sip, sel_chain);
770 sip->sel_fdinfo = selector->l_selrec;
772 sip->sel_cluster = sc;
775 sip->sel_collision |= sc->sc_mask;
776 KASSERT(sip->sel_cluster != NULL);
786 selrecord_knote(struct selinfo *sip, struct knote *kn)
788 klist_insert(&sip->sel_klist, kn);
800 selremove_knote(struct selinfo *sip, struct knote *kn)
802 return klist_remove(&sip->sel_klist, kn);
810 sel_setevents(lwp_t *l, struct selinfo *sip, const int events)
831 const int fd = sip->sel_fdinfo, fbit = 1 << (fd & __NFDMASK);
846 struct pollfd *pfd = (void *)sip->sel_fdinfo;
873 * sip->sel_cluser cannot change at this point, as it is only changed
878 selnotify(struct selinfo *sip, int events, long knhint)
886 KNOTE(&sip->sel_klist, knhint);
888 if (sip->sel_lwp != NULL) {
890 sc = sip->sel_cluster;
894 if (sip->sel_lwp != NULL) {
899 l = sip->sel_lwp;
904 } else if (!sel_setevents(l, sip, events)) {
923 if ((mask = sip->sel_collision) != 0) {
928 sip->sel_collision = 0;
954 struct selinfo *sip, *next;
973 for (sip = SLIST_FIRST(&l->l_selwait); sip != NULL; sip = next) {
974 KASSERT(sip->sel_lwp == l);
975 KASSERT(sip->sel_cluster == l->l_selcluster);
979 * It's no longer safe to touch `sip' after clearing
984 next = SLIST_NEXT(sip, sel_chain);
986 atomic_store_release(&sip->sel_lwp, NULL);
1021 selinit(struct selinfo *sip)
1024 memset(sip, 0, sizeof(*sip));
1025 klist_init(&sip->sel_klist);
1039 seldestroy(struct selinfo *sip)
1045 klist_fini(&sip->sel_klist);
1047 if (sip->sel_lwp == NULL)
1056 KASSERT(sip->sel_cluster != NULL);
1057 sc = sip->sel_cluster;
1060 if ((l = sip->sel_lwp) != NULL) {
1066 SLIST_REMOVE(&l->l_selwait, sip, selinfo, sel_chain);
1067 sip->sel_lwp = NULL;