diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index da290ec2192b7..16251561002c2 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -635,14 +635,10 @@ intr_isrc_post_filter(void *arg) PIC_POST_FILTER(isrc->isrc_dev, isrc); } -/* - * Interrupt source assign_cpu method for MI interrupt framework. - */ -static int -intr_isrc_assign_cpu(void *arg, int cpu) +int +intr_assign_irq(struct intr_irqsrc *isrc, int cpu, bool do_assignment) { #ifdef SMP - struct intr_irqsrc *isrc = arg; int error; mtx_lock(&isrc_table_lock); @@ -660,7 +656,7 @@ intr_isrc_assign_cpu(void *arg, int cpu) * PIC is expected to change isrc_cpu appropriately to keep us well * informed if the call is successful. */ - if (irq_assign_cpu) { + if (do_assignment) { error = PIC_BIND_INTR(isrc->isrc_dev, isrc); if (error) { CPU_ZERO(&isrc->isrc_cpu); @@ -675,6 +671,17 @@ intr_isrc_assign_cpu(void *arg, int cpu) #endif } +/* + * Interrupt source assign_cpu method for MI interrupt framework. + */ +static int +intr_isrc_assign_cpu(void *arg, int cpu) +{ + struct intr_irqsrc *isrc = arg; + + return (intr_assign_irq(isrc, cpu, irq_assign_cpu)); +} + /* * Create interrupt event for interrupt source. */ diff --git a/sys/sys/intr.h b/sys/sys/intr.h index 5b092b3447383..b3717f86df785 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -103,6 +103,7 @@ int intr_isrc_deregister(struct intr_irqsrc *); int intr_isrc_register(struct intr_irqsrc *, device_t, u_int, const char *, ...) __printflike(4, 5); +int intr_assign_irq(struct intr_irqsrc *isrc, int cpu, bool do_assignment); int intr_add_handler(struct intr_irqsrc *, const char *, driver_filter_t, driver_intr_t, void *, enum intr_type, void **); int intr_describe(struct intr_irqsrc *isrc, void *cookie, const char *descr);