Lines Matching refs:ih
215 struct intr_handler *ih; in intr_event_update() local
227 CK_SLIST_FOREACH(ih, &ie->ie_handlers, ih_next) { in intr_event_update()
228 if (strlen(ie->ie_fullname) + strlen(ih->ih_name) + 1 < in intr_event_update()
231 strcat(ie->ie_fullname, ih->ih_name); in intr_event_update()
235 flags |= ih->ih_flags; in intr_event_update()
247 ih = CK_SLIST_FIRST(&ie->ie_handlers); in intr_event_update()
248 missed = strlen(ie->ie_fullname) + strlen(ih->ih_name) + 2 - in intr_event_update()
251 strcat(ie->ie_fullname, &ih->ih_name[missed]); in intr_event_update()
606 struct intr_handler *ih, *temp_ih; in intr_event_add_handler() local
620 ih = malloc(sizeof(struct intr_handler), M_ITHREAD, M_WAITOK | M_ZERO); in intr_event_add_handler()
621 ih->ih_filter = filter; in intr_event_add_handler()
622 ih->ih_handler = handler; in intr_event_add_handler()
623 ih->ih_argument = arg; in intr_event_add_handler()
624 strlcpy(ih->ih_name, name, sizeof(ih->ih_name)); in intr_event_add_handler()
625 ih->ih_event = ie; in intr_event_add_handler()
626 ih->ih_pri = pri; in intr_event_add_handler()
628 ih->ih_flags = IH_EXCLUSIVE; in intr_event_add_handler()
630 ih->ih_flags |= IH_MPSAFE; in intr_event_add_handler()
632 ih->ih_flags |= IH_ENTROPY; in intr_event_add_handler()
634 ih->ih_flags |= IH_NET; in intr_event_add_handler()
642 free(ih, M_ITHREAD); in intr_event_add_handler()
668 if (temp_ih->ih_pri > ih->ih_pri) in intr_event_add_handler()
671 CK_SLIST_INSERT_PREVPTR(prevptr, temp_ih, ih, ih_next); in intr_event_add_handler()
675 CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name, in intr_event_add_handler()
680 *cookiep = ih; in intr_event_add_handler()
692 struct intr_handler *ih; in intr_event_describe_handler() local
698 CK_SLIST_FOREACH(ih, &ie->ie_handlers, ih_next) { in intr_event_describe_handler()
699 if (ih == cookie) in intr_event_describe_handler()
702 if (ih == NULL) { in intr_event_describe_handler()
707 ih = cookie; in intr_event_describe_handler()
716 start = strchr(ih->ih_name, ':'); in intr_event_describe_handler()
718 start = strchr(ih->ih_name, 0); in intr_event_describe_handler()
725 space = sizeof(ih->ih_name) - (start - ih->ih_name) - 1; in intr_event_describe_handler()
746 struct intr_handler *ih; in intr_handler_source() local
749 ih = (struct intr_handler *)cookie; in intr_handler_source()
750 if (ih == NULL) in intr_handler_source()
752 ie = ih->ih_event; in intr_handler_source()
755 ih->ih_name)); in intr_handler_source()
864 struct intr_handler *ih; in intr_event_remove_handler() local
877 CK_SLIST_FOREACH_PREVPTR(ih, prevptr, &ie->ie_handlers, ih_next) { in intr_event_remove_handler()
878 if (ih == handler) in intr_event_remove_handler()
881 if (ih == NULL) { in intr_event_remove_handler()
894 CK_SLIST_REMOVE_PREVPTR(prevptr, ih, ih_next); in intr_event_remove_handler()
1077 struct intr_handler *ih = (struct intr_handler *)cookie; in swi_sched() local
1078 struct intr_event *ie = ih->ih_event; in swi_sched()
1082 CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name, in swi_sched()
1083 ih->ih_need); in swi_sched()
1086 entropy.event = (uintptr_t)ih; in swi_sched()
1096 ih->ih_need = 1; in swi_sched()
1130 struct intr_handler *ih, *ihn, *ihp; in intr_event_execute_handlers() local
1133 CK_SLIST_FOREACH_SAFE(ih, &ie->ie_handlers, ih_next, ihn) { in intr_event_execute_handlers()
1138 if (ih->ih_flags & IH_DEAD) { in intr_event_execute_handlers()
1144 ih->ih_flags &= ~IH_DEAD; in intr_event_execute_handlers()
1145 wakeup(ih); in intr_event_execute_handlers()
1154 ihp = ih; in intr_event_execute_handlers()
1156 if ((ih->ih_flags & IH_CHANGED) != 0) { in intr_event_execute_handlers()
1158 ih->ih_flags &= ~IH_CHANGED; in intr_event_execute_handlers()
1159 wakeup(ih); in intr_event_execute_handlers()
1164 if (ih->ih_handler == NULL) in intr_event_execute_handlers()
1168 if ((ih->ih_flags & IH_SUSP) != 0) in intr_event_execute_handlers()
1181 atomic_cmpset_int(&ih->ih_need, 1, 0) == 0) in intr_event_execute_handlers()
1186 __func__, p->p_pid, (void *)ih->ih_handler, in intr_event_execute_handlers()
1187 ih->ih_argument, ih->ih_name, ih->ih_flags); in intr_event_execute_handlers()
1189 if (!(ih->ih_flags & IH_MPSAFE)) in intr_event_execute_handlers()
1191 ih->ih_handler(ih->ih_argument); in intr_event_execute_handlers()
1192 if (!(ih->ih_flags & IH_MPSAFE)) in intr_event_execute_handlers()
1347 struct intr_handler *ih; in intr_event_handle() local
1384 CK_SLIST_FOREACH(ih, &ie->ie_handlers, ih_next) { in intr_event_handle()
1385 if ((ih->ih_flags & IH_SUSP) != 0) in intr_event_handle()
1387 if ((ie->ie_flags & IE_SOFT) != 0 && ih->ih_need == 0) in intr_event_handle()
1389 if (ih->ih_filter == NULL) { in intr_event_handle()
1394 ih->ih_filter, ih->ih_argument, ih->ih_name); in intr_event_handle()
1395 ret = ih->ih_filter(ih->ih_argument); in intr_event_handle()
1403 ih->ih_name)); in intr_event_handle()
1467 db_dump_intrhand(struct intr_handler *ih) in db_dump_intrhand() argument
1471 db_printf("\t%-10s ", ih->ih_name); in db_dump_intrhand()
1472 switch (ih->ih_pri) { in db_dump_intrhand()
1480 if (ih->ih_pri >= PI_SOFT) in db_dump_intrhand()
1483 db_printf("%4u", ih->ih_pri); in db_dump_intrhand()
1487 if (ih->ih_filter != NULL) { in db_dump_intrhand()
1489 db_printsym((uintptr_t)ih->ih_filter, DB_STGY_PROC); in db_dump_intrhand()
1491 if (ih->ih_handler != NULL) { in db_dump_intrhand()
1492 if (ih->ih_filter != NULL) in db_dump_intrhand()
1495 db_printsym((uintptr_t)ih->ih_handler, DB_STGY_PROC); in db_dump_intrhand()
1497 db_printf("(%p)", ih->ih_argument); in db_dump_intrhand()
1498 if (ih->ih_need || in db_dump_intrhand()
1499 (ih->ih_flags & (IH_EXCLUSIVE | IH_ENTROPY | IH_DEAD | in db_dump_intrhand()
1503 if (ih->ih_flags & IH_EXCLUSIVE) { in db_dump_intrhand()
1509 if (ih->ih_flags & IH_ENTROPY) { in db_dump_intrhand()
1515 if (ih->ih_flags & IH_DEAD) { in db_dump_intrhand()
1521 if (ih->ih_flags & IH_MPSAFE) { in db_dump_intrhand()
1527 if (ih->ih_need) { in db_dump_intrhand()
1543 struct intr_handler *ih; in db_dump_intr_event() local
1577 CK_SLIST_FOREACH(ih, &ie->ie_handlers, ih_next) in db_dump_intr_event()
1578 db_dump_intrhand(ih); in db_dump_intr_event()