| 529 | } |
| 530 | |
| 531 | static struct intr_thread * |
| 532 | ithread_create(const char *name) |
| 533 | { |
| 534 | struct intr_thread *ithd; |
| 535 | struct thread *td; |
| 536 | int error; |
| 537 | |
| 538 | ithd = malloc(sizeof(struct intr_thread), M_ITHREAD, M_WAITOK | M_ZERO); |
| 539 | |
| 540 | error = kproc_kthread_add(ithread_loop, ithd, &intrproc, |
| 541 | &td, RFSTOPPED | RFHIGHPID, |
| 542 | 0, "intr", "%s", name); |
| 543 | if (error) |
| 544 | panic("kproc_create() failed with %d", error); |
| 545 | thread_lock(td); |
| 546 | sched_class(td, PRI_ITHD); |
| 547 | TD_SET_IWAIT(td); |
| 548 | thread_unlock(td); |
| 549 | td->td_pflags |= TDP_ITHREAD; |
| 550 | ithd->it_thread = td; |
| 551 | CTR2(KTR_INTR, "%s: created %s", __func__, name); |
| 552 | return (ithd); |
| 553 | } |
| 554 | |
| 555 | static void |
| 556 | ithread_destroy(struct intr_thread *ithread) |
no test coverage detected