From owner-freebsd-commit Tue Nov 28 01:44:44 1995 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA20794 for freebsd-commit-outgoing; Tue, 28 Nov 1995 01:44:44 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA20747 for cvs-all-outgoing; Tue, 28 Nov 1995 01:44:23 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA20675 for cvs-sys-outgoing; Tue, 28 Nov 1995 01:44:08 -0800 Received: (from julian@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA20592 ; Tue, 28 Nov 1995 01:43:49 -0800 Date: Tue, 28 Nov 1995 01:43:49 -0800 From: Julian Elischer Message-Id: <199511280943.BAA20592@freefall.freebsd.org> To: CVS-committers, cvs-sys Subject: cvs commit: src/sys/i386/isa/sound soundcard.c Sender: owner-commit@FreeBSD.ORG Precedence: bulk julian 95/11/28 01:43:48 Modified: sys/i386/isa asc.c b004.c ctx.c cx.c cy.c fd.c gpib.c gsc.c if_cx.c joy.c labpc.c lpt.c mcd.c mse.c pcaudio.c psm.c rc.c scd.c si.c sio.c spigot.c spkr.c tw.c wcd.c wd.c wt.c Log: 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 #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 */ Revision Changes Path 1.6 +33 -1 src/sys/i386/isa/asc.c 1.9 +32 -0 src/sys/i386/isa/b004.c 1.8 +36 -3 src/sys/i386/isa/ctx.c 1.15 +27 -0 src/sys/i386/isa/cx.c 1.20 +33 -1 src/sys/i386/isa/cy.c 1.72 +36 -1 src/sys/i386/isa/fd.c 1.8 +31 -0 src/sys/i386/isa/gpib.c 1.8 +32 -0 src/sys/i386/isa/gsc.c 1.7 +5 -0 src/sys/i386/isa/if_cx.c 1.9 +33 -0 src/sys/i386/isa/joy.c 1.8 +34 -0 src/sys/i386/isa/labpc.c 1.39 +33 -1 src/sys/i386/isa/lpt.c 1.49 +38 -1 src/sys/i386/isa/mcd.c 1.16 +33 -1 src/sys/i386/isa/mse.c 1.18 +33 -1 src/sys/i386/isa/pcaudio.c 1.8 +35 -1 src/sys/i386/isa/psm.c 1.11 +33 -0 src/sys/i386/isa/rc.c 1.10 +38 -1 src/sys/i386/isa/scd.c 1.17 +35 -1 src/sys/i386/isa/si.c 1.120 +33 -1 src/sys/i386/isa/sio.c 1.12 +33 -0 src/sys/i386/isa/spigot.c 1.18 +40 -3 src/sys/i386/isa/spkr.c 1.8 +33 -0 src/sys/i386/isa/tw.c 1.14 +38 -0 src/sys/i386/isa/wcd.c 1.93 +37 -1 src/sys/i386/isa/wd.c 1.21 +40 -1 src/sys/i386/isa/wt.c Modified: sys/i386/isa/matcd matcd.c sys/i386/isa/sound soundcard.c Log: the second set of changes in a move towards getting devices to be totally dynamic. (the first was about 7 weeeks ago) 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 #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 */ Revision Changes Path 1.9 +38 -0 src/sys/i386/isa/matcd/matcd.c 1.31 +34 -1 src/sys/i386/isa/sound/soundcard.c