summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_intr.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-12-12 19:20:19 +0000
committerjhb <jhb@FreeBSD.org>2006-12-12 19:20:19 +0000
commit65d8bd30a00681cb5864698d05bd24395da41546 (patch)
tree2a56d1c14d9905ef1ad0f8b926479b9ef783dcfb /sys/kern/kern_intr.c
parent7106027433bd2e711f844be45f587f6f2f7556cf (diff)
downloadFreeBSD-src-65d8bd30a00681cb5864698d05bd24395da41546.zip
FreeBSD-src-65d8bd30a00681cb5864698d05bd24395da41546.tar.gz
Add a function to return the MD interrupt source cookie associated with
an interrupt event. Use this in the x86 code to fixup the intrcnt names when an interrupt handler is removed.
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r--sys/kern/kern_intr.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 8d1dbe8..9cab3bf 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -396,6 +396,26 @@ intr_event_add_handler(struct intr_event *ie, const char *name,
return (0);
}
+/*
+ * Return the ie_source field from the intr_event an intr_handler is
+ * associated with.
+ */
+void *
+intr_handler_source(void *cookie)
+{
+ struct intr_handler *ih;
+ struct intr_event *ie;
+
+ ih = (struct intr_handler *)cookie;
+ if (ih == NULL)
+ return (NULL);
+ ie = ih->ih_event;
+ KASSERT(ie != NULL,
+ ("interrupt handler \"%s\" has a NULL interrupt event",
+ ih->ih_name));
+ return (ie->ie_source);
+}
+
int
intr_event_remove_handler(void *cookie)
{
OpenPOWER on IntegriCloud