Module Name: src
Committed By: pgoyette
Date: Sat Sep 22 22:21:47 UTC 2018
Modified Files:
src/distrib/sets/lists/modules [pgoyette-compat]: mi
src/sys/compat/common [pgoyette-compat]: compat_50_mod.c
compat_80_mod.c
src/sys/modules [pgoyette-compat]: Makefile
Added Files:
src/sys/compat/common [pgoyette-compat]: compat_raid_50.c
compat_raid_80.c
src/sys/modules/compat_raid_50 [pgoyette-compat]: Makefile
src/sys/modules/compat_raid_80 [pgoyette-compat]: Makefile
Log Message:
Split the raidframe compatability code out into separate modules, since
the driver is already a module. This avoids having to pass a bunch of
function pointers as arguments to raidframe's compat_ioctl().
To generate a diff of this commit:
cvs rdiff -u -r1.114.2.21 -r1.114.2.22 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/sys/compat/common/compat_50_mod.c
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/compat/common/compat_80_mod.c
cvs rdiff -u -r0 -r1.1.2.1 src/sys/compat/common/compat_raid_50.c \
src/sys/compat/common/compat_raid_80.c
cvs rdiff -u -r1.202.2.34 -r1.202.2.35 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sys/modules/compat_raid_50/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sys/modules/compat_raid_80/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.114.2.21 src/distrib/sets/lists/modules/mi:1.114.2.22
--- src/distrib/sets/lists/modules/mi:1.114.2.21 Mon Sep 10 08:44:50 2018
+++ src/distrib/sets/lists/modules/mi Sat Sep 22 22:21:46 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.114.2.21 2018/09/10 08:44:50 pgoyette Exp $
+# $NetBSD: mi,v 1.114.2.22 2018/09/22 22:21:46 pgoyette Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -101,7 +101,11 @@
./@MODULEDIR@/compat_80 base-kernel-modules kmod
./@MODULEDIR@/compat_80/compat_80.kmod base-kernel-modules kmod
./@MODULEDIR@/compat_ossaudio base-kernel-modules kmod
-./@MODULEDIR@/compat_ossaudio/compat_ossaudio.kmod base-kernel-modules kmod
+./@MODULEDIR@/compat_ossaudio/compat_ossaudio.kmod base-kernel-modules kmod
+./@MODULEDIR@/compat_raid_50 base-kernel-modules kmod
+./@MODULEDIR@/compat_raid_50/compat_raid_50.kmod base-kernel-modules kmod
+./@MODULEDIR@/compat_raid_80 base-kernel-modules kmod
+./@MODULEDIR@/compat_raid_80/compat_raid_80.kmod base-kernel-modules kmod
./@MODULEDIR@/compat_sysv_10 base-kernel-modules kmod
./@MODULEDIR@/compat_sysv_10/compat_sysv_10.kmod base-kernel-modules kmod
./@MODULEDIR@/compat_sysv_14 base-kernel-modules kmod
Index: src/sys/compat/common/compat_50_mod.c
diff -u src/sys/compat/common/compat_50_mod.c:1.1.2.13 src/sys/compat/common/compat_50_mod.c:1.1.2.14
--- src/sys/compat/common/compat_50_mod.c:1.1.2.13 Sat Sep 22 04:56:28 2018
+++ src/sys/compat/common/compat_50_mod.c Sat Sep 22 22:21:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_50_mod.c,v 1.1.2.13 2018/09/22 04:56:28 pgoyette Exp $ */
+/* $NetBSD: compat_50_mod.c,v 1.1.2.14 2018/09/22 22:21:46 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_50_mod.c,v 1.1.2.13 2018/09/22 04:56:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_50_mod.c,v 1.1.2.14 2018/09/22 22:21:46 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -55,8 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: compat_50_mo
#include <compat/common/compat_mod.h>
#include <compat/common/if_spppsubr50.h>
-#include <dev/raidframe/rf_compat50_mod.h>
-
#include <dev/wscons/wsevent_50.h>
#include <fs/puffs/puffs_sys.h>
@@ -87,7 +85,6 @@ compat_50_init(void)
clockctl_50_init();
if_spppsubr_50_init();
cryptodev_50_init();
- raidframe_50_init();
puffs_50_init();
wsevent_50_init();
vnd_50_init();
@@ -114,7 +111,6 @@ compat_50_fini(void)
vnd_50_fini();
wsevent_50_fini();
puffs_50_fini();
- raidframe_50_fini();
cryptodev_50_fini();
if_spppsubr_50_fini();
clockctl_50_fini();
@@ -152,7 +148,6 @@ compat_50_fini(void)
clockctl_50_init();
if_spppsubr_50_init();
cryptodev_50_init();
- raidframe_50_init();
puffs_50_init();
wsevent_50_init();
vnd_50_init();
Index: src/sys/compat/common/compat_80_mod.c
diff -u src/sys/compat/common/compat_80_mod.c:1.1.2.10 src/sys/compat/common/compat_80_mod.c:1.1.2.11
--- src/sys/compat/common/compat_80_mod.c:1.1.2.10 Sat Sep 22 04:56:28 2018
+++ src/sys/compat/common/compat_80_mod.c Sat Sep 22 22:21:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_80_mod.c,v 1.1.2.10 2018/09/22 04:56:28 pgoyette Exp $ */
+/* $NetBSD: compat_80_mod.c,v 1.1.2.11 2018/09/22 22:21:46 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -38,20 +38,18 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_80_mod.c,v 1.1.2.10 2018/09/22 04:56:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_80_mod.c,v 1.1.2.11 2018/09/22 22:21:46 pgoyette Exp $");
#include <sys/systm.h>
#include <sys/module.h>
#include <compat/common/compat_util.h>
#include <compat/common/compat_mod.h>
-#include <dev/raidframe/rf_compat80_mod.h>
int compat_80_init(void)
{
kern_mod_80_init();
- raidframe_80_init();
return 0;
}
@@ -59,7 +57,6 @@ int compat_80_init(void)
int compat_80_fini(void)
{
- raidframe_80_fini();
kern_mod_80_fini();
return 0;
Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.202.2.34 src/sys/modules/Makefile:1.202.2.35
--- src/sys/modules/Makefile:1.202.2.34 Sat Sep 22 11:43:24 2018
+++ src/sys/modules/Makefile Sat Sep 22 22:21:46 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.202.2.34 2018/09/22 11:43:24 pgoyette Exp $
+# $NetBSD: Makefile,v 1.202.2.35 2018/09/22 22:21:46 pgoyette Exp $
.include <bsd.own.mk>
@@ -14,6 +14,8 @@ SUBDIR+= compat_60 compat_70 compat_
SUBDIR+= compat_sysv_10 compat_sysv_14 compat_sysv_50
+SUBDIR+= compat_raid_80
+
SUBDIR+= accf_dataready
SUBDIR+= accf_httpready
SUBDIR+= adosfs
Added files:
Index: src/sys/compat/common/compat_raid_50.c
diff -u /dev/null src/sys/compat/common/compat_raid_50.c:1.1.2.1
--- /dev/null Sat Sep 22 22:21:47 2018
+++ src/sys/compat/common/compat_raid_50.c Sat Sep 22 22:21:46 2018
@@ -0,0 +1,83 @@
+/* $NetBSD: compat_raid_50.c,v 1.1.2.1 2018/09/22 22:21:46 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Linkage for the compat module: spaghetti.
+ */
+
+#if defined(_KERNEL_OPT)
+#include "opt_compat_netbsd.h"
+#endif
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: compat_raid_50.c,v 1.1.2.1 2018/09/22 22:21:46 pgoyette Exp $");
+
+#include <sys/systm.h>
+#include <sys/module.h>
+
+#include <compat/common/compat_util.h>
+#include <compat/common/compat_mod.h>
+
+#include <dev/raidframe/rf_compat50_mod.h>
+
+int compat_raid_50_init(void)
+{
+
+ raidframe_50_init();
+
+ return 0;
+}
+
+int compat_raid_50_fini(void)
+{
+
+ raidframe_50_fini();
+
+ return 0;
+}
+
+MODULE(MODULE_CLASS_EXEC, compat_raid_50, "compat_50,raid");
+
+static int
+compat_50_modcmd(modcmd_t cmd, void *arg)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ return compat_raid_50_init();
+
+ case MODULE_CMD_FINI:
+ return compat_raid_50_fini();
+
+ default:
+ return ENOTTY;
+ }
+}
Index: src/sys/compat/common/compat_raid_80.c
diff -u /dev/null src/sys/compat/common/compat_raid_80.c:1.1.2.1
--- /dev/null Sat Sep 22 22:21:47 2018
+++ src/sys/compat/common/compat_raid_80.c Sat Sep 22 22:21:46 2018
@@ -0,0 +1,83 @@
+/* $NetBSD: compat_raid_80.c,v 1.1.2.1 2018/09/22 22:21:46 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Linkage for the compat module: spaghetti.
+ */
+
+#if defined(_KERNEL_OPT)
+#include "opt_compat_netbsd.h"
+#endif
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: compat_raid_80.c,v 1.1.2.1 2018/09/22 22:21:46 pgoyette Exp $");
+
+#include <sys/systm.h>
+#include <sys/module.h>
+
+#include <compat/common/compat_util.h>
+#include <compat/common/compat_mod.h>
+
+#include <dev/raidframe/rf_compat80_mod.h>
+
+int compat_raid_80_init(void)
+{
+
+ raidframe_80_init();
+
+ return 0;
+}
+
+int compat_raid_80_fini(void)
+{
+
+ raidframe_80_fini();
+
+ return 0;
+}
+
+MODULE(MODULE_CLASS_EXEC, compat_raid_80, "compat_80,raid");
+
+static int
+compat_80_modcmd(modcmd_t cmd, void *arg)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ return compat_raid_80_init();
+
+ case MODULE_CMD_FINI:
+ return compat_raid_80_fini();
+
+ default:
+ return ENOTTY;
+ }
+}
Index: src/sys/modules/compat_raid_50/Makefile
diff -u /dev/null src/sys/modules/compat_raid_50/Makefile:1.1.2.1
--- /dev/null Sat Sep 22 22:21:47 2018
+++ src/sys/modules/compat_raid_50/Makefile Sat Sep 22 22:21:46 2018
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1.2.1 2018/09/22 22:21:46 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/compat/common
+
+KMOD= compat_raid_50
+
+CPPFLAGS+= -DCOMPAT_50
+
+SRCS+= compat_50_mod.c
+
+.PATH: ${S}/dev/raidframe
+
+SRCS+= rf_compat50.c
+
+.include <bsd.kmodule.mk>
Index: src/sys/modules/compat_raid_80/Makefile
diff -u /dev/null src/sys/modules/compat_raid_80/Makefile:1.1.2.1
--- /dev/null Sat Sep 22 22:21:47 2018
+++ src/sys/modules/compat_raid_80/Makefile Sat Sep 22 22:21:46 2018
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1.2.1 2018/09/22 22:21:46 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/compat/common
+
+KMOD= compat_raid_80
+
+CPPFLAGS+= -DCOMPAT_80
+
+SRCS+= compat_80_mod.c
+
+.PATH: ${S}/dev/raidframe
+
+SRCS+= rf_compat80.c
+
+.include <bsd.kmodule.mk>