From 3401f2c1dfdb11f0c83a8394c7c14b2c69cb1f63 Mon Sep 17 00:00:00 2001 From: Paolo Pisati Date: Thu, 31 May 2007 19:25:35 +0000 Subject: In some particular cases (like in pccard and pccbb), the real device handler is wrapped in a couple of functions - a filter wrapper and an ithread wrapper. In this case (and just in this case), the filter wrapper could ask the system to schedule the ithread and mask the interrupt source if the wrapped handler is composed of just an ithread handler: modify the "old" interrupt code to make it support this situation, while the "new" interrupt code is already ok. Discussed with: jhb --- sys/powerpc/powerpc/intr_machdep.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sys/powerpc') diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index f4931473bbb8..287df911232a 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -198,7 +198,7 @@ intr_handle(u_int irq) struct ppc_intr *i; struct intr_event *ie; struct intr_handler *ih; - int error, sched; + int error, sched, ret; i = ppc_intrs[irq]; if (i == NULL) @@ -216,6 +216,7 @@ intr_handle(u_int irq) * Execute all fast interrupt handlers directly without Giant. Note * that this means that any fast interrupt handler must be MP safe. */ + ret = 0; sched = 0; critical_enter(); TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { @@ -225,7 +226,15 @@ intr_handle(u_int irq) } CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, ih->ih_filter, ih->ih_argument, ih->ih_name); - ih->ih_filter(ih->ih_argument); + ret = ih->ih_filter(ih->ih_argument); + /* + * Wrapper handler special case: see + * i386/intr_machdep.c::intr_execute_handlers() + */ + if (!sched) { + if (ret == FILTER_SCHEDULE_THREAD) + sched = 1; + } } critical_exit(); -- cgit v1.3