summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/asc.c47
-rw-r--r--sys/i386/isa/b004.c37
-rw-r--r--sys/i386/isa/ctx.c40
-rw-r--r--sys/i386/isa/cx.c32
-rw-r--r--sys/i386/isa/cy.c38
-rw-r--r--sys/i386/isa/gpib.c36
-rw-r--r--sys/i386/isa/gsc.c38
-rw-r--r--sys/i386/isa/if_cx.c19
-rw-r--r--sys/i386/isa/joy.c37
-rw-r--r--sys/i386/isa/labpc.c37
-rw-r--r--sys/i386/isa/lpt.c38
-rw-r--r--sys/i386/isa/matcd/matcd.c42
-rw-r--r--sys/i386/isa/mcd.c45
-rw-r--r--sys/i386/isa/mse.c38
-rw-r--r--sys/i386/isa/pcaudio.c39
-rw-r--r--sys/i386/isa/psm.c36
-rw-r--r--sys/i386/isa/rc.c37
-rw-r--r--sys/i386/isa/scd.c45
-rw-r--r--sys/i386/isa/si.c39
-rw-r--r--sys/i386/isa/sio.c37
-rw-r--r--sys/i386/isa/sound/soundcard.c42
-rw-r--r--sys/i386/isa/spigot.c36
-rw-r--r--sys/i386/isa/spkr.c48
-rw-r--r--sys/i386/isa/tw.c36
-rw-r--r--sys/i386/isa/wcd.c41
-rw-r--r--sys/i386/isa/wd.c44
-rw-r--r--sys/i386/isa/wt.c43
27 files changed, 662 insertions, 385 deletions
diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c
index 18a02c2..cd28619 100644
--- a/sys/i386/isa/asc.c
+++ b/sys/i386/isa/asc.c
@@ -34,7 +34,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
- * $Id: asc.c,v 1.5 1995/09/08 19:01:28 julian Exp $
+ * $Id: asc.c,v 1.6 1995/11/28 09:40:39 julian Exp $
*/
#include "asc.h"
@@ -76,16 +76,15 @@
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/ascreg.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-extern d_open_t ascopen;
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 71
-static void asc_devsw_install();
#endif /*JREMOD*/
-#endif
#endif /* FREEBSD_1_X */
@@ -434,11 +433,6 @@ ascprobe (struct isa_device *isdp)
scu->flags &= ~DEBUG;
scu->icnt = 0;
-
-#ifdef JREMOD
- asc_devsw_install();
-#endif /*JREMOD*/
-
return PROBE_SUCCESS;
}
@@ -869,6 +863,7 @@ ascselect(dev_t dev, int rw, struct proc *p)
return 0;
}
+
#ifdef JREMOD
struct cdevsw asc_cdevsw =
{ ascopen, ascclose, ascread, nowrite, /*71*/
@@ -877,18 +872,34 @@ struct cdevsw asc_cdevsw =
static asc_devsw_installed = 0;
-static void asc_devsw_install()
+static void asc_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! asc_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&asc_cdevsw,NULL);
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&asc_cdevsw,NULL);
+ dev_chr = dev;
#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&asc_bdevsw,NULL);
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&asc_bdevsw,NULL);
#endif /*BDEV_MAJOR*/
asc_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*/
+ "/", "asc", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(ascdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,asc_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NASC > 0 */
diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c
index fd2910d..b59d9d7 100644
--- a/sys/i386/isa/b004.c
+++ b/sys/i386/isa/b004.c
@@ -62,8 +62,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 8
-static void bqu_devsw_install();
#endif /*JREMOD*/
static u_char d_inb(u_int port);
@@ -577,9 +580,6 @@ printf("bquprobe::\nIOBASE 0x%x\nIRQ %d\nDRQ %d\nMSIZE %d\nUNIT %d\nFLAGS x0%x\n
#ifndef DEV_LKM
bqu_registerdev(idp);
#endif /* not DEV_LKM */
-#ifdef JREMOD
- bqu_devsw_install();
-#endif /*JREMOD*/
for (test = 0; (test < B004_CHANCE); test++) {
@@ -635,6 +635,7 @@ printf("bquprobe::\nIOBASE 0x%x\nIRQ %d\nDRQ %d\nMSIZE %d\nUNIT %d\nFLAGS x0%x\n
return(20);
} /* bquprobe() */
+
#ifdef JREMOD
struct cdevsw bqu_cdevsw =
{ bquopen, bquclose, bquread, bquwrite, /*8*/
@@ -643,18 +644,28 @@ struct cdevsw bqu_cdevsw =
static bqu_devsw_installed = 0;
-static void bqu_devsw_install()
+static void bqu_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! bqu_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&bqu_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&bqu_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&bqu_cdevsw,NULL);
bqu_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*/
+ "/", "bqu", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(bqudev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bqu_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NBQU */
diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c
index c1edbf1..0684d3d 100644
--- a/sys/i386/isa/ctx.c
+++ b/sys/i386/isa/ctx.c
@@ -8,7 +8,7 @@
* of this software, nor does the author assume any responsibility
* for damages incurred with its use.
*
- * $Id: ctx.c,v 1.7 1995/09/08 11:07:34 bde Exp $
+ * $Id: ctx.c,v 1.8 1995/11/28 09:40:48 julian Exp $
*/
/*
@@ -128,9 +128,13 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 40
-static void ctx_devsw_install();
#endif /*JREMOD*/
+
int waitvb(short);
/* state flags */
@@ -191,9 +195,6 @@ ctxprobe(struct isa_device * devp)
status = 0;
else {
status = 1; /*XXX uses only one port? */
-#ifdef JREMOD
- ctx_devsw_install();
-#endif /*JREMOD*/
}
return (status);
}
@@ -448,6 +449,8 @@ waitvb(short port)
return (0);
}
+
+
#ifdef JREMOD
struct cdevsw ctx_cdevsw =
{ ctxopen, ctxclose, ctxread, ctxwrite, /*40*/
@@ -456,19 +459,28 @@ struct cdevsw ctx_cdevsw =
static ctx_devsw_installed = 0;
-static void ctx_devsw_install()
+static void ctx_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! ctx_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&ctx_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&ctx_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&ctx_cdevsw,NULL);
ctx_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*/
+ "/", "ctx", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(ctxdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ctx_drvinit,NULL)
+
#endif /* JREMOD */
#endif /* NCTX > 0 */
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index a3f941e..3a606bc 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -41,7 +41,9 @@
# else /* BSD 4.4 Lite */
# ifdef JREMOD
# define CDEV_MAJOR 42
- void cx_devsw_install(); /* can't be static, needed in if_cx.c */
+# if defined(DEVFS)
+# include <sys/devfsext.h>
+# endif /*DEVFS*/
# endif /*JREMOD*/
# include <sys/devconf.h>
# endif
@@ -974,18 +976,28 @@ struct cdevsw cx_cdevsw =
static cx_devsw_installed = 0;
-void cx_devsw_install()
+static void cx_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! cx_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&cx_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&cx_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&cx_cdevsw,NULL);
cx_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*/
+ "/", "cx", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(cxdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cx_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NCX */
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index c2f3725..c4739ae 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/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/i386/isa/gpib.c b/sys/i386/isa/gpib.c
index 8cbb0b7..2e511bf 100644
--- a/sys/i386/isa/gpib.c
+++ b/sys/i386/isa/gpib.c
@@ -49,10 +49,14 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 44
-static void gp_devsw_install();
#endif /*JREMOD*/
+
int initgpib(void);
void closegpib(void);
int sendgpibfifo(unsigned char device,char *data,int count);
@@ -129,9 +133,6 @@ gpattach(isdp)
if (sc->sc_type==1)
printf ("gp%d: type AT-GPIB chip NAT4882A\n",sc->sc_unit);
sc->sc_flags |=ATTACHED;
-#ifdef JREMOD
- gp_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -1271,19 +1272,28 @@ struct cdevsw gp_cdevsw =
static gp_devsw_installed = 0;
-static void gp_devsw_install()
+static void gp_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! gp_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&gp_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&gp_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&gp_cdevsw,NULL);
gp_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*/
+ "/", "gp", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(gpdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,gp_drvinit,NULL)
+
#endif /* JREMOD */
#endif /* NGPIB > 0 */
diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c
index 7abe841..84a9aa0 100644
--- a/sys/i386/isa/gsc.c
+++ b/sys/i386/isa/gsc.c
@@ -59,9 +59,12 @@
***********************************************************************/
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 47
-static void gsc_devsw_install();
-#endif /*JREMOD*/ /* clean up later */
+#endif /*JREMOD*/
#define PROBE_FAIL 0
#define PROBE_SUCCESS 1
@@ -504,9 +507,6 @@ gscattach(struct isa_device *isdp)
scu->flags |= ATTACHED;
lprintf("gsc%d.attach: ok\n", unit);
scu->flags &= ~DEBUG;
-#ifdef JREMOD
- gsc_devsw_install();
-#endif /*JREMOD*/
return SUCCESS; /* attach must not fail */
}
@@ -790,18 +790,28 @@ struct cdevsw gsc_cdevsw =
static gsc_devsw_installed = 0;
-static void gsc_devsw_install()
+static void gsc_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! gsc_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&gsc_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&gsc_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&gsc_cdevsw,NULL);
gsc_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*/
+ "/", "gsc", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(gscdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,gsc_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NGSC > 0 */
diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c
index aff2fce..59e25ed 100644
--- a/sys/i386/isa/if_cx.c
+++ b/sys/i386/isa/if_cx.c
@@ -44,6 +44,10 @@
# if __FreeBSD__ < 2
# include <machine/pio.h>
# else
+# ifdef DEVFS
+# include <sys/devfsext.h>
+# endif /*DEVFS*/
+# define CDEV_MAJOR 42 /*XXX*/ /* replace with variable ASAP*/
# include <sys/devconf.h>
# endif
# define init_func_t void(*)(int)
@@ -220,7 +224,6 @@ static struct mbuf *makembuf (void *buf, unsigned len)
* Test the presence of the adapter on the given i/o port.
*/
#ifdef __FreeBSD__
-extern void cx_devsw_install();
int cxprobe (struct isa_device *id)
{
int unit = id->id_unit;
@@ -266,9 +269,6 @@ int cxprobe (struct device *parent, struct cfdata *cf, void *aux)
}
if (! cx_probe_board (iobase))
return (0);
-#ifdef JREMOD
- cx_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -373,6 +373,15 @@ void cxattach (struct device *parent, struct device *self, void *aux)
#endif
#ifdef __FreeBSD__
printf ("cx%d: <Cronyx-%s>\n", unit, b->name);
+#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*/
+ "/", "cx", major(CDEV_MAJOR), 0, DV_CHR, 0, 0, 0600);
+ }
+#endif
return (1);
#endif
#ifdef __bsdi__
@@ -981,3 +990,5 @@ void cxswitch (cx_chan_t *c, cx_soft_opt_t new)
c->sopt = new;
}
#endif /* NCX */
+
+
diff --git a/sys/i386/isa/joy.c b/sys/i386/isa/joy.c
index 5870e62..e90e90f 100644
--- a/sys/i386/isa/joy.c
+++ b/sys/i386/isa/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/i386/isa/labpc.c b/sys/i386/isa/labpc.c
index 9d0cf7f..38e6c62 100644
--- a/sys/i386/isa/labpc.c
+++ b/sys/i386/isa/labpc.c
@@ -61,8 +61,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 66
-static void labpc_devsw_install();
#endif /*JREMOD*/
@@ -501,10 +504,6 @@ int labpcattach(struct isa_device *dev)
ctlr->dcr_val = 0x80;
ctlr->dcr_is = 0x80;
loutb(DCR(ctlr), ctlr->dcr_val);
-#ifdef JREMOD
- labpc_devsw_install();
-#endif /*JREMOD*/
-
return 1;
}
@@ -1116,17 +1115,27 @@ struct cdevsw labpc_cdevsw =
static labpc_devsw_installed = 0;
-static void labpc_devsw_install()
+static void labpc_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! labpc_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&labpc_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&labpc_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&labpc_cdevsw,NULL);
labpc_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*/
+ "/", "labpc", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(labpcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,labpc_drvinit,NULL)
+
#endif /* JREMOD */
+
diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c
index 67cbddb..cea3df6 100644
--- a/sys/i386/isa/lpt.c
+++ b/sys/i386/isa/lpt.c
@@ -46,7 +46,7 @@
* SUCH DAMAGE.
*
* from: unknown origin, 386BSD 0.1
- * $Id: lpt.c,v 1.39 1995/11/28 09:41:18 julian Exp $
+ * $Id: lpt.c,v 1.40 1995/11/29 10:17:03 phk Exp $
*/
/*
@@ -140,8 +140,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 16
-static void lpt_devsw_install();
#endif /*JREMOD*/
#define LPINITRDY 4 /* wait up to 4 seconds for a ready */
@@ -442,9 +445,6 @@ lptattach(struct isa_device *isdp)
lprintf("irq %x\n", sc->sc_irq);
kdc_lpt[isdp->id_unit].kdc_state = DC_IDLE;
-#ifdef JREMOD
- lpt_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -1160,17 +1160,27 @@ struct cdevsw lpt_cdevsw =
static lpt_devsw_installed = 0;
-static void lpt_devsw_install()
+static void lpt_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! lpt_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&lpt_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&lpt_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&lpt_cdevsw,NULL);
lpt_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*/
+ "/", "lpt", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(lptdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,lpt_drvinit,NULL)
+
#endif /* JREMOD */
+
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index 03ae212..477b9d5 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -493,9 +493,12 @@ static struct kern_devconf kdc_matcd[TOTALDRIVES] = { { /*<12>*/
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 46
#define BDEV_MAJOR 17
-static void matcd_devsw_install();
#endif /*JREMOD */
#endif /*FREE2*/
@@ -1472,9 +1475,6 @@ int matcd_attach(struct isa_device *dev)
}
nextcontroller++; /*Bump ctlr assign to next number*/
printf("\n"); /*End line of drive reports*/
-#ifdef JREMOD
- matcd_devsw_install();
-#endif /*JREMOD*/
return(1);
}
@@ -2761,19 +2761,35 @@ struct cdevsw matcd_cdevsw =
static matcd_devsw_installed = 0;
-static void matcd_devsw_install()
+static void matcd_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! matcd_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&matcd_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&matcd_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&matcd_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&matcd_bdevsw,NULL);
matcd_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*/
+ "/", "rmatcd", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "matcd", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(matcddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,matcd_drvinit,NULL)
+
#endif /* JREMOD */
+
/*End of matcd.c*/
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index 0571a93..4ab0b9c 100644
--- a/sys/i386/isa/mcd.c
+++ b/sys/i386/isa/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/i386/isa/mse.c b/sys/i386/isa/mse.c
index 5499a2a..52195fb 100644
--- a/sys/i386/isa/mse.c
+++ b/sys/i386/isa/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/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c
index a6f006a..90fb125 100644
--- a/sys/i386/isa/pcaudio.c
+++ b/sys/i386/isa/pcaudio.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcaudio.c,v 1.17 1995/11/16 09:56:02 bde Exp $
+ * $Id: pcaudio.c,v 1.18 1995/11/28 09:41:27 julian Exp $
*/
#include "pca.h"
@@ -50,8 +50,12 @@
#include <i386/isa/sound/ulaw.h>
#ifdef JREMOD
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 24
-static void pca_devsw_install();
#endif /*JREMOD*/
#define BUF_SIZE 8192
@@ -247,14 +251,13 @@ pca_registerdev(struct isa_device *id)
}
#ifdef DEVFS
-#include <sys/devfsext.h>
-void pcadev_init(caddr_t data) /* data not used */
+void pcadevfs_init(caddr_t data) /* data not used */
{
void * x;
/* path name devsw minor type uid gid perm*/
- x=dev_add("/misc", "pcaudio", pcaopen, 0, DV_CHR, 0, 0, 0666);
- x=dev_add("/misc", "pcaudioctl", pcaopen, 128, DV_CHR, 0, 0, 0666);
+ x=devfs_add_devsw("/", "pcaudio", CDEV_MAJOR, 0, DV_CHR, 0, 0, 0666);
+ x=devfs_add_devsw("/", "pcaudioctl", CDEV_MAJOR, 128, DV_CHR, 0, 0, 0666);
}
#endif /*DEVFS*/
@@ -265,11 +268,8 @@ pcaattach(struct isa_device *dvp)
printf("pca%d: PC speaker audio driver\n", dvp->id_unit);
pca_init();
pca_registerdev(dvp);
-#ifdef JREMOD
- pca_devsw_install();
-#endif /*JREMOD*/
#ifdef DEVFS
- pcadev_init(NULL);
+ pcadevfs_init(NULL);
#endif /*DEVFS*/
return 1;
@@ -495,18 +495,19 @@ struct cdevsw pca_cdevsw =
static pca_devsw_installed = 0;
-static void pca_devsw_install()
+static void pca_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! pca_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&pca_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&pca_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&pca_cdevsw,NULL);
pca_devsw_installed = 1;
- }
+ }
}
+
+SYSINIT(pcadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,pca_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif
diff --git a/sys/i386/isa/psm.c b/sys/i386/isa/psm.c
index 14b35e4..81d492e 100644
--- a/sys/i386/isa/psm.c
+++ b/sys/i386/isa/psm.c
@@ -68,8 +68,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 21
-static void psm_devsw_install();
#endif /*JREMOD*/
#define DATA 0 /* Offset for data port, read-write */
@@ -204,10 +207,6 @@ int psmattach(struct isa_device *dvp)
sc->state = 0;
-#ifdef JREMOD
- psm_devsw_install();
-#endif /*JREMOD*/
-
/* Done */
return(0); /* XXX eh? usually 1 indicates success */
@@ -476,19 +475,28 @@ struct cdevsw psm_cdevsw =
static psm_devsw_installed = 0;
-static void psm_devsw_install()
+static void psm_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! psm_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&psm_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&psm_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&psm_cdevsw,NULL);
psm_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*/
+ "/", "psm", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(psmdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,psm_drvinit,NULL)
+
#endif /* JREMOD */
#endif
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index 6203aff..e1d80cb 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/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/i386/isa/scd.c b/sys/i386/isa/scd.c
index 7d4fdec..0e2a130 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/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/i386/isa/si.c b/sys/i386/isa/si.c
index 93accc2..7b58916 100644
--- a/sys/i386/isa/si.c
+++ b/sys/i386/isa/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/i386/isa/sio.c b/sys/i386/isa/sio.c
index b8aa9e2..7cabae4 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/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/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c
index d417c30..dd6fe32 100644
--- a/sys/i386/isa/sound/soundcard.c
+++ b/sys/i386/isa/sound/soundcard.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: soundcard.c,v 1.31 1995/11/28 09:43:45 julian Exp $
+ * $Id: soundcard.c,v 1.32 1995/11/29 01:07:52 jkh Exp $
*/
#include "sound_config.h"
@@ -38,8 +38,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 30
-static void snd_devsw_install();
#endif /*JREMOD*/
@@ -352,10 +355,6 @@ sndattach (struct isa_device *dev)
}
#endif
-#ifdef JREMOD
- snd_devsw_install();
-#endif /*JREMOD*/
-
return TRUE;
}
@@ -484,6 +483,7 @@ snd_release_irq(int vect)
{
}
+#endif
#ifdef JREMOD
struct cdevsw snd_cdevsw =
{ sndopen, sndclose, sndread, sndwrite, /*30*/
@@ -492,18 +492,28 @@ struct cdevsw snd_cdevsw =
static snd_devsw_installed = 0;
-static void snd_devsw_install()
+static void snd_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! snd_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&snd_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&snd_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&snd_cdevsw,NULL);
+ dev_chr = dev;
snd_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*/
+ "/", "snd", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(snddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,snd_drvinit,NULL)
+
#endif /* JREMOD */
-#endif
+
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c
index 093c30e..610c220 100644
--- a/sys/i386/isa/spigot.c
+++ b/sys/i386/isa/spigot.c
@@ -72,8 +72,10 @@ error "Can only have 1 spigot configured."
#ifdef JREMOD
#include <sys/conf.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 11
-static void spigot_devsw_install();
#endif /*JREMOD*/
struct spigot_softc {
@@ -158,10 +160,6 @@ struct spigot_softc *ss=(struct spigot_softc *)&spigot_softc[devp->id_unit];
ss->maddr = kvtop(devp->id_maddr);
ss->irq = devp->id_irq;
-#ifdef JREMOD
- spigot_devsw_install();
-#endif /*JREMOD*/
-
return 1;
}
@@ -285,6 +283,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[0];
return i386_btop(ss->maddr);
}
+
#ifdef JREMOD
struct cdevsw spigot_cdevsw =
{ spigot_open, spigot_close, spigot_read, spigot_write, /*11*/
@@ -293,19 +292,28 @@ struct cdevsw spigot_cdevsw =
static spigot_devsw_installed = 0;
-static void spigot_devsw_install()
+static void spigot_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! spigot_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&spigot_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&spigot_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&spigot_cdevsw,NULL);
spigot_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*/
+ "/", "spigot", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(spigotdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spigot_drvinit,NULL)
+
#endif /* JREMOD */
#endif /* NSPIGOT */
diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c
index 050ba18..620ec9f 100644
--- a/sys/i386/isa/spkr.c
+++ b/sys/i386/isa/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/i386/isa/tw.c b/sys/i386/isa/tw.c
index 7b5dbcc..c672047 100644
--- a/sys/i386/isa/tw.c
+++ b/sys/i386/isa/tw.c
@@ -149,10 +149,14 @@
#ifdef JREMOD
#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 19
-static void tw_devsw_install();
#endif /*JREMOD*/
+
/*
* Transmission is done by calling write() to send three byte packets of data.
* The first byte contains a four bit house code (0=A to 15=P).
@@ -348,9 +352,6 @@ int twattach(idp)
sc = &tw_sc[idp->id_unit];
sc->sc_port = idp->id_iobase;
sc->sc_state = 0;
-#ifdef JREMOD
- tw_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -999,19 +1000,28 @@ struct cdevsw tw_cdevsw =
static tw_devsw_installed = 0;
-static void tw_devsw_install()
+static void tw_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+
if( ! tw_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&tw_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&tw_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&tw_cdevsw,NULL);
tw_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*/
+ "/", "tw", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(twdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,tw_drvinit,NULL)
+
#endif /* JREMOD */
#endif NTW
diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c
index 527d14a..bb7d4db 100644
--- a/sys/i386/isa/wcd.c
+++ b/sys/i386/isa/wcd.c
@@ -34,9 +34,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 69
#define BDEV_MAJOR 19
-static void wcd_devsw_install();
#endif /*JREMOD */
extern int wcdattach(struct atapi*, int, struct atapi_params*, int, struct kern_devconf*);
@@ -322,9 +324,6 @@ wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug,
strncpy (t->description + strlen(t->description),
ap->model, sizeof(ap->model));
dev_attach (&t->cf);
-#ifdef JREMOD
- wcd_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -1182,19 +1181,35 @@ struct cdevsw wcd_cdevsw =
static wcd_devsw_installed = 0;
-static void wcd_devsw_install()
+static void wcd_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! wcd_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&wcd_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&wcd_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&wcd_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&wcd_bdevsw,NULL);
wcd_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*/
+ "/", "rwcd", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "wcd", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(wcddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wcd_drvinit,NULL)
+
#endif /* JREMOD */
#endif /* NWCD && NWDC && ATAPI */
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 1b00118..f55eab6 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.92 1995/11/23 07:24:41 dyson Exp $
+ * $Id: wd.c,v 1.93 1995/11/28 09:42:03 julian Exp $
*/
/* TODO:
@@ -106,9 +106,11 @@ extern void wdstart(int ctrlr);
#define WDOPT_MULTIMASK 0x00ff
#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 3
#define BDEV_MAJOR 0
-static void wd_devsw_install();
#endif /*JREMOD */
static int wd_goaway(struct kern_devconf *, int);
@@ -320,10 +322,6 @@ wdprobe(struct isa_device *dvp)
du->dk_port = dvp->id_iobase;
wdc_registerdev(dvp);
-#ifdef JREMOD
- wd_devsw_install();
-#endif /*JREMOD*/
-
/* check if we have registers that work */
outb(du->dk_port + wd_sdh, WDSD_IBM); /* set unit 0 */
@@ -2138,18 +2136,34 @@ struct cdevsw wd_cdevsw =
static wd_devsw_installed = 0;
-static void wd_devsw_install()
+static void wd_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! wd_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&wd_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&wd_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&wd_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&wd_bdevsw,NULL);
wd_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*/
+ "/", "rwd", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "wd", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(wddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wd_drvinit,NULL)
+
#endif /* JREMOD */
+
#endif /* NWDC > 0 */
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index 8a4e609d..6420f4c 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -19,7 +19,7 @@
* the original CMU copyright notice.
*
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
- * $Id: wt.c,v 1.20 1995/10/28 15:39:31 phk Exp $
+ * $Id: wt.c,v 1.21 1995/11/28 09:42:06 julian Exp $
*
*/
@@ -78,9 +78,11 @@
#ifdef JREMOD
#include <sys/conf.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
#define CDEV_MAJOR 10
#define BDEV_MAJOR 3
-static void wt_devsw_install();
#endif /*JREMOD */
/*
@@ -268,9 +270,6 @@ wtattach (struct isa_device *id)
t->flags = TPSTART; /* tape is rewound */
t->dens = -1; /* unknown density */
kdc_wt[id->id_unit].kdc_state = DC_IDLE;
-#ifdef JREMOD
- wt_devsw_install();
-#endif /*JREMOD*/
return (1);
}
@@ -975,6 +974,7 @@ static int wtstatus (wtinfo_t *t)
return (1);
}
+
#ifdef JREMOD
struct bdevsw wt_bdevsw =
{ wtopen, wtclose, wtstrategy, wtioctl, /*3*/
@@ -987,19 +987,34 @@ struct cdevsw wt_cdevsw =
static wt_devsw_installed = 0;
-static void wt_devsw_install()
+static void wt_drvinit(void *unused)
{
- dev_t descript;
+ dev_t dev;
+ dev_t dev_chr;
+
if( ! wt_devsw_installed ) {
- descript = makedev(CDEV_MAJOR,0);
- cdevsw_add(&descript,&wt_cdevsw,NULL);
-#if defined(BDEV_MAJOR)
- descript = makedev(BDEV_MAJOR,0);
- bdevsw_add(&descript,&wt_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&wt_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&wt_bdevsw,NULL);
wt_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*/
+ "/", "rwt", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "wt", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
}
+
+SYSINIT(wtdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wt_drvinit,NULL)
+
#endif /* JREMOD */
#endif /* NWT */
OpenPOWER on IntegriCloud