From 79918c45a6cb0f1be2a1f4a98b4db650b3e3ec66 Mon Sep 17 00:00:00 2001 From: jhb Date: Sat, 5 Apr 2008 19:58:30 +0000 Subject: Add a MI intr_event_handle() routine for the non-INTR_FILTER case. This allows all the INTR_FILTER #ifdef's to be removed from the MD interrupt code. - Rename the intr_event 'eoi', 'disable', and 'enable' hooks to 'post_filter', 'pre_ithread', and 'post_ithread' to be less x86-centric. Also, add a comment describe what the MI code expects them to do. - On amd64, i386, and powerpc this is effectively a NOP. - On arm, don't bother masking the interrupt unless the ithread is scheduled in the non-INTR_FILTER case to match what INTR_FILTER did. Also, don't bother unmasking the interrupt in the post_filter case if we never masked it. The INTR_FILTER case had been doing this by having arm_unmask_irq for the post_filter (formerly 'eoi') hook. - On ia64, stray interrupts are now masked for the non-INTR_FILTER case. They were already masked in the INTR_FILTER case. - On sparc64, use the a NULL pre_ithread hook and use intr_enable_eoi() for both the 'post_filter' and 'post_ithread' hooks to match what the non-INTR_FILTER code did. - On sun4v, retire the ithread wrapper hack by using an appropriate 'post_ithread' hook instead (it's what 'post_ithread'/'enable' was designed to do even in 5.x). Glanced at by: piso Reviewed by: marius Requested by: marius [1], [5] Tested on: amd64, i386, arm, sparc64 --- sys/ia64/ia64/interrupt.c | 50 ++++------------------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index 720e5f9..c0e4ae3 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -385,10 +385,6 @@ ia64_dispatch_intr(void *frame, u_int vector) { struct ia64_intr *i; struct intr_event *ie; /* our interrupt event */ -#ifndef INTR_FILTER - struct intr_handler *ih; - int error, thread, ret; -#endif /* * Find the interrupt thread for this vector. @@ -401,52 +397,14 @@ ia64_dispatch_intr(void *frame, u_int vector) ie = i->event; KASSERT(ie != NULL, ("%s: interrupt without event", __func__)); -#ifdef INTR_FILTER if (intr_event_handle(ie, frame) != 0) { - ia64_intr_mask((void *)(uintptr_t)vector); - log(LOG_ERR, "stray irq%u\n", i->irq); - } -#else - /* - * As an optimization, if an event has no handlers, don't - * schedule it to run. - */ - if (TAILQ_EMPTY(&ie->ie_handlers)) - return; - - /* - * Execute all fast interrupt handlers directly without Giant. Note - * that this means that any fast interrupt handler must be MP safe. - */ - ret = 0; - thread = 0; - critical_enter(); - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - thread = 1; - continue; - } - CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_filter, ih->ih_argument, ih->ih_name); - ret = ih->ih_filter(ih->ih_argument); /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() + * XXX: The pre-INTR_FILTER code didn't mask stray + * interrupts. */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - if (thread) { ia64_intr_mask((void *)(uintptr_t)vector); - error = intr_event_schedule_thread(ie); - KASSERT(error == 0, ("%s: impossible stray", __func__)); - } else - ia64_intr_eoi((void *)(uintptr_t)vector); - critical_exit(); -#endif + log(LOG_ERR, "stray irq%u\n", i->irq); + } } #ifdef DDB -- cgit v1.1