summaryrefslogtreecommitdiffstats
path: root/sys/sys/interrupt.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-10-15 14:54:35 +0000
committerjhb <jhb@FreeBSD.org>2009-10-15 14:54:35 +0000
commit45688ed39df1a016dde3d3f3cb4f19e562a683c2 (patch)
tree822343884edf055be1b27eb1097d39bdd975cf43 /sys/sys/interrupt.h
parentc369f72e79562af70cc2ac640a8099842519403d (diff)
downloadFreeBSD-src-45688ed39df1a016dde3d3f3cb4f19e562a683c2.zip
FreeBSD-src-45688ed39df1a016dde3d3f3cb4f19e562a683c2.tar.gz
Add a facility for associating optional descriptions with active interrupt
handlers. This is primarily intended as a way to allow devices that use multiple interrupts (e.g. MSI) to meaningfully distinguish the various interrupt handlers. - Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate a description with an active interrupt handler setup by BUS_SETUP_INTR. It has a default method (bus_generic_describe_intr()) which simply passes the request up to the parent device. - Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports printf(9) style formatting using var args. - Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of an interrupt handler and copy the name passed to intr_event_add_handler() into that buffer instead of just saving the pointer to the name. - Add a new intr_event_describe_handler() which appends a description string to an interrupt handler's name. - Implement support for interrupt descriptions on amd64 and i386 by having the nexus(4) driver supply a custom bus_describe_intr method that invokes a new intr_describe() MD routine which in turn looks up the associated interrupt event and invokes intr_event_describe_handler(). Requested by: many Reviewed by: scottl MFC after: 2 weeks
Diffstat (limited to 'sys/sys/interrupt.h')
-rw-r--r--sys/sys/interrupt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h
index 92c0f03..18f73d9 100644
--- a/sys/sys/interrupt.h
+++ b/sys/sys/interrupt.h
@@ -47,7 +47,7 @@ struct intr_handler {
driver_intr_t *ih_handler; /* Threaded handler function. */
void *ih_argument; /* Argument to pass to handlers. */
int ih_flags;
- const char *ih_name; /* Name of handler. */
+ char ih_name[MAXCOMLEN]; /* Name of handler. */
struct intr_event *ih_event; /* Event we are connected to. */
int ih_need; /* Needs service. */
TAILQ_ENTRY(intr_handler) ih_next; /* Next handler for this event. */
@@ -172,6 +172,8 @@ int intr_event_destroy(struct intr_event *ie);
void intr_event_execute_handlers(struct proc *p, struct intr_event *ie);
int intr_event_handle(struct intr_event *ie, struct trapframe *frame);
int intr_event_remove_handler(void *cookie);
+int intr_event_describe_handler(struct intr_event *ie, void *cookie,
+ const char *descr);
int intr_getaffinity(int irq, void *mask);
void *intr_handler_source(void *cookie);
int intr_setaffinity(int irq, void *mask);
OpenPOWER on IntegriCloud