sched_ithd_intern(&intr_info_ary[mycpuid][intr]);
}
+#ifdef _KERNEL_VIRTUAL
+
+void
+sched_ithd_hard_virtual(int intr)
+{
+ KKASSERT(intr >= 0 && intr < MAX_HARDINTS);
+ sched_ithd_intern(&intr_info_ary[0][intr]);
+}
+
+void *
+register_int_virtual(int intr, inthand2_t *handler, void *arg, const char *name,
+ struct lwkt_serialize *serializer, int intr_flags)
+{
+ return register_int(intr, handler, arg, name, serializer, intr_flags, 0);
+}
+
+void
+unregister_int_virtual(void *id)
+{
+ unregister_int(id, 0);
+}
+
+#endif /* _KERN_VIRTUAL */
+
static void
report_stray_interrupt(struct intr_info *info, const char *func)
{
* We have to do this here rather then in early boot to be able
* to use the interrupt subsystem.
*/
- register_int(3, vconswinch_intr, NULL, "swinch", NULL, INTR_MPSAFE, 0);
+ register_int_virtual(3, vconswinch_intr, NULL, "swinch", NULL,
+ INTR_MPSAFE);
bzero(&sa, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_handler = vconswinchsig;
cotd->pintr = pthread_self();
- cotd->intr_id = register_int(1, (void *)thr_intr, cotd, name, NULL,
- INTR_MPSAFE, 0);
+ cotd->intr_id = register_int_virtual(1, (void *)thr_intr, cotd, name,
+ NULL, INTR_MPSAFE);
/*
* The vkernel's cpu_disable_intr() masks signals. We don't want
cothread_t cotd;
if ((cotd = *cotdp) != NULL) {
- unregister_int(cotd->intr_id, 0);
+ unregister_int_virtual(cotd->intr_id);
crit_enter();
pthread_join(cotd->pthr, NULL);
crit_exit();
struct kevent kev;
if (VIntr1 == NULL) {
- VIntr1 = register_int(1, kqueue_intr, NULL, "kqueue", NULL,
- INTR_MPSAFE, 0);
+ VIntr1 = register_int_virtual(1, kqueue_intr, NULL, "kqueue",
+ NULL, INTR_MPSAFE);
}
info = kmalloc(sizeof(*info), M_DEVBUF, M_ZERO|M_INTWAIT);
struct kqueue_info *info;
if (VIntr1 == NULL) {
- VIntr1 = register_int(1, kqueue_intr, NULL, "kqueue", NULL,
- 0, 0);
+ VIntr1 = register_int_virtual(1, kqueue_intr, NULL, "kqueue",
+ NULL, INTR_MPSAFE);
}
info = kmalloc(sizeof(*info), M_DEVBUF, M_ZERO|M_INTWAIT);
while ((irq = ffs(gd->gd_fpending)) != 0) {
--irq;
atomic_clear_int(&gd->gd_fpending, 1 << irq);
- sched_ithd_hard(irq);
+ sched_ithd_hard_virtual(irq);
}
}
crit_exit_noyield(td);
/*
* Allows an unprotected signal handler or mailbox to signal an interrupt
*
- * For sched_ithd_hard() to properly preempt via lwkt_schedule() we cannot
- * enter a critical section here. We use td_nest_count instead.
+ * For sched_ithd_hard_virtaul() to properly preempt via lwkt_schedule() we
+ * cannot enter a critical section here. We use td_nest_count instead.
*/
void
signalintr(int intr)
} else {
++td->td_nest_count;
atomic_clear_int(&gd->gd_fpending, 1 << intr);
- sched_ithd_hard(intr);
+ sched_ithd_hard_virtual(intr);
--td->td_nest_count;
}
}
sa.sa_handler = shutdownsig;
sigaction(SIGTERM, &sa, NULL);
- register_int(2, shutdown_intr, NULL, "shutdown", NULL, INTR_MPSAFE, 0);
+ register_int_virtual(2, shutdown_intr, NULL, "shutdown", NULL,
+ INTR_MPSAFE);
}
static
* We have to do this here rather then in early boot to be able
* to use the interrupt subsystem.
*/
- register_int(3, vconswinch_intr, NULL, "swinch", NULL, INTR_MPSAFE, 0);
+ register_int_virtual(3, vconswinch_intr, NULL, "swinch", NULL,
+ INTR_MPSAFE);
bzero(&sa, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_handler = vconswinchsig;
cotd->pintr = pthread_self();
- cotd->intr_id = register_int(1, (void *)thr_intr, cotd, name, NULL,
- INTR_MPSAFE, 0);
+ cotd->intr_id = register_int_virtual(1, (void *)thr_intr, cotd, name,
+ NULL, INTR_MPSAFE);
/*
* The vkernel's cpu_disable_intr() masks signals. We don't want
cothread_t cotd;
if ((cotd = *cotdp) != NULL) {
- unregister_int(cotd->intr_id, 0);
+ unregister_int_virtual(cotd->intr_id);
crit_enter();
pthread_join(cotd->pthr, NULL);
crit_exit();
struct kevent kev;
if (VIntr1 == NULL) {
- VIntr1 = register_int(1, kqueue_intr, NULL, "kqueue", NULL,
- INTR_MPSAFE, 0);
+ VIntr1 = register_int_virtual(1, kqueue_intr, NULL, "kqueue",
+ NULL, INTR_MPSAFE);
}
info = kmalloc(sizeof(*info), M_DEVBUF, M_ZERO|M_INTWAIT);
struct kqueue_info *info;
if (VIntr1 == NULL) {
- VIntr1 = register_int(1, kqueue_intr, NULL, "kqueue", NULL,
- INTR_MPSAFE, 0);
+ VIntr1 = register_int_virtual(1, kqueue_intr, NULL, "kqueue",
+ NULL, INTR_MPSAFE);
}
info = kmalloc(sizeof(*info), M_DEVBUF, M_ZERO|M_INTWAIT);
while ((irq = ffs(gd->gd_fpending)) != 0) {
--irq;
atomic_clear_int(&gd->gd_fpending, 1 << irq);
- sched_ithd_hard(irq);
+ sched_ithd_hard_virtual(irq);
}
}
crit_exit_noyield(td);
/*
* Allows an unprotected signal handler or mailbox to signal an interrupt
*
- * For sched_ithd_hard() to properly preempt via lwkt_schedule() we cannot
- * enter a critical section here. We use td_nest_count instead.
+ * For sched_ithd_hard_virtual() to properly preempt via lwkt_schedule() we
+ * cannot enter a critical section here. We use td_nest_count instead.
*/
void
signalintr(int intr)
} else {
++td->td_nest_count;
atomic_clear_int(&gd->gd_fpending, 1 << intr);
- sched_ithd_hard(intr);
+ sched_ithd_hard_virtual(intr);
--td->td_nest_count;
}
}
sa.sa_handler = shutdownsig;
sigaction(SIGTERM, &sa, NULL);
- register_int(2, shutdown_intr, NULL, "shutdown", NULL, INTR_MPSAFE, 0);
+ register_int_virtual(2, shutdown_intr, NULL, "shutdown", NULL,
+ INTR_MPSAFE);
}
static
void sched_ithd_soft(int intr); /* procedure called from MD */
void sched_ithd_hard(int intr); /* procedure called from MD */
+#ifdef _KERNEL_VIRTUAL
+void *register_int_virtual(int intr, inthand2_t *handler, void *arg,
+ const char *name, struct lwkt_serialize *serializer, int flags);
+void unregister_int_virtual(void *id);
+void sched_ithd_hard_virtual(int intr);
+#endif
+
extern char eintrnames[]; /* end of intrnames[] */
extern char intrnames[]; /* string table containing device names */