Index: sys/kern/subr_intr.c =================================================================== --- sys/kern/subr_intr.c +++ sys/kern/subr_intr.c @@ -406,9 +406,21 @@ mtx_assert(&isrc_table_lock, MA_OWNED); + /* allocation requesting specific number */ + if ((isrc->isrc_flags & INTR_ISRCF_USE_IRQ) != 0) { + if (isrc->isrc_irq >= intr_nirq) + return (EINVAL); + else if (irq_sources[isrc->isrc_irq] != NULL) + return (EEXIST); + irq_sources[isrc->isrc_irq] = isrc; + return (0); + } + + /* table known full, don't bother */ if (irq_next_free >= intr_nirq) return (ENOSPC); + /* usual approach, look for an empty entry */ for (irq = irq_next_free; irq < intr_nirq; irq++) { if (irq_sources[irq] == NULL) goto found; @@ -472,7 +484,6 @@ bzero(isrc, sizeof(struct intr_irqsrc)); isrc->isrc_dev = dev; - isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */ isrc->isrc_flags = flags; va_start(ap, fmt); Index: sys/sys/intr.h =================================================================== --- sys/sys/intr.h +++ sys/sys/intr.h @@ -76,6 +76,7 @@ #define INTR_ISRCF_IPI 0x01 /* IPI interrupt */ #define INTR_ISRCF_PPI 0x02 /* PPI interrupt */ #define INTR_ISRCF_BOUND 0x04 /* bound to a CPU */ +#define INTR_ISRCF_USE_IRQ 0x80 /* use passed in ->isrc_irq value */ struct intr_pic;