summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-11-29 10:49:16 +0000
committerjulian <julian@FreeBSD.org>1995-11-29 10:49:16 +0000
commitf2f63c6ece7d25485976323df6d684743fe14bb6 (patch)
tree5ed2d747156a38098db0e540f833114bc9dd1b51 /sys/dev
parentbe48321f04abe146ffbc5091fe940b107f46c175 (diff)
downloadFreeBSD-src-f2f63c6ece7d25485976323df6d684743fe14bb6.zip
FreeBSD-src-f2f63c6ece7d25485976323df6d684743fe14bb6.tar.gz
OK, that's it..
That's EVERY SINGLE driver that has an entry in conf.c.. my next trick will be to define cdevsw[] and bdevsw[] as empty arrays and remove all those DAMNED defines as well.. Each of these drivers has a SYSINIT linker set entry that comes in very early.. and asks teh driver to add it's own entry to the two devsw[] tables. some slight reworking of the commits from yesterday (added the SYSINIT stuff and some usually wrong but token DEVFS entries to all these devices. BTW does anyone know where the 'ata' entries in conf.c actually reside? seems we don't actually have a 'ataopen() etc... If you want to add a new device in conf.c please make sure I know so I can keep it up to date too.. as before, this is all dependent on #if defined(JREMOD) (and #ifdef DEVFS in parts)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cy/cy.c38
-rw-r--r--sys/dev/cy/cy_isa.c38
-rw-r--r--sys/dev/dgb/dgb.c41
-rw-r--r--sys/dev/joy/joy.c37
-rw-r--r--sys/dev/mcd/mcd.c45
-rw-r--r--sys/dev/mse/mse.c38
-rw-r--r--sys/dev/rc/rc.c37
-rw-r--r--sys/dev/scd/scd.c45
-rw-r--r--sys/dev/si/si.c39
-rw-r--r--sys/dev/sio/sio.c37
-rw-r--r--sys/dev/snp/snp.c39
-rw-r--r--sys/dev/speaker/spkr.c48
-rw-r--r--sys/dev/vn/vn.c52
13 files changed, 379 insertions, 155 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index c2f3725..c4739ae 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.19 1995/11/26 17:13:23 bde Exp $
+ * $Id: cy.c,v 1.20 1995/11/28 09:40:56 julian Exp $
*/
#include "cy.h"
@@ -398,8 +398,10 @@ static int cy_nr_cd1400s[NCY];
static int volatile RxFifoThreshold = (CD1400_RX_FIFO_SIZE / 2);
#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 48
-static void cy_devsw_install();
#endif /*JREMOD*/
static struct kern_devconf kdc_sio[NCY] = { {
@@ -442,9 +444,6 @@ sioprobe(dev)
return (0);
cy_nr_cd1400s[unit] = 0;
sioregisterdev(dev);
-#ifdef JREMOD
- cy_devsw_install();
-#endif /*JREMOD*/
/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
@@ -2521,6 +2520,7 @@ cystatus(unit)
#endif /* CyDebug */
+
#ifdef JREMOD
struct cdevsw cy_cdevsw =
{ cyopen, cyclose, cyread, cywrite, /*48*/
@@ -2529,18 +2529,28 @@ struct cdevsw cy_cdevsw =
static cy_devsw_installed = 0;
-static void cy_devsw_install()
+static void cy_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! cy_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&cy_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&cy_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&cy_cdevsw,NULL);
cy_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "cy", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(cydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cy_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NCY > 0 */
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index c2f3725..c4739ae 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.19 1995/11/26 17:13:23 bde Exp $
+ * $Id: cy.c,v 1.20 1995/11/28 09:40:56 julian Exp $
*/
#include "cy.h"
@@ -398,8 +398,10 @@ static int cy_nr_cd1400s[NCY];
static int volatile RxFifoThreshold = (CD1400_RX_FIFO_SIZE / 2);
#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 48
-static void cy_devsw_install();
#endif /*JREMOD*/
static struct kern_devconf kdc_sio[NCY] = { {
@@ -442,9 +444,6 @@ sioprobe(dev)
return (0);
cy_nr_cd1400s[unit] = 0;
sioregisterdev(dev);
-#ifdef JREMOD
- cy_devsw_install();
-#endif /*JREMOD*/
/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
@@ -2521,6 +2520,7 @@ cystatus(unit)
#endif /* CyDebug */
+
#ifdef JREMOD
struct cdevsw cy_cdevsw =
{ cyopen, cyclose, cyread, cywrite, /*48*/
@@ -2529,18 +2529,28 @@ struct cdevsw cy_cdevsw =
static cy_devsw_installed = 0;
-static void cy_devsw_install()
+static void cy_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! cy_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&cy_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&cy_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&cy_cdevsw,NULL);
cy_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "cy", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(cydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cy_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NCY > 0 */
diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c
index 1e61971..11a868a 100644
--- a/sys/dev/dgb/dgb.c
+++ b/sys/dev/dgb/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.4 1995/10/12 23:28:31 bde Exp $
+ * dgb.c $Id: dgb.c,v 1.5 1995/11/04 13:22:59 bde Exp $
*
* Digiboard driver.
*
@@ -51,6 +51,13 @@
#include <gnu/i386/isa/dgfep.h>
#include <gnu/i386/isa/dgreg.h>
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 58
+#endif /*JREMOD*/
+
#define CALLOUT_MASK 0x80
#define CONTROL_MASK 0x60
#define CONTROL_INIT_STATE 0x20
@@ -1979,4 +1986,36 @@ fepcmd(port, cmd, op1, op2, ncmds, bytecmd)
port->unit, port->pnum);
}
+#ifdef JREMOD
+struct cdevsw dgb_cdevsw =
+ { dgbopen, dgbclose, dgbread, dgbwrite, /*58*/
+ dgbioctl, dgbstop, nxreset, dgbdevtotty, /* dgb */
+ ttselect, nommap, NULL };
+
+static dgb_devsw_installed = 0;
+
+static void dgb_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! dgb_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&dgb_cdevsw,NULL);
+ dgb_devsw_installed = 1;
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name major minor type uid gid perm*/
+ "/", "dgb", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(dgbdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,dgb_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif /* NDGB > 0 */
diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c
index 5870e62..e90e90f 100644
--- a/sys/dev/joy/joy.c
+++ b/sys/dev/joy/joy.c
@@ -43,8 +43,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 51
-static void joy_devsw_install();
#endif /*JREMOD*/
/* The game port can manage 4 buttons and 4 variable resistors (usually 2
@@ -105,10 +108,6 @@ joyattach (struct isa_device *dev)
joy[dev->id_unit].timeout[0] = joy[dev->id_unit].timeout[1] = 0;
printf("joy%d: joystick\n", dev->id_unit);
-#ifdef JREMOD
- joy_devsw_install();
-#endif /*JREMOD*/
-
return 1;
}
@@ -224,18 +223,28 @@ struct cdevsw joy_cdevsw =
static joy_devsw_installed = 0;
-static void joy_devsw_install()
+static void joy_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! joy_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&joy_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&joy_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&joy_cdevsw,NULL);
joy_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "joy", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(joydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,joy_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NJOY > 0 */
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index 0571a93..4ab0b9c 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mcd.c,v 1.48 1995/11/04 13:23:35 bde Exp $
+ * $Id: mcd.c,v 1.49 1995/11/28 09:41:22 julian Exp $
*/
static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -71,9 +71,13 @@ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
#include <i386/isa/mcdreg.h>
#ifdef JREMOD
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 29
#define BDEV_MAJOR 7
-static void mcd_devsw_install();
#endif /*JREMOD */
#define MCD_TRACE(format, args...) \
@@ -262,10 +266,6 @@ int mcd_attach(struct isa_device *dev)
kdc_mcd[dev->id_unit].kdc_state = DC_IDLE;
/* name filled in probe */
kdc_mcd[dev->id_unit].kdc_description = mcd_data[dev->id_unit].name;
-#ifdef JREMOD
- mcd_devsw_install();
-#endif /*JREMOD*/
-
return 1;
}
@@ -1682,18 +1682,33 @@ struct cdevsw mcd_cdevsw =
static mcd_devsw_installed = 0;
-static void mcd_devsw_install()
+static void mcd_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! mcd_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&mcd_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&mcd_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&mcd_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&mcd_bdevsw,NULL);
mcd_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+/* path name devsw minor type uid gid perm*/
+ "/", "rmcd", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "mcd", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(mcddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,mcd_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NMCD > 0 */
diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c
index 5499a2a..52195fb 100644
--- a/sys/dev/mse/mse.c
+++ b/sys/dev/mse/mse.c
@@ -11,7 +11,7 @@
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * $Id: mse.c,v 1.15 1995/11/04 17:07:37 bde Exp $
+ * $Id: mse.c,v 1.16 1995/11/28 09:41:25 julian Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -63,8 +63,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 27
-static void mse_devsw_install();
#endif /*JREMOD*/
static int mseprobe(struct isa_device *);
@@ -239,9 +242,6 @@ mseattach(idp)
sc->sc_port = idp->id_iobase;
kdc_mse[idp->id_unit].kdc_state = DC_IDLE;
-#ifdef JREMOD
- mse_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -583,18 +583,28 @@ struct cdevsw mse_cdevsw =
static mse_devsw_installed = 0;
-static void mse_devsw_install()
+static void mse_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! mse_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&mse_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&mse_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&mse_cdevsw,NULL);
mse_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "mse", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(msedev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,mse_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NMSE */
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 6203aff..e1d80cb 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -60,8 +60,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 63
-static void rc_devsw_install();
#endif /*JREMOD*/
/* Prototypes */
@@ -283,10 +286,6 @@ int rcattach(dvp)
rc_wakeup((void *)NULL);
rc_wakeup_started = 0;
}
-#ifdef JREMOD
- rc_devsw_install();
-#endif /*JREMOD*/
-
return 1;
}
@@ -1511,18 +1510,28 @@ struct cdevsw rc_cdevsw =
static rc_devsw_installed = 0;
-static void rc_devsw_install()
+static void rc_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! rc_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&rc_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&rc_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&rc_cdevsw,NULL);
rc_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "rc", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(rcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,rc_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NRC */
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index 7d4fdec..0e2a130 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.9 1995/11/04 13:23:39 bde Exp $ */
+/* $Id: scd.c,v 1.10 1995/11/28 09:41:36 julian Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -73,9 +73,12 @@
#include <i386/isa/scdreg.h>
#ifdef JREMOD
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 45
#define BDEV_MAJOR 16
-static void scd_devsw_install();
#endif /*JREMOD */
#define scd_part(dev) ((minor(dev)) & 7)
@@ -224,10 +227,6 @@ int scd_attach(struct isa_device *dev)
cd->flags = SCDINIT;
cd->audio_status = CD_AS_AUDIO_INVALID;
-#ifdef JREMOD
- scd_devsw_install();
-#endif /*JREMOD*/
-
return 1;
}
@@ -1529,6 +1528,7 @@ scd_toc_entrys (int unit, struct ioc_read_toc_entry *te)
return 0;
}
+
#ifdef JREMOD
struct bdevsw scd_bdevsw =
{ scdopen, scdclose, scdstrategy, scdioctl, /*16*/
@@ -1541,19 +1541,34 @@ struct cdevsw scd_cdevsw =
static scd_devsw_installed = 0;
-static void scd_devsw_install()
+static void scd_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! scd_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&scd_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&scd_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&scd_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&scd_bdevsw,NULL);
scd_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "rscd", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "scd", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(scddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,scd_drvinit,NULL)
+
#endif /* JREMOD */
#endif /* NSCD > 0 */
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index 93accc2..7b58916 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.16 1995/11/28 07:29:29 bde Exp $
+ * $Id: si.c,v 1.17 1995/11/28 09:41:39 julian Exp $
*/
#ifndef lint
@@ -82,8 +82,10 @@ static char si_copyright1[] = "@(#) (C) Specialix International, 1990,1992",
enum si_mctl { GET, SET, BIS, BIC };
#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 68
-static void si_devsw_install();
#endif /*JREMOD*/
@@ -657,9 +659,6 @@ mem_fail:
}
done_chartimes = 1;
}
-#ifdef JREMOD
- si_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -2309,18 +2308,34 @@ struct cdevsw si_cdevsw =
static si_devsw_installed = 0;
-static void si_devsw_install()
+static void si_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! si_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&si_cdevsw,NULL);
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&si_cdevsw,NULL);
+ dev_chr = dev;
#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&si_bdevsw,NULL);
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&si_bdevsw,NULL);
#endif /*BDEV_MAJOR*/
si_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "si", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(sidev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,si_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index b8aa9e2..7cabae4 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.119 1995/11/21 09:15:04 bde Exp $
+ * $Id: sio.c,v 1.120 1995/11/28 09:41:47 julian Exp $
*/
#include "sio.h"
@@ -97,8 +97,10 @@
#define com_scr 7 /* scratch register for 16450-16550 (R/W) */
#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 28
-static void sio_devsw_install();
#endif /*JREMOD*/
@@ -883,9 +885,6 @@ determined_type: ;
s = spltty();
com_addr(unit) = com;
splx(s);
-#ifdef JREMOD
- sio_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -2574,18 +2573,28 @@ struct cdevsw sio_cdevsw =
static sio_devsw_installed = 0;
-static void sio_devsw_install()
+static void sio_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! sio_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&sio_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&sio_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&sio_cdevsw,NULL);
sio_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "sio", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(siodev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,sio_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NSIO > 0 */
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 77c1596..c89c975 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -33,6 +33,13 @@
#include <sys/snoop.h>
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 53
+#endif /*JREMOD*/
+
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
@@ -491,4 +498,36 @@ snpselect(dev, rw, p)
return 0;
}
+#ifdef JREMOD
+struct cdevsw snp_cdevsw =
+ { snpopen, snpclose, snpread, snpwrite, /*53*/
+ snpioctl, nostop, nullreset, nodevtotty,/* snoop */
+ snpselect, nommap, NULL };
+
+static snp_devsw_installed = 0;
+
+static void snp_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! snp_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&snp_cdevsw,NULL);
+ snp_devsw_installed = 1;
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "snp", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(snpdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,snp_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 050ba18..620ec9f 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -4,7 +4,7 @@
* v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993
* modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su>
*
- * $Id: spkr.c,v 1.17 1995/09/09 18:09:55 davidg Exp $
+ * $Id: spkr.c,v 1.18 1995/11/28 09:41:55 julian Exp $
*/
#include "speaker.h"
@@ -26,31 +26,13 @@
#ifdef JREMOD
#include <sys/conf.h>
#define CDEV_MAJOR 26
-static void spkr_devsw_install();
#endif /*JREMOD*/
-#if defined(DEVFS) || defined(JREMOD)
-#include "sys/kernel.h"
#ifdef DEVFS
#include <sys/devfsext.h>
-int spkropen();
#endif
-void spkrdev_init(void *data) /* data not used */
-{
- void * x;
-#ifdef JREMOD
- spkr_devsw_install();
-#endif /*JREMOD*/
-#ifdef DEVFS
-/* path name devsw minor type uid gid perm*/
- x=dev_add("/misc", "speaker", spkropen, 0, DV_CHR, 0, 0, 0600);
-#endif
-
-}
-SYSINIT(spkrdev,SI_SUB_DEVFS, SI_ORDER_ANY, spkrdev_init, NULL)
-#endif /*DEVFS*/ /* JREMOD */
/**************** MACHINE DEPENDENT PART STARTS HERE *************************
*
@@ -595,19 +577,29 @@ struct cdevsw spkr_cdevsw =
static spkr_devsw_installed = 0;
-static void spkr_devsw_install()
+static void spkr_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! spkr_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&spkr_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&spkr_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&spkr_cdevsw,NULL);
spkr_devsw_installed = 1;
- }
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "spkr", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NSPEAKER > 0 */
/* spkr.c ends here */
diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c
index 50cce3b..1062d4c 100644
--- a/sys/dev/vn/vn.c
+++ b/sys/dev/vn/vn.c
@@ -88,6 +88,16 @@
#include <sys/vnioctl.h>
+#ifdef JREMOD
+#include <sys/conf.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 43
+#define BDEV_MAJOR 15
+#endif /*JREMOD */
+
+
#ifdef DEBUG
int dovncluster = 1;
int vndebug = 0x00;
@@ -586,4 +596,46 @@ vndump(dev_t dev)
{
return (ENODEV);
}
+#ifdef JREMOD
+struct bdevsw vn_bdevsw =
+ { vnopen, vnclose, vnstrategy, vnioctl, /*15*/
+ vndump, vnsize, 0 };
+
+struct cdevsw vn_cdevsw =
+ { vnopen, vnclose, rawread, rawwrite, /*43*/
+ vnioctl, nostop, nullreset, nodevtotty,/* vn */
+ seltrue, nommap, vnstrategy };
+
+static vn_devsw_installed = 0;
+
+static void vn_drvinit(void *unused)
+{
+ dev_t dev;
+ dev_t dev_chr;
+
+ if( ! vn_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&vn_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&vn_bdevsw,NULL);
+ vn_devsw_installed = 1;
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name major minor type uid gid perm*/
+ "/", "rvn", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "vn", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(vndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,vn_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif
OpenPOWER on IntegriCloud