Add a swi_remove() function to teardown software interrupt handlers. For

now it just calls intr_event_remove_handler(), but at some point it might
also be responsible for tearing down interrupt events created via swi_add.
This commit is contained in:
John Baldwin 2005-10-26 15:51:05 +00:00
parent 3b46e988e7
commit fe486a370a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151699
2 changed files with 18 additions and 0 deletions

View File

@ -541,6 +541,10 @@ intr_event_schedule_thread(struct intr_event *ie)
return (0);
}
/*
* Add a software interrupt handler to a specified event. If a given event
* is not specified, then a new event is created.
*/
int
swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
void *arg, int pri, enum intr_type flags, void **cookiep)
@ -596,6 +600,19 @@ swi_sched(void *cookie, int flags)
}
}
/*
* Remove a software interrupt handler. Currently this code does not
* remove the associated interrupt event if it becomes empty. Calling code
* may do so manually via intr_event_destroy(), but that's not really
* an optimal interface.
*/
int
swi_remove(void *cookie)
{
return (intr_event_remove_handler(cookie));
}
static void
ithread_execute_handlers(struct proc *p, struct intr_event *ie)
{

View File

@ -125,5 +125,6 @@ int swi_add(struct intr_event **eventp, const char *name,
driver_intr_t handler, void *arg, int pri, enum intr_type flags,
void **cookiep);
void swi_sched(void *cookie, int flags);
int swi_remove(void *cookie);
#endif