diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -527,11 +527,10 @@ } int -intr_event_destroy(struct intr_event *ie) +intr_event_destroy_(struct intr_event *ie) { - if (ie == NULL) - return (EINVAL); + MPASS(ie != NULL); mtx_lock(&event_lock); mtx_lock(&ie->ie_lock); @@ -550,6 +549,15 @@ return (0); } +int +intr_event_destroy(struct intr_event *ie) +{ + if (ie == NULL) + return (EINVAL); + + return (intr_event_destroy_(ie)); +} + static struct intr_thread * ithread_create(const char *name) { @@ -1334,7 +1342,7 @@ * o EINVAL: stray interrupt. */ int -intr_event_handle(struct intr_event *ie, struct trapframe *frame) +intr_event_handle_(struct intr_event *ie, struct trapframe *frame) { struct intr_handler *ih; struct trapframe *oldframe; @@ -1349,8 +1357,10 @@ intr_prof_stack_use(td, frame); #endif - /* An interrupt with no event or handlers is a stray interrupt. */ - if (ie == NULL || CK_SLIST_EMPTY(&ie->ie_handlers)) + MPASS(ie != NULL); + + /* An interrupt with no handlers is a stray interrupt. */ + if (CK_SLIST_EMPTY(&ie->ie_handlers)) return (EINVAL); /* @@ -1451,6 +1461,17 @@ return (0); } + +int +intr_event_handle(struct intr_event *ie, struct trapframe *frame) +{ + /* An interrupt with no event is a stray interrupt. */ + if (ie == NULL) + return (EINVAL); + + return (intr_event_handle_(ie, frame)); +} + #ifdef DDB /* * Dump details about an interrupt handler diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h --- a/sys/sys/interrupt.h +++ b/sys/sys/interrupt.h @@ -181,7 +181,9 @@ __printflike(9, 10); int intr_event_describe_handler(struct intr_event *ie, void *cookie, const char *descr); +int intr_event_destroy_(struct intr_event *ie); int intr_event_destroy(struct intr_event *ie); +int intr_event_handle_(struct intr_event *ie, struct trapframe *frame); int intr_event_handle(struct intr_event *ie, struct trapframe *frame); int intr_event_remove_handler(void *cookie); int intr_event_suspend_handler(void *cookie); diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -344,7 +344,7 @@ * For stray interrupts, mask and EOI the source, bump the * stray count, and log the condition. */ - if (intr_event_handle(ie, frame) != 0) { + if (intr_event_handle_(ie, frame) != 0) { isrc->is_pic->pic_disable_source(isrc, PIC_EOI); (*isrc->is_straycount)++; if (*isrc->is_straycount < INTR_STRAY_LOG_MAX)