mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
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:
parent
3b46e988e7
commit
fe486a370a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151699
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user