Lines Matching refs:ih

108 			      struct intr_handler *ih);
118 struct intr_handler *ih);
197 struct intr_handler *ih;
209 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
210 if (strlen(ie->ie_fullname) + strlen(ih->ih_name) + 1 <
213 strcat(ie->ie_fullname, ih->ih_name);
217 if (ih->ih_flags & IH_ENTROPY)
229 ih = TAILQ_FIRST(&ie->ie_handlers);
230 missed = strlen(ie->ie_fullname) + strlen(ih->ih_name) + 2 -
233 strcat(ie->ie_fullname, &ih->ih_name[missed]);
543 ithread_create(const char *name, struct intr_handler *ih)
551 error = kproc_kthread_add(ithread_loop, ih, &intrproc,
589 struct intr_handler *ih, *temp_ih;
596 ih = malloc(sizeof(struct intr_handler), M_ITHREAD, M_WAITOK | M_ZERO);
597 ih->ih_filter = filter;
598 ih->ih_handler = handler;
599 ih->ih_argument = arg;
600 strlcpy(ih->ih_name, name, sizeof(ih->ih_name));
601 ih->ih_event = ie;
602 ih->ih_pri = pri;
604 ih->ih_flags = IH_EXCLUSIVE;
606 ih->ih_flags |= IH_MPSAFE;
608 ih->ih_flags |= IH_ENTROPY;
616 free(ih, M_ITHREAD);
640 if (temp_ih->ih_pri > ih->ih_pri)
644 TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next);
646 TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next);
649 CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name,
654 *cookiep = ih;
663 struct intr_handler *ih, *temp_ih;
670 ih = malloc(sizeof(struct intr_handler), M_ITHREAD, M_WAITOK | M_ZERO);
671 ih->ih_filter = filter;
672 ih->ih_handler = handler;
673 ih->ih_argument = arg;
674 strlcpy(ih->ih_name, name, sizeof(ih->ih_name));
675 ih->ih_event = ie;
676 ih->ih_pri = pri;
678 ih->ih_flags = IH_EXCLUSIVE;
680 ih->ih_flags |= IH_MPSAFE;
682 ih->ih_flags |= IH_ENTROPY;
690 free(ih, M_ITHREAD);
698 it = ithread_create("intr: newborn", ih);
701 ih->ih_thread = it;
710 it = ithread_create("intr: newborn", ih);
723 if (temp_ih->ih_pri > ih->ih_pri)
727 TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next);
729 TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next);
732 CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name,
737 *cookiep = ih;
750 struct intr_handler *ih;
756 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
757 if (ih == cookie)
760 if (ih == NULL) {
765 ih = cookie;
774 start = strchr(ih->ih_name, ':');
776 start = strchr(ih->ih_name, 0);
783 space = sizeof(ih->ih_name) - (start - ih->ih_name) - 1;
804 struct intr_handler *ih;
807 ih = (struct intr_handler *)cookie;
808 if (ih == NULL)
810 ie = ih->ih_event;
813 ih->ih_name));
864 struct intr_handler *ih;
880 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next)
881 if (ih == handler)
885 ih->ih_name, ie->ie_name);
937 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
938 if (!(ih->ih_flags & IH_FAST)) {
1018 struct intr_handler *ih;
1034 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next)
1035 if (ih == handler)
1039 ih->ih_name, ie->ie_name);
1101 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
1223 struct intr_handler *ih = (struct intr_handler *)cookie;
1224 struct intr_event *ie = ih->ih_event;
1228 CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name,
1229 ih->ih_need);
1231 entropy.event = (uintptr_t)ih;
1240 ih->ih_need = 1;
1268 priv_ithread_execute_handler(struct proc *p, struct intr_handler *ih)
1272 ie = ih->ih_event;
1277 if (ih->ih_flags & IH_DEAD) {
1279 TAILQ_REMOVE(&ie->ie_handlers, ih, ih_next);
1280 ih->ih_flags &= ~IH_DEAD;
1281 wakeup(ih);
1288 __func__, p->p_pid, (void *)ih->ih_handler, ih->ih_argument,
1289 ih->ih_name, ih->ih_flags);
1291 if (!(ih->ih_flags & IH_MPSAFE))
1293 ih->ih_handler(ih->ih_argument);
1294 if (!(ih->ih_flags & IH_MPSAFE))
1306 struct intr_handler *ih, *ihn;
1308 TAILQ_FOREACH_SAFE(ih, &ie->ie_handlers, ih_next, ihn) {
1313 if (ih->ih_flags & IH_DEAD) {
1315 TAILQ_REMOVE(&ie->ie_handlers, ih, ih_next);
1316 ih->ih_flags &= ~IH_DEAD;
1317 wakeup(ih);
1323 if (ih->ih_handler == NULL)
1336 atomic_cmpset_int(&ih->ih_need, 1, 0) == 0)
1341 __func__, p->p_pid, (void *)ih->ih_handler,
1342 ih->ih_argument, ih->ih_name, ih->ih_flags);
1344 if (!(ih->ih_flags & IH_MPSAFE))
1346 ih->ih_handler(ih->ih_argument);
1347 if (!(ih->ih_flags & IH_MPSAFE))
1482 struct intr_handler *ih;
1509 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
1510 if (ih->ih_filter == NULL) {
1515 ih->ih_filter, ih->ih_argument == NULL ? frame :
1516 ih->ih_argument, ih->ih_name);
1517 if (ih->ih_argument == NULL)
1518 ret = ih->ih_filter(frame);
1520 ret = ih->ih_filter(ih->ih_argument);
1525 ih->ih_name));
1573 struct intr_handler *ih;
1582 ih = (struct intr_handler *)arg;
1583 priv = (ih->ih_thread != NULL) ? 1 : 0;
1584 ithd = (priv) ? ih->ih_thread : ih->ih_event->ie_thread;
1617 priv_ithread_execute_handler(p, ih);
1675 struct intr_handler *ih;
1681 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
1688 arg = ((ih->ih_argument == NULL) ? frame : ih->ih_argument);
1691 ih->ih_filter, ih->ih_handler, arg, ih->ih_name);
1693 if (ih->ih_filter != NULL)
1694 ret = ih->ih_filter(arg);
1703 ih->ih_name));
1707 *ithd = ih->ih_thread;
1787 db_dump_intrhand(struct intr_handler *ih)
1791 db_printf("\t%-10s ", ih->ih_name);
1792 switch (ih->ih_pri) {
1812 if (ih->ih_pri >= PI_SOFT)
1815 db_printf("%4u", ih->ih_pri);
1819 if (ih->ih_filter != NULL) {
1821 db_printsym((uintptr_t)ih->ih_filter, DB_STGY_PROC);
1823 if (ih->ih_handler != NULL) {
1824 if (ih->ih_filter != NULL)
1827 db_printsym((uintptr_t)ih->ih_handler, DB_STGY_PROC);
1829 db_printf("(%p)", ih->ih_argument);
1830 if (ih->ih_need ||
1831 (ih->ih_flags & (IH_EXCLUSIVE | IH_ENTROPY | IH_DEAD |
1835 if (ih->ih_flags & IH_EXCLUSIVE) {
1841 if (ih->ih_flags & IH_ENTROPY) {
1847 if (ih->ih_flags & IH_DEAD) {
1853 if (ih->ih_flags & IH_MPSAFE) {
1859 if (ih->ih_need) {
1875 struct intr_handler *ih;
1915 TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next)
1916 db_dump_intrhand(ih);