Mark other parts of interrupt framework as INTR_SOLO option specific.

Note that isrc_arg member of struct intr_irqsrc is used only for
INTR_SOLO and IPI filter. This should be remembered if IPI filters
and their arguments will be stored on another place.

This option could be unusable very soon, if interrupt controllers
implementations will not be implemented considering it.
This commit is contained in:
Svatopluk Kraus 2016-03-01 10:57:29 +00:00
parent 344060d2e7
commit 169e6abd8f
2 changed files with 12 additions and 6 deletions

View File

@ -713,7 +713,11 @@ isrc_event_create(struct intr_irqsrc *isrc)
* Make sure that we do not mix the two ways
* how we handle interrupt sources. Let contested event wins.
*/
#ifdef INTR_SOLO
if (isrc->isrc_filter != NULL || isrc->isrc_event != NULL) {
#else
if (isrc->isrc_event != NULL) {
#endif
mtx_unlock(&isrc_table_lock);
intr_event_destroy(ie);
return (isrc->isrc_event != NULL ? EBUSY : 0);
@ -1013,7 +1017,7 @@ intr_irq_remove_handler(device_t dev, u_int irq, void *cookie)
isrc = isrc_lookup(irq);
if (isrc == NULL || isrc->isrc_handlers == 0)
return (EINVAL);
#ifdef INTR_SOLO
if (isrc->isrc_filter != NULL) {
if (isrc != cookie)
return (EINVAL);
@ -1028,7 +1032,7 @@ intr_irq_remove_handler(device_t dev, u_int irq, void *cookie)
mtx_unlock(&isrc_table_lock);
return (0);
}
#endif
if (isrc != intr_handler_source(cookie))
return (EINVAL);
@ -1079,7 +1083,7 @@ intr_irq_describe(u_int irq, void *cookie, const char *descr)
isrc = isrc_lookup(irq);
if (isrc == NULL || isrc->isrc_handlers == 0)
return (EINVAL);
#ifdef INTR_SOLO
if (isrc->isrc_filter != NULL) {
if (isrc != cookie)
return (EINVAL);
@ -1089,7 +1093,7 @@ intr_irq_describe(u_int irq, void *cookie, const char *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);
@ -1108,10 +1112,10 @@ intr_irq_bind(u_int irq, int cpu)
isrc = isrc_lookup(irq);
if (isrc == NULL || isrc->isrc_handlers == 0)
return (EINVAL);
#ifdef INTR_SOLO
if (isrc->isrc_filter != NULL)
return (intr_isrc_assign_cpu(isrc, cpu));
#endif
return (intr_event_bind(isrc->isrc_event, cpu));
}

View File

@ -79,7 +79,9 @@ struct intr_irqsrc {
u_long * isrc_count;
u_int isrc_handlers;
struct intr_event * isrc_event;
#ifdef INTR_SOLO
intr_irq_filter_t * isrc_filter;
#endif
intr_ipi_filter_t * isrc_ipifilter;
void * isrc_arg;
#ifdef FDT