diff options
author | msmith <msmith@FreeBSD.org> | 1999-08-21 06:24:40 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-08-21 06:24:40 +0000 |
commit | b51f157bff8b959d943b0836a1c57f065b9318d5 (patch) | |
tree | e447ab34080a4d202ed41db3476df31ef1f56a50 /sys/kern/kern_module.c | |
parent | a753b272ec1066c690e1ba83c8780af55e3a6c78 (diff) | |
download | FreeBSD-src-b51f157bff8b959d943b0836a1c57f065b9318d5.zip FreeBSD-src-b51f157bff8b959d943b0836a1c57f065b9318d5.tar.gz |
Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.
Retire the at_shutdown family of functions and replace them with
new event handler lists.
Rework kern_shutdown.c to take greater advantage of the use of event
handlers.
Reviewed by: green
Diffstat (limited to 'sys/kern/kern_module.c')
-rw-r--r-- | sys/kern/kern_module.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c index f380386..19dd2be 100644 --- a/sys/kern/kern_module.c +++ b/sys/kern/kern_module.c @@ -23,12 +23,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_module.c,v 1.17 1999/05/08 13:01:57 peter Exp $ + * $Id: kern_module.c,v 1.18 1999/05/20 00:00:58 peter Exp $ */ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/eventhandler.h> #include <sys/malloc.h> #include <sys/sysproto.h> #include <sys/sysent.h> @@ -56,19 +57,20 @@ struct module { static modulelist_t modules; static int nextid = 1; -static void module_shutdown(int, void*); +static void module_shutdown(void*, int); static void module_init(void* arg) { TAILQ_INIT(&modules); - at_shutdown(module_shutdown, 0, SHUTDOWN_POST_SYNC); + EVENTHANDLER_REGISTER(shutdown_post_sync, module_shutdown, NULL, + SHUTDOWN_PRI_DEFAULT); } SYSINIT(module, SI_SUB_KLD, SI_ORDER_FIRST, module_init, 0); static void -module_shutdown(int arg1, void* arg2) +module_shutdown(void* arg1, int arg2) { module_t mod; |