diff --git a/sys/arm/mv/gpio.c b/sys/arm/mv/gpio.c --- a/sys/arm/mv/gpio.c +++ b/sys/arm/mv/gpio.c @@ -529,9 +529,6 @@ MV_GPIO_ASSERT_LOCKED(); -#ifdef INTR_SOLO - isrc.isrc_filter = NULL; -#endif isrc.isrc_event = sc->gpio_events[pin]; if (isrc.isrc_event == NULL || diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -98,7 +98,7 @@ /* Root interrupt controller stuff. */ device_t intr_irq_root_dev; -static intr_irq_filter_t *irq_root_filter; +static driver_filter_t *irq_root_filter; static void *irq_root_arg; static u_int irq_root_ipicount; @@ -397,15 +397,6 @@ isrc_increment_count(isrc); -#ifdef INTR_SOLO - if (isrc->isrc_filter != NULL) { - int error; - error = isrc->isrc_filter(isrc->isrc_arg, tf); - PIC_POST_FILTER(isrc->isrc_dev, isrc); - if (error == FILTER_HANDLED) - return (0); - } else -#endif if (intr_event_handle(isrc->isrc_event, tf) == 0) return (0); @@ -573,37 +564,6 @@ } #endif -#ifdef INTR_SOLO -/* - * Setup filter into interrupt source. - */ -static int -iscr_setup_filter(struct intr_irqsrc *isrc, const char *name, - intr_irq_filter_t *filter, void *arg, void **cookiep) -{ - - if (filter == NULL) - return (EINVAL); - - mtx_lock(&isrc_table_lock); - /* - * Make sure that we do not mix the two ways - * how we handle interrupt sources. - */ - if (isrc->isrc_filter != NULL || isrc->isrc_event != NULL) { - mtx_unlock(&isrc_table_lock); - return (EBUSY); - } - isrc->isrc_filter = filter; - isrc->isrc_arg = arg; - isrc_update_name(isrc, name); - mtx_unlock(&isrc_table_lock); - - *cookiep = isrc; - return (0); -} -#endif - /* * Interrupt source pre_ithread method for MI interrupt framework. */ @@ -696,23 +656,15 @@ return (error); mtx_lock(&isrc_table_lock); - /* - * Make sure that we do not mix the two ways - * how we handle interrupt sources. Let contested event wins. - */ -#ifdef INTR_SOLO - if (isrc->isrc_filter != NULL || isrc->isrc_event != NULL) { -#else - if (isrc->isrc_event != NULL) { -#endif - mtx_unlock(&isrc_table_lock); - intr_event_destroy(ie); - return (isrc->isrc_event != NULL ? EBUSY : 0); - } - isrc->isrc_event = ie; + if (isrc->isrc_event == NULL) { + /* We may or may not have entered a race and won. */ + isrc->isrc_event = ie; + ie = NULL; + } /* else { + ** We entered a race and lost. An event was successfully added. } */ mtx_unlock(&isrc_table_lock); - return (0); + return (intr_event_destroy(ie)); } #ifdef notyet /* @@ -893,7 +845,7 @@ * an interrupts property and thus no explicit interrupt parent." */ int -intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, +intr_pic_claim_root(device_t dev, intptr_t xref, driver_filter_t *filter, void *arg, u_int ipicount) { struct intr_pic *pic; @@ -1096,34 +1048,8 @@ data = rman_get_virtual(res); name = device_get_nameunit(dev); -#ifdef INTR_SOLO - /* - * Standard handling is done through MI interrupt framework. However, - * some interrupts could request solely own special handling. This - * non standard handling can be used for interrupt controllers without - * handler (filter only), so in case that interrupt controllers are - * chained, MI interrupt framework is called only in leaf controller. - * - * Note that root interrupt controller routine is served as well, - * however in intr_irq_handler(), i.e. main system dispatch routine. - */ - if (flags & INTR_SOLO && hand != NULL) { - debugf("irq %u cannot solo on %s\n", irq, name); - return (EINVAL); - } - - if (flags & INTR_SOLO) { - error = iscr_setup_filter(isrc, name, (intr_irq_filter_t *)filt, - arg, cookiep); - debugf("irq %u setup filter error %d on %s\n", isrc->isrc_irq, error, - name); - } else -#endif - { - error = isrc_add_handler(isrc, name, filt, hand, arg, flags, - cookiep); - debugf("irq %u add handler error %d on %s\n", isrc->isrc_irq, error, name); - } + error = isrc_add_handler(isrc, name, filt, hand, arg, flags, cookiep); + debugf("irq %u add handler error %d on %s\n", isrc->isrc_irq, error, name); if (error != 0) return (error); @@ -1158,22 +1084,6 @@ data = rman_get_virtual(res); -#ifdef INTR_SOLO - if (isrc->isrc_filter != NULL) { - if (isrc != cookie) - return (EINVAL); - - mtx_lock(&isrc_table_lock); - isrc->isrc_filter = NULL; - isrc->isrc_arg = NULL; - isrc->isrc_handlers = 0; - PIC_DISABLE_INTR(isrc->isrc_dev, isrc); - PIC_TEARDOWN_INTR(isrc->isrc_dev, isrc, res, data); - isrc_update_name(isrc, NULL); - mtx_unlock(&isrc_table_lock); - return (0); - } -#endif if (isrc != intr_handler_source(cookie)) return (EINVAL); @@ -1205,17 +1115,7 @@ isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); -#ifdef INTR_SOLO - if (isrc->isrc_filter != NULL) { - if (isrc != cookie) - return (EINVAL); - mtx_lock(&isrc_table_lock); - isrc_update_name(isrc, descr); - mtx_unlock(&isrc_table_lock); - return (0); - } -#endif error = intr_event_describe_handler(isrc->isrc_event, cookie, descr); if (error == 0) { mtx_lock(&isrc_table_lock); @@ -1239,10 +1139,6 @@ isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); -#ifdef INTR_SOLO - if (isrc->isrc_filter != NULL) - return (intr_isrc_assign_cpu(isrc, cpu)); -#endif return (intr_event_bind(isrc->isrc_event, cpu)); } diff --git a/sys/sys/intr.h b/sys/sys/intr.h --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -71,12 +71,6 @@ interrupt_t *isrc; }; -#ifdef notyet -#define INTR_SOLO INTR_MD1 -typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); -#else -typedef int intr_irq_filter_t(void *arg); -#endif typedef int intr_child_irq_filter_t(void *arg, uintptr_t irq); #define INTR_ISRC_NAMELEN (MAXCOMLEN + 1) @@ -98,10 +92,6 @@ u_long * isrc_count; u_int isrc_handlers; struct intr_event * isrc_event; -#ifdef INTR_SOLO - intr_irq_filter_t * isrc_filter; - void * isrc_arg; -#endif /* Used by MSI interrupts to store the iommu details */ void * isrc_iommu; }; @@ -120,7 +110,7 @@ struct intr_pic *intr_pic_register(device_t, intptr_t); int intr_pic_deregister(device_t, intptr_t); -int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); +int intr_pic_claim_root(device_t, intptr_t, driver_filter_t *, void *, u_int); int intr_pic_add_handler(device_t, struct intr_pic *, intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); bool intr_is_per_cpu(struct resource *);