summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_intr.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-09-15 22:19:44 +0000
committerjhb <jhb@FreeBSD.org>2008-09-15 22:19:44 +0000
commita55e334c2b95f0796667f2ecdd2434e08fe6f8fc (patch)
tree2045b32008303953d8acb3b05bfee0ce28955f1b /sys/kern/kern_intr.c
parentbe294ffd1c90512a25d1e1246249a832151d76b7 (diff)
downloadFreeBSD-src-a55e334c2b95f0796667f2ecdd2434e08fe6f8fc.zip
FreeBSD-src-a55e334c2b95f0796667f2ecdd2434e08fe6f8fc.tar.gz
Expose a new public routine intr_event_execute_handlers() which executes
all the non-filter handlers attached to an interrupt event. This can be used by device drivers which multiplex their interrupt onto the interrupt handlers for child devices.
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r--sys/kern/kern_intr.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 41be569..5bed43d 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -1085,16 +1085,16 @@ priv_ithread_execute_handler(struct proc *p, struct intr_handler *ih)
}
#endif
-static void
-ithread_execute_handlers(struct proc *p, struct intr_event *ie)
+/*
+ * This is a public function for use by drivers that mux interrupt
+ * handlers for child devices from their interrupt handler.
+ */
+void
+intr_event_execute_handlers(struct proc *p, struct intr_event *ie)
{
struct intr_handler *ih, *ihn;
- /* Interrupt handlers should not sleep. */
- if (!(ie->ie_flags & IE_SOFT))
- THREAD_NO_SLEEPING();
TAILQ_FOREACH_SAFE(ih, &ie->ie_handlers, ih_next, ihn) {
-
/*
* If this handler is marked for death, remove it from
* the list of handlers and wake up the sleeper.
@@ -1135,6 +1135,16 @@ ithread_execute_handlers(struct proc *p, struct intr_event *ie)
if (!(ih->ih_flags & IH_MPSAFE))
mtx_unlock(&Giant);
}
+}
+
+static void
+ithread_execute_handlers(struct proc *p, struct intr_event *ie)
+{
+
+ /* Interrupt handlers should not sleep. */
+ if (!(ie->ie_flags & IE_SOFT))
+ THREAD_NO_SLEEPING();
+ intr_event_execute_handlers(p, ie);
if (!(ie->ie_flags & IE_SOFT))
THREAD_SLEEPING_OK();
OpenPOWER on IntegriCloud