summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-11-28 09:42:06 +0000
committerjulian <julian@FreeBSD.org>1995-11-28 09:42:06 +0000
commit67727fc1c1ba60e0499be11f7f66fccf2d7844f6 (patch)
treee174e9f0c9e876a67737e66592206a42258e33ef /sys/dev
parent94df7c3a92e572fefe166ac28402d3b0d7e22200 (diff)
downloadFreeBSD-src-67727fc1c1ba60e0499be11f7f66fccf2d7844f6.zip
FreeBSD-src-67727fc1c1ba60e0499be11f7f66fccf2d7844f6.tar.gz
the second set of changes in a move towards getting devices to be
totally dynamic. this is only the devices in i386/isa I'll do more tomorrow. they're completely masked by #ifdef JREMOD at this stage... the eventual aim is that every driver will do a SYSINIT at startup BEFORE the probes, which will effectively link it into the devsw tables etc. If I'd thought about it more I'd have put that in in this set (damn) The ioconf lines generated by config will also end up in the device's own scope as well, so ioconf.c will eventually be gutted the SYSINIT call to the driver will include a phase where the driver links it's ioconf line into a chain of such. when this phase is done then the user can modify them with the boot: -c config menu if he wants, just like now.. config will put the config lines out in the .h file (e.g. in aha.h will be the addresses for the aha driver to look.) as I said this is a very small first step.. the aim of THIS set of edits is to not have to edit conf.c at all when adding a new device.. the tabe will be a simple skeleton.. when this is done, it will allow other changes to be made, all teh time still having a fully working kernel tree, but the logical outcome is the complete REMOVAL of the devsw tables. By the end of this, linked in drivers will be exactly the same as run-time loaded drivers, except they JUST HAPPEN to already be linked and present at startup.. the SYSINIT calls will be the equivalent of the "init" call made to a newly loaded driver in every respect. For this edit, each of the files has the following code inserted into it: obviously, tailored to suit.. ----------------------somewhere at the top: #ifdef JREMOD #include <sys/conf.h> #define CDEV_MAJOR 13 #define BDEV_MAJOR 4 static void sd_devsw_install(); #endif /*JREMOD */ ---------------------somewhere that's run during bootup: EVENTUALLY a SYSINIT #ifdef JREMOD sd_devsw_install(); #endif /*JREMOD*/ -----------------------at the bottom: #ifdef JREMOD struct bdevsw sd_bdevsw = { sdopen, sdclose, sdstrategy, sdioctl, /*4*/ sddump, sdsize, 0 }; struct cdevsw sd_cdevsw = { sdopen, sdclose, rawread, rawwrite, /*13*/ sdioctl, nostop, nullreset, nodevtotty,/* sd */ seltrue, nommap, sdstrategy }; static sd_devsw_installed = 0; static void sd_devsw_install() { dev_t descript; if( ! sd_devsw_installed ) { descript = makedev(CDEV_MAJOR,0); cdevsw_add(&descript,&sd_cdevsw,NULL); #if defined(BDEV_MAJOR) descript = makedev(BDEV_MAJOR,0); bdevsw_add(&descript,&sd_bdevsw,NULL); #endif /*BDEV_MAJOR*/ sd_devsw_installed = 1; } } #endif /* JREMOD */
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cy/cy.c34
-rw-r--r--sys/dev/cy/cy_isa.c34
-rw-r--r--sys/dev/fdc/fdc.c37
-rw-r--r--sys/dev/joy/joy.c33
-rw-r--r--sys/dev/mcd/mcd.c39
-rw-r--r--sys/dev/mse/mse.c34
-rw-r--r--sys/dev/rc/rc.c33
-rw-r--r--sys/dev/scd/scd.c39
-rw-r--r--sys/dev/si/si.c36
-rw-r--r--sys/dev/sio/sio.c34
-rw-r--r--sys/dev/speaker/spkr.c43
11 files changed, 385 insertions, 11 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index ce0816c..c2f3725 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.18 1995/11/04 17:07:14 bde Exp $
+ * $Id: cy.c,v 1.19 1995/11/26 17:13:23 bde Exp $
*/
#include "cy.h"
@@ -397,6 +397,11 @@ static int cy_nr_cd1400s[NCY];
#undef RxFifoThreshold
static int volatile RxFifoThreshold = (CD1400_RX_FIFO_SIZE / 2);
+#ifdef JREMOD
+#define CDEV_MAJOR 48
+static void cy_devsw_install();
+#endif /*JREMOD*/
+
static struct kern_devconf kdc_sio[NCY] = { {
0, 0, 0, /* filled in by dev_attach */
"cyc", 0, { MDDT_ISA, 0, "tty" },
@@ -437,6 +442,10 @@ 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) */
cy_inb(iobase, CY16_RESET); /* XXX? */
@@ -2511,4 +2520,27 @@ cystatus(unit)
}
#endif /* CyDebug */
+
+#ifdef JREMOD
+struct cdevsw cy_cdevsw =
+ { cyopen, cyclose, cyread, cywrite, /*48*/
+ cyioctl, cystop, nxreset, cydevtotty,/*cyclades*/
+ ttselect, nxmmap, NULL };
+
+static cy_devsw_installed = 0;
+
+static void cy_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ cy_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NCY > 0 */
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index ce0816c..c2f3725 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.18 1995/11/04 17:07:14 bde Exp $
+ * $Id: cy.c,v 1.19 1995/11/26 17:13:23 bde Exp $
*/
#include "cy.h"
@@ -397,6 +397,11 @@ static int cy_nr_cd1400s[NCY];
#undef RxFifoThreshold
static int volatile RxFifoThreshold = (CD1400_RX_FIFO_SIZE / 2);
+#ifdef JREMOD
+#define CDEV_MAJOR 48
+static void cy_devsw_install();
+#endif /*JREMOD*/
+
static struct kern_devconf kdc_sio[NCY] = { {
0, 0, 0, /* filled in by dev_attach */
"cyc", 0, { MDDT_ISA, 0, "tty" },
@@ -437,6 +442,10 @@ 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) */
cy_inb(iobase, CY16_RESET); /* XXX? */
@@ -2511,4 +2520,27 @@ cystatus(unit)
}
#endif /* CyDebug */
+
+#ifdef JREMOD
+struct cdevsw cy_cdevsw =
+ { cyopen, cyclose, cyread, cywrite, /*48*/
+ cyioctl, cystop, nxreset, cydevtotty,/*cyclades*/
+ ttselect, nxmmap, NULL };
+
+static cy_devsw_installed = 0;
+
+static void cy_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ cy_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NCY > 0 */
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 4601645..1af2cbf 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -43,7 +43,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.70 1995/11/18 07:48:11 bde Exp $
+ * $Id: fd.c,v 1.71 1995/11/20 12:41:38 phk Exp $
*
*/
@@ -87,6 +87,11 @@
#include <sys/devfsext.h>
#endif
+#ifdef JREMOD
+#define CDEV_MAJOR 9
+#define BDEV_MAJOR 2
+static void fd_devsw_install();
+#endif /*JREMOD */
static int fd_goaway(struct kern_devconf *, int);
static int fdc_goaway(struct kern_devconf *, int);
static int fd_externalize(struct kern_devconf *, struct sysctl_req *);
@@ -513,6 +518,9 @@ fdprobe(struct isa_device *dev)
#ifndef DEV_LKM
fdc_registerdev(dev);
#endif
+#ifdef JREMOD
+ fd_devsw_install();
+#endif /*JREMOD*/
/* First - lets reset the floppy controller */
outb(dev->id_iobase+FDOUT, 0);
@@ -1884,6 +1892,33 @@ fdioctl(dev, cmd, addr, flag, p)
return (error);
}
+
+#ifdef JREMOD
+struct bdevsw fd_bdevsw =
+ { Fdopen, fdclose, fdstrategy, fdioctl, /*2*/
+ nxdump, zerosize, 0 };
+
+struct cdevsw fd_cdevsw =
+ { Fdopen, fdclose, rawread, rawwrite, /*9*/
+ fdioctl, nostop, nullreset, nodevtotty,/* Fd (!=fd) */
+ seltrue, nommap, fdstrategy };
+
+static fd_devsw_installed = 0;
+
+static void fd_devsw_install()
+{
+ dev_t descript;
+ if( ! fd_devsw_installed ) {
+ descript = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&descript,&fd_cdevsw,NULL);
+#if defined(BDEV_MAJOR)
+ descript = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&descript,&fd_bdevsw,NULL);
+#endif /*BDEV_MAJOR*/
+ fd_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif
/*
* Hello emacs, these are the
diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c
index 8d0dc25..5870e62 100644
--- a/sys/dev/joy/joy.c
+++ b/sys/dev/joy/joy.c
@@ -41,6 +41,12 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#ifdef JREMOD
+#include <sys/conf.h>
+#define CDEV_MAJOR 51
+static void joy_devsw_install();
+#endif /*JREMOD*/
+
/* The game port can manage 4 buttons and 4 variable resistors (usually 2
* joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201.
* Getting the state of the buttons is done by reading the game port:
@@ -99,6 +105,10 @@ 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;
}
@@ -205,4 +215,27 @@ get_tick ()
return (high << 8) | low;
}
+
+#ifdef JREMOD
+struct cdevsw joy_cdevsw =
+ { joyopen, joyclose, joyread, nowrite, /*51*/
+ joyioctl, nostop, nullreset, nodevtotty,/*joystick */
+ seltrue, nommap, NULL};
+
+static joy_devsw_installed = 0;
+
+static void joy_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ joy_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NJOY > 0 */
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index 2b6b036..0571a93 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.47 1995/10/28 15:39:15 phk Exp $
+ * $Id: mcd.c,v 1.48 1995/11/04 13:23:35 bde Exp $
*/
static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -70,6 +70,12 @@ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
#include <i386/isa/isa_device.h>
#include <i386/isa/mcdreg.h>
+#ifdef JREMOD
+#define CDEV_MAJOR 29
+#define BDEV_MAJOR 7
+static void mcd_devsw_install();
+#endif /*JREMOD */
+
#define MCD_TRACE(format, args...) \
{ \
if (mcd_data[unit].debug) { \
@@ -256,6 +262,10 @@ 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;
}
@@ -1659,4 +1669,31 @@ mcd_resume(int unit)
return EINVAL;
return mcd_play(unit, &cd->lastpb);
}
+
+#ifdef JREMOD
+struct bdevsw mcd_bdevsw =
+ { mcdopen, mcdclose, mcdstrategy, mcdioctl, /*7*/
+ nxdump, mcdsize, 0 };
+
+struct cdevsw mcd_cdevsw =
+ { mcdopen, mcdclose, rawread, nowrite, /*29*/
+ mcdioctl, nostop, nullreset, nodevtotty,/* mitsumi cd */
+ seltrue, nommap, mcdstrategy };
+
+static mcd_devsw_installed = 0;
+
+static void mcd_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ mcd_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NMCD > 0 */
diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c
index b1484d1..5499a2a 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.14 1995/09/08 11:07:50 bde Exp $
+ * $Id: mse.c,v 1.15 1995/11/04 17:07:37 bde Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -61,6 +61,12 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/icu.h>
+#ifdef JREMOD
+#include <sys/conf.h>
+#define CDEV_MAJOR 27
+static void mse_devsw_install();
+#endif /*JREMOD*/
+
static int mseprobe(struct isa_device *);
static int mseattach(struct isa_device *);
@@ -233,6 +239,9 @@ 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);
}
@@ -565,4 +574,27 @@ mse_getati(port, dx, dy, but)
outb(port + MSE_PORTA, MSE_INPORT_MODE);
outb(port + MSE_PORTB, MSE_INPORT_INTREN);
}
+
+#ifdef JREMOD
+struct cdevsw mse_cdevsw =
+ { mseopen, mseclose, mseread, nowrite, /*27*/
+ noioc, nostop, nullreset, nodevtotty,/* mse */
+ mseselect, nommap, NULL };
+
+static mse_devsw_installed = 0;
+
+static void mse_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ mse_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NMSE */
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 0feabf0..6203aff 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -58,6 +58,12 @@
#include <i386/isa/ic/cd180.h>
#include <i386/isa/rcreg.h>
+#ifdef JREMOD
+#include <sys/conf.h>
+#define CDEV_MAJOR 63
+static void rc_devsw_install();
+#endif /*JREMOD*/
+
/* Prototypes */
int rcprobe __P((struct isa_device *));
int rcattach __P((struct isa_device *));
@@ -277,6 +283,10 @@ int rcattach(dvp)
rc_wakeup((void *)NULL);
rc_wakeup_started = 0;
}
+#ifdef JREMOD
+ rc_devsw_install();
+#endif /*JREMOD*/
+
return 1;
}
@@ -1492,4 +1502,27 @@ rc_wait0(nec, unit, chan, line)
printf("rc%d/%d: channel command timeout, rc.c line: %d\n",
unit, chan, line);
}
+
+#ifdef JREMOD
+struct cdevsw rc_cdevsw =
+ { rcopen, rcclose, rcread, rcwrite, /*63*/
+ rcioctl, rcstop, nxreset, rcdevtotty,/* rc */
+ ttselect, nommap, NULL };
+
+static rc_devsw_installed = 0;
+
+static void rc_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ rc_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NRC */
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index c7bbe07..7d4fdec 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.8 1995/10/28 15:39:17 phk Exp $ */
+/* $Id: scd.c,v 1.9 1995/11/04 13:23:39 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -72,6 +72,12 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/scdreg.h>
+#ifdef JREMOD
+#define CDEV_MAJOR 45
+#define BDEV_MAJOR 16
+static void scd_devsw_install();
+#endif /*JREMOD */
+
#define scd_part(dev) ((minor(dev)) & 7)
#define scd_unit(dev) (((minor(dev)) & 0x38) >> 3)
#define scd_phys(dev) (((minor(dev)) & 0x40) >> 6)
@@ -218,6 +224,10 @@ 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;
}
@@ -1519,4 +1529,31 @@ scd_toc_entrys (int unit, struct ioc_read_toc_entry *te)
return 0;
}
+#ifdef JREMOD
+struct bdevsw scd_bdevsw =
+ { scdopen, scdclose, scdstrategy, scdioctl, /*16*/
+ nxdump, scdsize, 0 };
+
+struct cdevsw scd_cdevsw =
+ { scdopen, scdclose, rawread, nowrite, /*45*/
+ scdioctl, nostop, nullreset, nodevtotty,/* sony cd */
+ seltrue, nommap, scdstrategy };
+
+static scd_devsw_installed = 0;
+
+static void scd_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ scd_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
+
#endif /* NSCD > 0 */
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index c022248..93accc2 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.15 1995/11/28 02:07:34 peter Exp $
+ * $Id: si.c,v 1.16 1995/11/28 07:29:29 bde Exp $
*/
#ifndef lint
@@ -81,6 +81,12 @@ static char si_copyright1[] = "@(#) (C) Specialix International, 1990,1992",
enum si_mctl { GET, SET, BIS, BIC };
+#ifdef JREMOD
+#define CDEV_MAJOR 68
+static void si_devsw_install();
+#endif /*JREMOD*/
+
+
static void si_command __P((struct si_port *, int, int));
static int si_modem __P((struct si_port *, enum si_mctl, int));
static void si_write_enable __P((struct si_port *, int));
@@ -651,6 +657,10 @@ mem_fail:
}
done_chartimes = 1;
}
+#ifdef JREMOD
+ si_devsw_install();
+#endif /*JREMOD*/
+
return (1);
}
@@ -2289,4 +2299,28 @@ si_mctl2str(cmd)
}
return("BAD");
}
+
+
+#ifdef JREMOD
+struct cdevsw si_cdevsw =
+ { siopen, siclose, siread, siwrite, /*68*/
+ siioctl, sistop, nxreset, sidevtotty,/* si */
+ ttselect, nxmmap, NULL };
+
+static si_devsw_installed = 0;
+
+static void si_devsw_install()
+{
+ dev_t descript;
+ if( ! si_devsw_installed ) {
+ descript = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&descript,&si_cdevsw,NULL);
+#if defined(BDEV_MAJOR)
+ descript = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&descript,&si_bdevsw,NULL);
+#endif /*BDEV_MAJOR*/
+ si_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index cf18650..b8aa9e2 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.118 1995/11/20 12:13:27 phk Exp $
+ * $Id: sio.c,v 1.119 1995/11/21 09:15:04 bde Exp $
*/
#include "sio.h"
@@ -96,6 +96,12 @@
#define com_scr 7 /* scratch register for 16450-16550 (R/W) */
+#ifdef JREMOD
+#define CDEV_MAJOR 28
+static void sio_devsw_install();
+#endif /*JREMOD*/
+
+
#include "crd.h"
#if NCRD > 0
#include <pccard/card.h>
@@ -877,6 +883,10 @@ determined_type: ;
s = spltty();
com_addr(unit) = com;
splx(s);
+#ifdef JREMOD
+ sio_devsw_install();
+#endif /*JREMOD*/
+
return (1);
}
@@ -2556,4 +2566,26 @@ error:
}
#endif /* DSI_SOFT_MODEM */
+#ifdef JREMOD
+struct cdevsw sio_cdevsw =
+ { sioopen, sioclose, sioread, siowrite, /*28*/
+ sioioctl, siostop, nxreset, siodevtotty,/* sio */
+ ttselect, nommap, NULL };
+
+static sio_devsw_installed = 0;
+
+static void sio_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ sio_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NSIO > 0 */
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 82a7021..050ba18 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.16 1995/09/08 11:07:59 bde Exp $
+ * $Id: spkr.c,v 1.17 1995/09/09 18:09:55 davidg Exp $
*/
#include "speaker.h"
@@ -23,19 +23,34 @@
#include <machine/clock.h>
#include <machine/speaker.h>
+#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>
-#include "sys/kernel.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*/
+#endif /*DEVFS*/ /* JREMOD */
/**************** MACHINE DEPENDENT PART STARTS HERE *************************
*
@@ -572,5 +587,27 @@ struct proc *p;
return(EINVAL);
}
+#ifdef JREMOD
+struct cdevsw spkr_cdevsw =
+ { spkropen, spkrclose, noread, spkrwrite, /*26*/
+ spkrioctl, nostop, nullreset, nodevtotty,/* spkr */
+ seltrue, nommap, NULL };
+
+static spkr_devsw_installed = 0;
+
+static void spkr_devsw_install()
+{
+ dev_t descript;
+ 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*/
+ spkr_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NSPEAKER > 0 */
/* spkr.c ends here */
OpenPOWER on IntegriCloud