aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2005-10-26 15:51:05 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2005-10-26 15:51:05 +0000
commitfe486a370af0c13a185fc225d9703e88d3705c9f (patch)
tree82b0b193f1525122a5d2fa726e6a79eca5ba1d04 /sys
parent3b46e988e7f563b566f842d7a170d6da4ec3c040 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_intr.c17
-rw-r--r--sys/sys/interrupt.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index fe9b597a0e1c2..db69b834d3a2f 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -541,6 +541,10 @@ intr_event_schedule_thread(struct intr_event *ie)
return (0);
}
+/*
+ * Add a software interrupt handler to a specified event. If a given event
+ * is not specified, then a new event is created.
+ */
int
swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
void *arg, int pri, enum intr_type flags, void **cookiep)
@@ -596,6 +600,19 @@ swi_sched(void *cookie, int flags)
}
}
+/*
+ * Remove a software interrupt handler. Currently this code does not
+ * remove the associated interrupt event if it becomes empty. Calling code
+ * may do so manually via intr_event_destroy(), but that's not really
+ * an optimal interface.
+ */
+int
+swi_remove(void *cookie)
+{
+
+ return (intr_event_remove_handler(cookie));
+}
+
static void
ithread_execute_handlers(struct proc *p, struct intr_event *ie)
{
diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h
index 75a25733a5c83..2856703653914 100644
--- a/sys/sys/interrupt.h
+++ b/sys/sys/interrupt.h
@@ -125,5 +125,6 @@ int swi_add(struct intr_event **eventp, const char *name,
driver_intr_t handler, void *arg, int pri, enum intr_type flags,
void **cookiep);
void swi_sched(void *cookie, int flags);
+int swi_remove(void *cookie);
#endif