summaryrefslogtreecommitdiffstats
path: root/sys/modules/vinum
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-10-16 04:30:52 +0000
committerpeter <peter@FreeBSD.org>1998-10-16 04:30:52 +0000
commitac52f6b7583c0e99b3dae24ff997a883eb9a9c4b (patch)
tree0fe9e0d5ef6ae112bba6612c549035f20ce56245 /sys/modules/vinum
parentcee4b5d4c180c7f89787124e2aefbde4bf062b46 (diff)
downloadFreeBSD-src-ac52f6b7583c0e99b3dae24ff997a883eb9a9c4b.zip
FreeBSD-src-ac52f6b7583c0e99b3dae24ff997a883eb9a9c4b.tar.gz
Sample initial set of kld-ified modules. Not all have been completely
converted yet. These are more of a starting point. This is NOT connected to the parent Makefile. OK'ed by jkh (who is ever so patiently waiting)
Diffstat (limited to 'sys/modules/vinum')
-rw-r--r--sys/modules/vinum/Makefile7
-rw-r--r--sys/modules/vinum/vinum.c39
2 files changed, 38 insertions, 8 deletions
diff --git a/sys/modules/vinum/Makefile b/sys/modules/vinum/Makefile
index f1f4bb7..6489222 100644
--- a/sys/modules/vinum/Makefile
+++ b/sys/modules/vinum/Makefile
@@ -1,12 +1,11 @@
-# $Id: Makefile,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
+# $Id: Makefile,v 1.2 1998/09/28 04:21:20 grog Exp $
-.PATH: ${.CURDIR}/../../sys/dev/ccd
-KMOD= vinum_mod
+.PATH: ${.CURDIR}/../../dev/ccd
+KMOD= vinum
SRCS= vinum.c vinum.h vnode_if.h parser.c config.c io.c util.c vinumhdr.h request.h \
state.c memory.c request.c lock.c vinumext.h vinumio.h vinumkw.h \
vinumstate.h vinumvar.h revive.c vinumioctl.c interrupt.c
NOMAN=
-PSEUDO_LKM=
CFLAGS = -I${.CURDIR} -O -g -I/usr/include/machine -DDEBUG -Wall -Wno-unused -Wno-parentheses
CLEANFILES+= vinum.h vnode_if.h vnode_if.c
diff --git a/sys/modules/vinum/vinum.c b/sys/modules/vinum/vinum.c
index bffdf6d..62c6b3f 100644
--- a/sys/modules/vinum/vinum.c
+++ b/sys/modules/vinum/vinum.c
@@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinum.c,v 1.19 1998/08/13 05:24:02 grog Exp grog $
+ * $Id: vinum.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
*/
#define STATIC /* nothing while we're testing XXX */
@@ -161,8 +161,6 @@ vinumattach(void *dummy)
}
-#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
-
/* Check if we have anything open. If so, return 0 (not inactive),
* otherwise 1 (inactive) */
int
@@ -228,6 +226,7 @@ free_vinum(int cleardrive)
bzero(&vinum_conf, sizeof(vinum_conf));
}
+#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
MOD_MISC(vinum);
/*
@@ -289,7 +288,39 @@ vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
}
#else /* not LKM */
-#error "This driver must be compiled as a loadable kernel module"
+
+STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
+STATIC int
+vinum_modevent(module_t mod, modeventtype_t type, void *unused)
+{
+ struct sync_args dummyarg = {0};
+
+ BROKEN_GDB;
+ switch (type) {
+ case MOD_LOAD:
+ /* Debugger ("vinum_load"); */
+ vinumattach(NULL);
+ return 0; /* OK */
+ case MOD_UNLOAD:
+ if (!vinum_inactive()) /* is anything open? */
+ return EBUSY;
+ sync(curproc, &dummyarg); /* write out buffers */
+ free_vinum(0); /* no: clean up */
+ cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
+ return 0;
+ default:
+ break;
+ }
+ return 0;
+}
+
+moduledata_t vinum_mod = {
+ "vinum",
+ vinum_modevent,
+ 0
+};
+DECLARE_MODULE(vinum, vinum_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
+
#endif /* LKM */
/* ARGSUSED */
OpenPOWER on IntegriCloud