diff options
author | markj <markj@FreeBSD.org> | 2013-08-13 03:07:49 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2013-08-13 03:07:49 +0000 |
commit | 80dd3f5e733e7d8ade978c6ff5f50dd66e87dc9b (patch) | |
tree | dcad89fb8dcad3f906701c32834969307169d079 /sys/sys/eventhandler.h | |
parent | c063aad382f7f397a474f5340d8be40d6eecf8d2 (diff) | |
download | FreeBSD-src-80dd3f5e733e7d8ade978c6ff5f50dd66e87dc9b.zip FreeBSD-src-80dd3f5e733e7d8ade978c6ff5f50dd66e87dc9b.tar.gz |
Add event handlers for module load and unload events. The load handlers are
called after the module has been loaded, and the unload handlers are called
before the module is unloaded. Moreover, the module unload handlers may
return an error to prevent the unload from proceeding.
Reviewed by: avg
MFC after: 2 weeks
Diffstat (limited to 'sys/sys/eventhandler.h')
-rw-r--r-- | sys/sys/eventhandler.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/eventhandler.h b/sys/sys/eventhandler.h index 02fbeaa..7e1eee2 100644 --- a/sys/sys/eventhandler.h +++ b/sys/sys/eventhandler.h @@ -266,4 +266,11 @@ EVENTHANDLER_DECLARE(nmbclusters_change, uma_zone_chfn); EVENTHANDLER_DECLARE(nmbufs_change, uma_zone_chfn); EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); +/* Module load and unload events */ +struct linker_file; +typedef void (*mod_load_fn)(void *, struct linker_file *); +typedef void (*mod_unload_fn)(void *, struct linker_file *, int *); +EVENTHANDLER_DECLARE(mod_load, mod_load_fn); +EVENTHANDLER_DECLARE(mod_unload, mod_unload_fn); + #endif /* SYS_EVENTHANDLER_H */ |