diff options
author | jhb <jhb@FreeBSD.org> | 2006-12-12 19:20:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-12-12 19:20:19 +0000 |
commit | 65d8bd30a00681cb5864698d05bd24395da41546 (patch) | |
tree | 2a56d1c14d9905ef1ad0f8b926479b9ef783dcfb /sys/kern/kern_intr.c | |
parent | 7106027433bd2e711f844be45f587f6f2f7556cf (diff) | |
download | FreeBSD-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.c | 20 |
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) { |