Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157670383
D39333.id119638.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D39333.id119638.diff
View Options
diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -731,8 +731,8 @@
/*
* Add handler to interrupt source.
*/
-static int
-isrc_add_handler(struct intr_irqsrc *isrc, const char *name,
+int
+intr_add_handler(const char *name, struct intr_irqsrc *isrc,
driver_filter_t filter, driver_intr_t handler, void *arg,
enum intr_type flags, void **cookiep)
{
@@ -753,6 +753,34 @@
return (error);
}
+/*
+ * Describe an interrupt
+ */
+int
+intr_describe(struct intr_irqsrc *isrc, void *cookie, const char *descr)
+{
+ int error;
+
+#ifdef INTR_SOLO
+ if (isrc->isrc_filter != NULL) {
+ if (isrc != cookie)
+ return (EINVAL);
+
+ mtx_lock(&isrc_table_lock);
+ isrc_update_name(isrc, descr);
+ mtx_unlock(&isrc_table_lock);
+ return (0);
+ }
+#endif
+ error = intr_event_describe_handler(isrc->isrc_event, cookie, descr);
+ if (error == 0) {
+ mtx_lock(&isrc_table_lock);
+ intrcnt_updatename(isrc);
+ mtx_unlock(&isrc_table_lock);
+ }
+ return (error);
+}
+
/*
* Lookup interrupt controller locked.
*/
@@ -1116,7 +1144,7 @@
} else
#endif
{
- error = isrc_add_handler(isrc, name, filt, hand, arg, flags,
+ error = intr_add_handler(name, isrc, filt, hand, arg, flags,
cookiep);
debugf("irq %u add handler error %d on %s\n", isrc->isrc_irq, error, name);
}
@@ -1190,7 +1218,6 @@
intr_describe_irq(device_t dev, struct resource *res, void *cookie,
const char *descr)
{
- int error;
struct intr_irqsrc *isrc;
u_int res_id;
@@ -1201,24 +1228,7 @@
isrc = intr_map_get_isrc(res_id);
if (isrc == NULL || isrc->isrc_handlers == 0)
return (EINVAL);
-#ifdef INTR_SOLO
- if (isrc->isrc_filter != NULL) {
- if (isrc != cookie)
- return (EINVAL);
-
- mtx_lock(&isrc_table_lock);
- isrc_update_name(isrc, descr);
- mtx_unlock(&isrc_table_lock);
- return (0);
- }
-#endif
- error = intr_event_describe_handler(isrc->isrc_event, cookie, descr);
- if (error == 0) {
- mtx_lock(&isrc_table_lock);
- intrcnt_updatename(isrc);
- mtx_unlock(&isrc_table_lock);
- }
- return (error);
+ return (intr_describe(isrc, cookie, descr));
}
#ifdef SMP
diff --git a/sys/sys/intr.h b/sys/sys/intr.h
--- a/sys/sys/intr.h
+++ b/sys/sys/intr.h
@@ -103,6 +103,10 @@
int intr_isrc_register(struct intr_irqsrc *, device_t, u_int, const char *, ...)
__printflike(4, 5);
+int intr_add_handler(const char *, struct intr_irqsrc *, driver_filter_t,
+ driver_intr_t, void *, enum intr_type, void **);
+int intr_describe(struct intr_irqsrc *isrc, void *cookie, const char *descr);
+
#ifdef SMP
bool intr_isrc_init_on_cpu(struct intr_irqsrc *isrc, u_int cpu);
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 24, 10:16 PM (12 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33488843
Default Alt Text
D39333.id119638.diff (2 KB)
Attached To
Mode
D39333: intrng: expose lower-level device interface for INTRNG
Attached
Detach File
Event Timeline
Log In to Comment