diff options
author | jhb <jhb@FreeBSD.org> | 2008-04-05 19:58:30 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-04-05 19:58:30 +0000 |
commit | 79918c45a6cb0f1be2a1f4a98b4db650b3e3ec66 (patch) | |
tree | 3473dbfbaef8cf04d0d7e8cc250d98a1d866650b /sys/arm | |
parent | bcf7984652af778a74311520173661bcd19d3326 (diff) | |
download | FreeBSD-src-79918c45a6cb0f1be2a1f4a98b4db650b3e3ec66.zip FreeBSD-src-79918c45a6cb0f1be2a1f4a98b4db650b3e3ec66.tar.gz |
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
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/intr.c | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/sys/arm/arm/intr.c b/sys/arm/arm/intr.c index ecc9770..5fbdce7 100644 --- a/sys/arm/arm/intr.c +++ b/sys/arm/arm/intr.c @@ -72,7 +72,7 @@ arm_setup_irqhandler(const char *name, driver_filter_t *filt, if (event == NULL) { error = intr_event_create(&event, (void *)irq, 0, (mask_fn)arm_mask_irq, (mask_fn)arm_unmask_irq, - (mask_fn)arm_unmask_irq, NULL, "intr%d:", irq); + NULL, NULL, "intr%d:", irq); if (error) return; intr_events[irq] = event; @@ -106,57 +106,17 @@ arm_handler_execute(struct trapframe *frame, int irqnb) { struct intr_event *event; struct thread *td = curthread; -#ifdef INTR_FILTER int i; -#else - int i, thread, ret; - struct intr_handler *ih; -#endif PCPU_INC(cnt.v_intr); td->td_intr_nesting_level++; while ((i = arm_get_next_irq()) != -1) { -#ifndef INTR_FILTER - arm_mask_irq(i); -#endif intrcnt[intrcnt_tab[i]]++; event = intr_events[i]; - if (!event || TAILQ_EMPTY(&event->ie_handlers)) { -#ifdef INTR_FILTER + if (intr_event_handle(event, frame) != 0) { + /* XXX: Log stray IRQs */ arm_mask_irq(i); -#endif - continue; } - -#ifdef INTR_FILTER - intr_event_handle(event, frame); - /* XXX: Log stray IRQs */ -#else - /* Execute fast handlers. */ - ret = 0; - thread = 0; - TAILQ_FOREACH(ih, &event->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) - thread = 1; - else - ret = ih->ih_filter(ih->ih_argument ? - ih->ih_argument : frame); - /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - /* Schedule thread if needed. */ - if (thread) - intr_event_schedule_thread(event); - else - arm_unmask_irq(i); -#endif } td->td_intr_nesting_level--; } |