Module Name: src Committed By: pooka Date: Thu Oct 8 00:47:47 UTC 2009
Modified Files: src/sys/rump/librump/rumpkern: rump.c Log Message: Seems like module loading code is tasked with calling secmodel_register() these days ... To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/rump/librump/rumpkern/rump.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.119 src/sys/rump/librump/rumpkern/rump.c:1.120 --- src/sys/rump/librump/rumpkern/rump.c:1.119 Thu Oct 8 00:36:56 2009 +++ src/sys/rump/librump/rumpkern/rump.c Thu Oct 8 00:47:47 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.119 2009/10/08 00:36:56 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.120 2009/10/08 00:47:47 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.119 2009/10/08 00:36:56 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.120 2009/10/08 00:47:47 pooka Exp $"); #include <sys/param.h> #include <sys/atomic.h> @@ -510,18 +510,28 @@ int rump_module_init(struct modinfo *mi, prop_dictionary_t props) { + int rv; if (!module_compatible(mi->mi_version, __NetBSD_Version__)) return EPROGMISMATCH; - return mi->mi_modcmd(MODULE_CMD_INIT, props); + rv = mi->mi_modcmd(MODULE_CMD_INIT, props); + if (rv == 0 && mi->mi_class == MODULE_CLASS_SECMODEL) + secmodel_register(); + + return rv; } int rump_module_fini(struct modinfo *mi) { + int rv; + + rv = mi->mi_modcmd(MODULE_CMD_FINI, NULL); + if (rv == 0 && mi->mi_class == MODULE_CLASS_SECMODEL) + secmodel_deregister(); - return mi->mi_modcmd(MODULE_CMD_FINI, NULL); + return rv; } int _syspuffs_stub(int, int *);