diff options
author | julian <julian@FreeBSD.org> | 1995-11-28 09:42:06 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1995-11-28 09:42:06 +0000 |
commit | 67727fc1c1ba60e0499be11f7f66fccf2d7844f6 (patch) | |
tree | e174e9f0c9e876a67737e66592206a42258e33ef /sys | |
parent | 94df7c3a92e572fefe166ac28402d3b0d7e22200 (diff) | |
download | FreeBSD-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')
40 files changed, 1351 insertions, 32 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 */ diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c index 4e994d9..18a02c2 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.4 1995/09/08 18:30:33 julian Exp $ + * $Id: asc.c,v 1.5 1995/09/08 19:01:28 julian Exp $ */ #include "asc.h" @@ -80,6 +80,11 @@ #include <sys/devfsext.h> extern d_open_t ascopen; +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 71 +static void asc_devsw_install(); +#endif /*JREMOD*/ #endif #endif /* FREEBSD_1_X */ @@ -430,6 +435,10 @@ ascprobe (struct isa_device *isdp) scu->flags &= ~DEBUG; scu->icnt = 0; +#ifdef JREMOD + asc_devsw_install(); +#endif /*JREMOD*/ + return PROBE_SUCCESS; } @@ -859,4 +868,27 @@ ascselect(dev_t dev, int rw, struct proc *p) splx(sps); return 0; } + +#ifdef JREMOD +struct cdevsw asc_cdevsw = + { ascopen, ascclose, ascread, nowrite, /*71*/ + ascioctl, nostop, nullreset, nodevtotty, /* asc */ + ascselect, nommap, NULL }; + +static asc_devsw_installed = 0; + +static void asc_devsw_install() +{ + dev_t descript; + if( ! asc_devsw_installed ) { + descript = makedev(CDEV_MAJOR,0); + cdevsw_add(&descript,&asc_cdevsw,NULL); +#if defined(BDEV_MAJOR) + descript = makedev(BDEV_MAJOR,0); + bdevsw_add(&descript,&asc_bdevsw,NULL); +#endif /*BDEV_MAJOR*/ + asc_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif /* NASC > 0 */ diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c index afe48e7..fd2910d 100644 --- a/sys/i386/isa/b004.c +++ b/sys/i386/isa/b004.c @@ -60,6 +60,12 @@ #include <i386/isa/isa.h> #include <i386/isa/isa_device.h> +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 8 +static void bqu_devsw_install(); +#endif /*JREMOD*/ + static u_char d_inb(u_int port); static void d_outb(u_int port, u_char data); @@ -571,6 +577,10 @@ 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++) { if((idp->id_iobase==0)&&((!b004_base_addresses[test])|| @@ -625,4 +635,26 @@ 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*/ + bquioctl, nostop, nullreset, nodevtotty,/* tputer */ + bquselect, nommap, NULL }; + +static bqu_devsw_installed = 0; + +static void bqu_devsw_install() +{ + dev_t descript; + 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*/ + bqu_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif /* NBQU */ diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c index 3cec50d..c1edbf1 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.6 1995/05/30 08:01:27 rgrimes Exp $ + * $Id: ctx.c,v 1.7 1995/09/08 11:07:34 bde Exp $ */ /* @@ -126,6 +126,11 @@ #include <i386/isa/ctxreg.h> #include <machine/ioctl_ctx.h> +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 40 +static void ctx_devsw_install(); +#endif /*JREMOD*/ int waitvb(short); /* state flags */ @@ -184,8 +189,12 @@ ctxprobe(struct isa_device * devp) if (inb(devp->id_iobase) == 0xff) /* 0xff only if board absent */ status = 0; - else - status = 1; + else { + status = 1; /*XXX uses only one port? */ +#ifdef JREMOD + ctx_devsw_install(); +#endif /*JREMOD*/ + } return (status); } @@ -438,4 +447,28 @@ waitvb(short port) return (0); } + +#ifdef JREMOD +struct cdevsw ctx_cdevsw = + { ctxopen, ctxclose, ctxread, ctxwrite, /*40*/ + ctxioctl, nostop, nullreset, nodevtotty,/* cortex */ + seltrue, nommap, NULL }; + +static ctx_devsw_installed = 0; + +static void ctx_devsw_install() +{ + dev_t descript; + 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*/ + ctx_devsw_installed = 1; + } +} +#endif /* JREMOD */ + #endif /* NCTX > 0 */ diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c index 1770061..a3f941e 100644 --- a/sys/i386/isa/cx.c +++ b/sys/i386/isa/cx.c @@ -39,6 +39,10 @@ # include <machine/pio.h> # define RB_GETC(q) getc(q) # else /* BSD 4.4 Lite */ +# ifdef JREMOD +# define CDEV_MAJOR 42 + void cx_devsw_install(); /* can't be static, needed in if_cx.c */ +# endif /*JREMOD*/ # include <sys/devconf.h> # endif #endif @@ -961,4 +965,27 @@ void cxtimeout (void *a) } timeout (cxtimeout, 0, hz*5); } + +#ifdef JREMOD +struct cdevsw cx_cdevsw = + { cxopen, cxclose, cxread, cxwrite, /*42*/ + cxioctl, cxstop, nullreset, cxdevtotty,/* cronyx */ + cxselect, nommap, NULL }; + +static cx_devsw_installed = 0; + +void cx_devsw_install() +{ + dev_t descript; + 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*/ + cx_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif /* NCX */ diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c index ce0816c..c2f3725 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.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/i386/isa/fd.c b/sys/i386/isa/fd.c index 4601645..1af2cbf 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.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/i386/isa/gpib.c b/sys/i386/isa/gpib.c index 00a23f1..8cbb0b7 100644 --- a/sys/i386/isa/gpib.c +++ b/sys/i386/isa/gpib.c @@ -47,6 +47,12 @@ #define SLEEP_MAX 1000 #define SLEEP_MIN 4 +#ifdef JREMOD +#include <sys/conf.h> +#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); @@ -123,6 +129,10 @@ 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); } @@ -1253,6 +1263,27 @@ outb(CDOR,95); /*untalk*/ } +#ifdef JREMOD +struct cdevsw gp_cdevsw = + { gpopen, gpclose, noread, gpwrite, /*44*/ + gpioctl, nostop, nullreset, nodevtotty,/* GPIB */ + seltrue, nommap, NULL }; + +static gp_devsw_installed = 0; +static void gp_devsw_install() +{ + dev_t descript; + 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*/ + gp_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif /* NGPIB > 0 */ diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c index 2e565c9..7abe841 100644 --- a/sys/i386/isa/gsc.c +++ b/sys/i386/isa/gsc.c @@ -57,6 +57,11 @@ * CONSTANTS & DEFINES * ***********************************************************************/ +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 47 +static void gsc_devsw_install(); +#endif /*JREMOD*/ /* clean up later */ #define PROBE_FAIL 0 #define PROBE_SUCCESS 1 @@ -499,6 +504,10 @@ 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 */ } @@ -772,4 +781,27 @@ int gscioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) } } + +#ifdef JREMOD +struct cdevsw gsc_cdevsw = + { gscopen, gscclose, gscread, nowrite, /*47*/ + gscioctl, nostop, nullreset, nodevtotty,/* gsc */ + seltrue, nommap, NULL }; + +static gsc_devsw_installed = 0; + +static void gsc_devsw_install() +{ + dev_t descript; + 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*/ + gsc_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif /* NGSC > 0 */ diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c index 8ab4ac4..aff2fce 100644 --- a/sys/i386/isa/if_cx.c +++ b/sys/i386/isa/if_cx.c @@ -220,6 +220,7 @@ 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; @@ -265,6 +266,10 @@ 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); } diff --git a/sys/i386/isa/joy.c b/sys/i386/isa/joy.c index 8d0dc25..5870e62 100644 --- a/sys/i386/isa/joy.c +++ b/sys/i386/isa/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/i386/isa/labpc.c b/sys/i386/isa/labpc.c index f173944..9d0cf7f 100644 --- a/sys/i386/isa/labpc.c +++ b/sys/i386/isa/labpc.c @@ -59,6 +59,12 @@ #include <i386/isa/isa_device.h> +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 66 +static void labpc_devsw_install(); +#endif /*JREMOD*/ + /* Miniumum timeout: */ @@ -495,6 +501,10 @@ 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; } @@ -1096,3 +1106,27 @@ labpcioctl(dev_t dev, int cmd, caddr_t arg, int mode, struct proc *p) return ENOTTY; } } + + +#ifdef JREMOD +struct cdevsw labpc_cdevsw = + { labpcopen, labpcclose, rawread, rawwrite, /*66*/ + labpcioctl, nostop, nullreset, nodevtotty,/* labpc */ + seltrue, nommap, labpcstrategy }; + +static labpc_devsw_installed = 0; + +static void labpc_devsw_install() +{ + dev_t descript; + 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*/ + labpc_devsw_installed = 1; + } +} +#endif /* JREMOD */ diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c index 29055f8..e96a0fd 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.37 1995/11/14 09:56:43 phk Exp $ + * $Id: lpt.c,v 1.38 1995/11/16 09:55:57 bde Exp $ */ /* @@ -139,6 +139,12 @@ #endif #endif /* INET */ +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 16 +static void lpt_devsw_install(); +#endif /*JREMOD*/ + #define LPINITRDY 4 /* wait up to 4 seconds for a ready */ #define LPTOUTTIME 4 /* wait up to 4 seconds for a ready */ #define LPPRI (PZERO+8) @@ -437,6 +443,10 @@ 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); } @@ -1143,4 +1153,26 @@ end: #endif /* INET */ +#ifdef JREMOD +struct cdevsw lpt_cdevsw = + { lptopen, lptclose, noread, lptwrite, /*16*/ + lptioctl, nullstop, nullreset, nodevtotty,/* lpt */ + seltrue, nommap, nostrat}; + +static lpt_devsw_installed = 0; + +static void lpt_devsw_install() +{ + dev_t descript; + 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*/ + lpt_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif /* NLPT */ diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c index 2b6b036..0571a93 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.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/i386/isa/mse.c b/sys/i386/isa/mse.c index b1484d1..5499a2a 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.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/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c index d30e106..a6f006a 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.16 1995/11/04 13:23:36 bde Exp $ + * $Id: pcaudio.c,v 1.17 1995/11/16 09:56:02 bde Exp $ */ #include "pca.h" @@ -49,6 +49,11 @@ #include <i386/isa/sound/ulaw.h> +#ifdef JREMOD +#define CDEV_MAJOR 24 +static void pca_devsw_install(); +#endif /*JREMOD*/ + #define BUF_SIZE 8192 #define SAMPLE_RATE 8000 #define INTERRUPT_RATE 16000 @@ -260,9 +265,13 @@ 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); #endif /*DEVFS*/ + return 1; } @@ -477,4 +486,27 @@ pcaselect(dev_t dev, int rw, struct proc *p) return(0); } } + +#ifdef JREMOD +struct cdevsw pca_cdevsw = + { pcaopen, pcaclose, noread, pcawrite, /*24*/ + pcaioctl, nostop, nullreset, nodevtotty,/* pcaudio */ + pcaselect, nommap, NULL }; + +static pca_devsw_installed = 0; + +static void pca_devsw_install() +{ + dev_t descript; + 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*/ + pca_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif diff --git a/sys/i386/isa/psm.c b/sys/i386/isa/psm.c index 047e6a3..14b35e4 100644 --- a/sys/i386/isa/psm.c +++ b/sys/i386/isa/psm.c @@ -66,6 +66,12 @@ #include <i386/isa/isa_device.h> +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 21 +static void psm_devsw_install(); +#endif /*JREMOD*/ + #define DATA 0 /* Offset for data port, read-write */ #define CNTRL 4 /* Offset for control port, write-only */ #define STATUS 4 /* Offset for status port, read-only */ @@ -198,9 +204,13 @@ int psmattach(struct isa_device *dvp) sc->state = 0; +#ifdef JREMOD + psm_devsw_install(); +#endif /*JREMOD*/ + /* Done */ - return(0); + return(0); /* XXX eh? usually 1 indicates success */ } int psmopen(dev_t dev, int flag, int fmt, struct proc *p) @@ -457,6 +467,30 @@ int psmselect(dev_t dev, int rw, struct proc *p) return(ret); } + +#ifdef JREMOD +struct cdevsw psm_cdevsw = + { psmopen, psmclose, psmread, nowrite, /*21*/ + psmioctl, nostop, nullreset, nodevtotty,/* psm mice */ + psmselect, nommap, NULL }; + +static psm_devsw_installed = 0; + +static void psm_devsw_install() +{ + dev_t descript; + 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*/ + psm_devsw_installed = 1; + } +} +#endif /* JREMOD */ + #endif diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c index 0feabf0..6203aff 100644 --- a/sys/i386/isa/rc.c +++ b/sys/i386/isa/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/i386/isa/scd.c b/sys/i386/isa/scd.c index c7bbe07..7d4fdec 100644 --- a/sys/i386/isa/scd.c +++ b/sys/i386/isa/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/i386/isa/si.c b/sys/i386/isa/si.c index c022248..93accc2 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.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/i386/isa/sio.c b/sys/i386/isa/sio.c index cf18650..b8aa9e2 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.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/i386/isa/spigot.c b/sys/i386/isa/spigot.c index 05d231c..d8c8ff1 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -70,6 +70,12 @@ error "Can only have 1 spigot configured." #include <i386/isa/isa.h> #include <i386/isa/isa_device.h> +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 11 +static void spigot_devsw_install(); +#endif /*JREMOD*/ + struct spigot_softc { u_long flags; u_long maddr; @@ -152,6 +158,10 @@ 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; } @@ -273,4 +283,27 @@ 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*/ + spigot_ioctl, nostop, nullreset, nodevtotty,/* Spigot */ + spigot_select, spigot_mmap, NULL }; + +static spigot_devsw_installed = 0; + +static void spigot_devsw_install() +{ + dev_t descript; + 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*/ + spigot_devsw_installed = 1; + } +} +#endif /* JREMOD */ + #endif /* NSPIGOT */ diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c index 82a7021..050ba18 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.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 */ diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c index faaf0e9..7b5dbcc 100644 --- a/sys/i386/isa/tw.c +++ b/sys/i386/isa/tw.c @@ -147,6 +147,12 @@ #include "i386/isa/isa_device.h" +#ifdef JREMOD +#include <sys/conf.h> +#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). @@ -342,6 +348,10 @@ 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); } @@ -981,4 +991,27 @@ static int twchecktime(int target, int tol) } #endif /* HIRESTIME */ +#ifdef JREMOD +struct cdevsw tw_cdevsw = + { twopen, twclose, twread, twwrite, /*19*/ + noioc, nullstop, nullreset, nodevtotty,/* tw */ + twselect, nommap, nostrat }; + +static tw_devsw_installed = 0; + +static void tw_devsw_install() +{ + dev_t descript; + 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*/ + tw_devsw_installed = 1; + } +} +#endif /* JREMOD */ + #endif NTW diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c index 868e3be..527d14a 100644 --- a/sys/i386/isa/wcd.c +++ b/sys/i386/isa/wcd.c @@ -32,6 +32,13 @@ #include <i386/include/cpufunc.h> #include <i386/isa/atapi.h> +#ifdef JREMOD +#include <sys/conf.h> +#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*); #define NUNIT (NWDC*2) /* Max. number of devices */ @@ -315,6 +322,10 @@ 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); } @@ -1159,4 +1170,31 @@ int wcd_mod (struct lkm_table *lkmtp, int cmd, int ver) } #endif /* WCD_MODULE */ +#ifdef JREMOD +struct bdevsw wcd_bdevsw = + { wcdbopen, wcdbclose, wcdstrategy, wcdioctl, /*19*/ + nxdump, zerosize, 0 }; + +struct cdevsw wcd_cdevsw = + { wcdropen, wcdrclose, rawread, nowrite, /*69*/ + wcdioctl, nostop, nullreset, nodevtotty,/* atapi */ + seltrue, nommap, wcdstrategy }; + +static wcd_devsw_installed = 0; + +static void wcd_devsw_install() +{ + dev_t descript; + 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*/ + wcd_devsw_installed = 1; + } +} +#endif /* JREMOD */ + #endif /* NWCD && NWDC && ATAPI */ diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index 49ab5ce..1b00118 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.91 1995/11/20 12:41:53 phk Exp $ + * $Id: wd.c,v 1.92 1995/11/23 07:24:41 dyson Exp $ */ /* TODO: @@ -105,6 +105,12 @@ extern void wdstart(int ctrlr); #define WDOPT_SLEEPHACK 0x4000 #define WDOPT_MULTIMASK 0x00ff +#ifdef JREMOD +#define CDEV_MAJOR 3 +#define BDEV_MAJOR 0 +static void wd_devsw_install(); +#endif /*JREMOD */ + static int wd_goaway(struct kern_devconf *, int); static int wdc_goaway(struct kern_devconf *, int); static int wd_externalize(struct kern_devconf *, struct sysctl_req *); @@ -314,6 +320,10 @@ 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 */ @@ -2116,4 +2126,30 @@ wdwait(struct disk *du, u_char bits_wanted, int timeout) return (-1); } +#ifdef JREMOD +struct bdevsw wd_bdevsw = + { wdopen, wdclose, wdstrategy, wdioctl, /*0*/ + wddump, wdsize, 0 }; + +struct cdevsw wd_cdevsw = + { wdopen, wdclose, rawread, rawwrite, /*3*/ + wdioctl, nostop, nullreset, nodevtotty,/* wd */ + seltrue, nommap, wdstrategy }; + +static wd_devsw_installed = 0; + +static void wd_devsw_install() +{ + dev_t descript; + 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*/ + wd_devsw_installed = 1; + } +} +#endif /* JREMOD */ #endif /* NWDC > 0 */ diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c index 8ace33e..8a4e609d 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.19 1995/09/08 11:08:03 bde Exp $ + * $Id: wt.c,v 1.20 1995/10/28 15:39:31 phk Exp $ * */ @@ -76,6 +76,13 @@ #include <i386/isa/isa_device.h> #include <i386/isa/wtreg.h> +#ifdef JREMOD +#include <sys/conf.h> +#define CDEV_MAJOR 10 +#define BDEV_MAJOR 3 +static void wt_devsw_install(); +#endif /*JREMOD */ + /* * Uncomment this to enable internal device tracing. */ @@ -261,6 +268,10 @@ 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); } @@ -963,4 +974,32 @@ static int wtstatus (wtinfo_t *t) splx(x); return (1); } + +#ifdef JREMOD +struct bdevsw wt_bdevsw = + { wtopen, wtclose, wtstrategy, wtioctl, /*3*/ + wtdump, wtsize, B_TAPE }; + +struct cdevsw wt_cdevsw = + { wtopen, wtclose, rawread, rawwrite, /*10*/ + wtioctl, nostop, nullreset, nodevtotty,/* wt */ + seltrue, nommap, wtstrategy }; + +static wt_devsw_installed = 0; + +static void wt_devsw_install() +{ + dev_t descript; + 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*/ + wt_devsw_installed = 1; + } +} +#endif /* JREMOD */ + #endif /* NWT */ diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 4601645..1af2cbf 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.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/isa/joy.c b/sys/isa/joy.c index 8d0dc25..5870e62 100644 --- a/sys/isa/joy.c +++ b/sys/isa/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/isa/sio.c b/sys/isa/sio.c index cf18650..b8aa9e2 100644 --- a/sys/isa/sio.c +++ b/sys/isa/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 */ |