diff --git a/sys/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c index a40aea869fb2..d2f5076cbe46 100644 --- a/sys/alpha/alpha/mem.c +++ b/sys/alpha/alpha/mem.c @@ -38,22 +38,18 @@ * * from: Utah $Hdr: mem.c 1.13 89/10/08$ * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 - * $Id: mem.c,v 1.10 1999/05/31 11:23:40 phk Exp $ + * $Id: mem.c,v 1.11 1999/06/27 20:52:22 peter Exp $ */ /* * Memory special file */ -#include "opt_devfs.h" #include #include #include #include -#ifdef DEVFS -#include -#endif /* DEVFS */ #include #include #include @@ -104,48 +100,7 @@ static struct cdevsw mem_cdevsw = { /* bmaj */ -1 }; -#ifdef DEVFS -static void *mem_devfs_token; -static void *kmem_devfs_token; -static void *null_devfs_token; -static void *random_devfs_token; -static void *urandom_devfs_token; -static void *zero_devfs_token; -static void *io_devfs_token; -#ifdef PERFMON -static void *perfmon_devfs_token; -#endif -static void memdevfs_init __P((void)); - -static void -memdevfs_init() -{ - mem_devfs_token = - devfs_add_devswf(&mem_cdevsw, 0, DV_CHR, - UID_ROOT, GID_KMEM, 0640, "mem"); - kmem_devfs_token = - devfs_add_devswf(&mem_cdevsw, 1, DV_CHR, - UID_ROOT, GID_KMEM, 0640, "kmem"); - null_devfs_token = - devfs_add_devswf(&mem_cdevsw, 2, DV_CHR, - UID_ROOT, GID_WHEEL, 0666, "null"); - random_devfs_token = - devfs_add_devswf(&mem_cdevsw, 3, DV_CHR, - UID_ROOT, GID_WHEEL, 0644, "random"); - urandom_devfs_token = - devfs_add_devswf(&mem_cdevsw, 4, DV_CHR, - UID_ROOT, GID_WHEEL, 0644, "urandom"); - zero_devfs_token = - devfs_add_devswf(&mem_cdevsw, 12, DV_CHR, - UID_ROOT, GID_WHEEL, 0666, "zero"); -#ifdef PERFMON - perfmon_devfs_token = - devfs_add_devswf(&mem_cdevsw, 32, DV_CHR, - UID_ROOT, GID_KMEM, 0640, "perfmon"); -#endif /* PERFMON */ -} -#endif /* DEVFS */ static int mmclose(dev, flags, fmt, p) @@ -450,9 +405,15 @@ mem_drvinit(void *unused) { cdevsw_add(&mem_cdevsw); -#ifdef DEVFS - memdevfs_init(); -#endif + make_dev(&mem_cdevsw, 0, UID_ROOT, GID_KMEM, 0640, "mem"); + make_dev(&mem_cdevsw, 1, UID_ROOT, GID_KMEM, 0640, "kmem"); + make_dev(&mem_cdevsw, 2, UID_ROOT, GID_WHEEL, 0666, "null"); + make_dev(&mem_cdevsw, 3, UID_ROOT, GID_WHEEL, 0644, "random"); + make_dev(&mem_cdevsw, 4, UID_ROOT, GID_WHEEL, 0644, "urandom"); + make_dev(&mem_cdevsw, 12, UID_ROOT, GID_WHEEL, 0666, "zero"); +#ifdef PERFMON + make_dev(&mem_cdevsw, 32, UID_ROOT, GID_KMEM, 0640, "perfmon"); +#endif /* PERFMON */ } SYSINIT(memdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,mem_drvinit,NULL) diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index dc1a69999f2c..c2670fdea655 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.152 1999/08/14 11:40:41 phk Exp $ + * $Id: fd.c,v 1.153 1999/08/23 20:58:59 phk Exp $ * */ @@ -906,9 +906,22 @@ static int fd_attach(device_t dev) { struct fd_data *fd; +#if 0 + int i; + int mynor; + int typemynor; + int typesize; +#endif fd = device_get_softc(dev); + make_dev(&fd_cdevsw, (fd->fdu << 6), + UID_ROOT, GID_OPERATOR, 0640, "rfd%d", fd->fdu); + +#if 0 + /* Other make_dev() go here. */ +#endif + /* * Export the drive to the devstat interface. */ diff --git a/sys/i4b/driver/i4b_ctl.c b/sys/i4b/driver/i4b_ctl.c index 3ad68a0063a2..afd34d7ddad3 100644 --- a/sys/i4b/driver/i4b_ctl.c +++ b/sys/i4b/driver/i4b_ctl.c @@ -27,7 +27,7 @@ * i4b_ctl.c - i4b system control port driver * ------------------------------------------ * - * $Id: i4b_ctl.c,v 1.25 1999/06/08 08:13:00 hm Exp $ + * $Id: i4b_ctl.c,v 1.6 1999/08/06 14:02:02 hm Exp $ * * last edit-date: [Tue Jun 8 09:27:15 1999] * @@ -59,14 +59,6 @@ #include #include -#ifdef __FreeBSD__ -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - #ifdef __FreeBSD__ #include #include @@ -136,10 +128,6 @@ PSEUDO_SET(i4bctlattach, i4b_i4bctldrv); #define PDEVSTATIC static #endif /* __FreeBSD__ */ -#ifdef DEVFS -static void *devfs_token; -#endif - #ifndef __FreeBSD__ #define PDEVSTATIC /* */ void i4bctlattach __P((void)); @@ -212,11 +200,7 @@ i4bctlattach() #ifndef HACK_NO_PSEUDO_ATTACH_MSG printf("i4bctl: ISDN system control port attached\n"); #endif -#ifdef DEVFS - devfs_token = devfs_add_devswf(&i4bctl_cdevsw, 0, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4bctl"); -#endif + make_dev(&i4bctl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4bctl"); } /*---------------------------------------------------------------------------* diff --git a/sys/i4b/driver/i4b_rbch.c b/sys/i4b/driver/i4b_rbch.c index 1179b35c46c5..16d9de450ffd 100644 --- a/sys/i4b/driver/i4b_rbch.c +++ b/sys/i4b/driver/i4b_rbch.c @@ -27,7 +27,7 @@ * i4b_rbch.c - device driver for raw B channel data * --------------------------------------------------- * - * $Id: i4b_rbch.c,v 1.36 1999/07/19 14:03:33 hm Exp $ + * $Id: i4b_rbch.c,v 1.5 1999/08/06 14:02:04 hm Exp $ * * last edit-date: [Fri Jul 9 09:37:02 1999] * @@ -54,14 +54,6 @@ extern cc_t ttydefchars; #define termioschars(t) memcpy((t)->c_cc, &ttydefchars, sizeof((t)->c_cc)) #endif -#ifdef __FreeBSD__ -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - #ifdef __NetBSD__ #include #define bootverbose 0 @@ -124,10 +116,6 @@ static struct rbch_softc { #define I4BRBCHMAXQLEN 10 struct selinfo selp; /* select / poll */ - -#ifdef DEVFS - void *devfs_token; /* device filesystem */ -#endif } rbch_softc[NI4BRBCH]; static void rbch_rx_data_rdy(int unit); @@ -280,12 +268,8 @@ i4brbchattach() for(i=0; i < NI4BRBCH; i++) { -#ifdef DEVFS - rbch_softc[i].devfs_token = - devfs_add_devswf(&i4brbch_cdevsw, i, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4brbch%d", i); -#endif + make_dev(&i4brbch_cdevsw, i, + UID_ROOT, GID_WHEEL, 0600, "i4brbch%d", i); rbch_softc[i].sc_devstate = ST_IDLE; rbch_softc[i].sc_hdlcq.ifq_maxlen = I4BRBCHMAXQLEN; rbch_softc[i].it_in.c_ispeed = rbch_softc[i].it_in.c_ospeed = 64000; diff --git a/sys/i4b/driver/i4b_tel.c b/sys/i4b/driver/i4b_tel.c index a96a77f9b8a3..4dd18c197233 100644 --- a/sys/i4b/driver/i4b_tel.c +++ b/sys/i4b/driver/i4b_tel.c @@ -27,7 +27,7 @@ * i4b_tel.c - device driver for ISDN telephony * -------------------------------------------- * - * $Id: i4b_tel.c,v 1.43 1999/07/09 06:44:00 hm Exp $ + * $Id: i4b_tel.c,v 1.5 1999/08/06 14:02:04 hm Exp $ * * last edit-date: [Fri Jul 9 08:35:30 1999] * @@ -59,14 +59,6 @@ #include #include -#ifdef __FreeBSD__ -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - #ifdef __bsdi__ #include #endif @@ -130,10 +122,6 @@ typedef struct { #define ST_WRWAITEMPTY 0x08 /* userland write waiting */ struct selinfo selp; /* select / poll */ - -#ifdef DEVFS - void *devfs_token; /* token for DEVFS */ -#endif } tel_sc_t; static tel_sc_t tel_sc[NI4BTEL][NOFUNCS]; @@ -311,13 +299,8 @@ i4btelattach() tel_sc[i][j].wcvttab = 0; tel_sc[i][j].result = 0; tel_init_linktab(i); -#ifdef DEVFS - -/* XXX */ tel_sc[i][j].devfs_token - = devfs_add_devswf(&i4btel_cdevsw, i, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4btel%d", i); -#endif + make_dev(&i4btel_cdevsw, i, + UID_ROOT, GID_WHEEL, 0600, "i4btel%d", i); } } } diff --git a/sys/i4b/driver/i4b_trace.c b/sys/i4b/driver/i4b_trace.c index aacf53d9532b..528324102856 100644 --- a/sys/i4b/driver/i4b_trace.c +++ b/sys/i4b/driver/i4b_trace.c @@ -27,7 +27,7 @@ * i4btrc - device driver for trace data read device * --------------------------------------------------- * - * $Id: i4b_trace.c,v 1.20 1999/06/01 10:23:58 hm Exp $ + * $Id: i4b_trace.c,v 1.5 1999/08/06 14:02:04 hm Exp $ * * last edit-date: [Tue Jun 1 12:15:40 1999] * @@ -68,14 +68,6 @@ #include #include -#ifdef __FreeBSD__ -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - #ifdef __FreeBSD__ #include #include @@ -97,9 +89,6 @@ static int device_state[NI4BTRC]; #define ST_IDLE 0x00 #define ST_ISOPEN 0x01 #define ST_WAITDATA 0x02 -#ifdef DEVFS -static void *devfs_token[NI4BTRC]; -#endif static int analyzemode = 0; static int rxunit = -1; @@ -237,12 +226,8 @@ i4btrcattach() for(i=0; i < NI4BTRC; i++) { -#ifdef DEVFS - devfs_token[i] - = devfs_add_devswf(&i4btrc_cdevsw, i, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4btrc%d", i); -#endif + make_dev(&i4btrc_cdevsw, i, + UID_ROOT, GID_WHEEL, 0600, "i4btrc%d", i); trace_queue[i].ifq_maxlen = IFQ_MAXLEN; device_state[i] = ST_IDLE; } diff --git a/sys/i4b/layer4/i4b_i4bdrv.c b/sys/i4b/layer4/i4b_i4bdrv.c index d15255502f57..fb2d129a8843 100644 --- a/sys/i4b/layer4/i4b_i4bdrv.c +++ b/sys/i4b/layer4/i4b_i4bdrv.c @@ -27,7 +27,7 @@ * i4b_i4bdrv.c - i4b userland interface driver * -------------------------------------------- * - * $Id: i4b_i4bdrv.c,v 1.47 1999/06/08 17:49:44 hm Exp $ + * $Id: i4b_i4bdrv.c,v 1.7 1999/08/06 14:02:45 hm Exp $ * * last edit-date: [Tue Jun 8 19:48:16 1999] * @@ -69,14 +69,6 @@ #include #include -#ifdef __FreeBSD__ -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - #ifdef __FreeBSD__ #include #include @@ -103,9 +95,6 @@ static struct ifqueue i4b_rdqueue; static int openflag = 0; static int selflag = 0; static int readflag = 0; -#ifdef DEVFS -static void *devfs_token; -#endif #ifndef __FreeBSD__ @@ -247,11 +236,7 @@ i4battach() printf("i4b: ISDN call control device attached\n"); #endif i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN; -#ifdef DEVFS - devfs_token = devfs_add_devswf(&i4b_cdevsw, 0, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4b"); -#endif + make_dev(&i4b_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4b"); } /*---------------------------------------------------------------------------* diff --git a/sys/isa/fd.c b/sys/isa/fd.c index dc1a69999f2c..c2670fdea655 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.152 1999/08/14 11:40:41 phk Exp $ + * $Id: fd.c,v 1.153 1999/08/23 20:58:59 phk Exp $ * */ @@ -906,9 +906,22 @@ static int fd_attach(device_t dev) { struct fd_data *fd; +#if 0 + int i; + int mynor; + int typemynor; + int typesize; +#endif fd = device_get_softc(dev); + make_dev(&fd_cdevsw, (fd->fdu << 6), + UID_ROOT, GID_OPERATOR, 0640, "rfd%d", fd->fdu); + +#if 0 + /* Other make_dev() go here. */ +#endif + /* * Export the drive to the devstat interface. */ diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index e032a426a350..feae60901435 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -47,12 +47,11 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.67 1999/07/29 01:02:59 mdodd Exp $ + * $Id: fd.c,v 1.68 1999/08/14 11:40:47 phk Exp $ * */ #include "fd.h" -#include "opt_devfs.h" #include "opt_fdc.h" #if NFDC > 0 @@ -80,10 +79,6 @@ #include #include -#ifdef DEVFS -#include -#endif /* DEVFS */ - #include #ifdef PC98 #include @@ -1164,7 +1159,7 @@ static int fd_attach(device_t dev) { struct fd_data *fd; -#ifdef DEVFS +#if 0 int i; int mynor; int typemynor; @@ -1173,14 +1168,9 @@ fd_attach(device_t dev) fd = device_get_softc(dev); -#ifdef DEVFS /* XXX bitrot */ - mynor = fd->fdu << 6; - fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK, - UID_ROOT, GID_OPERATOR, 0640, - "fd%d", fd->fdu); - fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR, - UID_ROOT, GID_OPERATOR, 0640, - "rfd%d", fd->fdu); + make_dev(&fd_cdevsw, (fd->fdu << 6), + UID_ROOT, GID_OPERATOR, 0640, "rfd%d", fd->fdu); +#if 0 /* DEVFS */ for (i = 1; i < 1 + NUMDENS; i++) { /* * XXX this and the lookup in Fdopen() should be diff --git a/sys/pc98/cbus/olpt.c b/sys/pc98/cbus/olpt.c index 5faeae47f19c..fd3529128419 100644 --- a/sys/pc98/cbus/olpt.c +++ b/sys/pc98/cbus/olpt.c @@ -46,7 +46,7 @@ * SUCH DAMAGE. * * from: unknown origin, 386BSD 0.1 - * $Id: olpt.c,v 1.1 1999/06/18 14:48:26 kato Exp $ + * $Id: olpt.c,v 1.2 1999/07/06 19:23:20 des Exp $ */ /* @@ -102,7 +102,6 @@ */ #include "olpt.h" -#include "opt_devfs.h" #include "opt_inet.h" #ifdef PC98 #undef INET /* PLIP is not supported for old PC-98 */ @@ -115,10 +114,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif /*DEVFS*/ - #include #include @@ -238,10 +233,6 @@ static struct lpt_softc { u_char *sc_ifbuf; int sc_iferrs; #endif -#ifdef DEVFS - void *devfs_token; - void *devfs_token_ctl; -#endif } lpt_sc[NOLPT] ; /* bits for state */ @@ -509,15 +500,10 @@ lptattach(struct isa_device *isdp) } lprintf(("irq %x\n", sc->sc_irq)); -#ifdef DEVFS /* XXX what to do about the flags in the minor number? */ - sc->devfs_token = devfs_add_devswf(&lpt_cdevsw, - unit, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "lpt%d", unit); - sc->devfs_token_ctl = devfs_add_devswf(&lpt_cdevsw, - unit | LP_BYPASS, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "lpctl%d", unit); -#endif + make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "lpt%d", unit); + make_dev(&lpt_cdevsw, unit | LP_BYPASS, + UID_ROOT, GID_WHEEL, 0600, "lpctl%d", unit); return (1); } diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index 6d66b305b8af..857bd2b1c8c1 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.101 1999/08/09 13:03:35 nyan Exp $ + * $Id: sio.c,v 1.102 1999/08/17 04:33:11 nyan Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -38,7 +38,6 @@ #include "opt_comconsole.h" #include "opt_compat.h" #include "opt_ddb.h" -#include "opt_devfs.h" #include "opt_sio.h" #include "sio.h" /* #include "pnp.h" */ @@ -154,9 +153,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif #include #ifdef PC98 @@ -418,14 +414,6 @@ struct com_s { u_char obuf1[256]; u_char obuf2[256]; #endif -#ifdef DEVFS - void *devfs_token_ttyd; - void *devfs_token_ttyl; - void *devfs_token_ttyi; - void *devfs_token_cuaa; - void *devfs_token_cual; - void *devfs_token_cuai; -#endif }; #ifdef COM_ESP @@ -1833,26 +1821,18 @@ determined_type: ; register_swi(SWI_TTY, siopoll); sio_registered = TRUE; } -#ifdef DEVFS - com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw, - unit, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit); - com->devfs_token_ttyi = devfs_add_devswf(&sio_cdevsw, - unit | CONTROL_INIT_STATE, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "ttyid%r", unit); - com->devfs_token_ttyl = devfs_add_devswf(&sio_cdevsw, - unit | CONTROL_LOCK_STATE, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "ttyld%r", unit); - com->devfs_token_cuaa = devfs_add_devswf(&sio_cdevsw, - unit | CALLOUT_MASK, DV_CHR, - UID_UUCP, GID_DIALER, 0660, "cuaa%r", unit); - com->devfs_token_cuai = devfs_add_devswf(&sio_cdevsw, - unit | CALLOUT_MASK | CONTROL_INIT_STATE, DV_CHR, - UID_UUCP, GID_DIALER, 0660, "cuaia%r", unit); - com->devfs_token_cual = devfs_add_devswf(&sio_cdevsw, - unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR, - UID_UUCP, GID_DIALER, 0660, "cuala%r", unit); -#endif + make_dev(&sio_cdevsw, unit, + UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit); + make_dev(&sio_cdevsw, unit | CONTROL_INIT_STATE, + UID_ROOT, GID_WHEEL, 0600, "ttyid%r", unit); + make_dev(&sio_cdevsw, unit | CONTROL_LOCK_STATE, + UID_ROOT, GID_WHEEL, 0600, "ttyld%r", unit); + make_dev(&sio_cdevsw, unit | CALLOUT_MASK, + UID_UUCP, GID_DIALER, 0660, "cuaa%r", unit); + make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_INIT_STATE, + UID_UUCP, GID_DIALER, 0660, "cuaia%r", unit); + make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_LOCK_STATE, + UID_UUCP, GID_DIALER, 0660, "cuala%r", unit); com->flags = isa_get_flags(dev); /* Heritate id_flags for later */ com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR; pps_init(&com->pps); diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index e032a426a350..feae60901435 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -47,12 +47,11 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.67 1999/07/29 01:02:59 mdodd Exp $ + * $Id: fd.c,v 1.68 1999/08/14 11:40:47 phk Exp $ * */ #include "fd.h" -#include "opt_devfs.h" #include "opt_fdc.h" #if NFDC > 0 @@ -80,10 +79,6 @@ #include #include -#ifdef DEVFS -#include -#endif /* DEVFS */ - #include #ifdef PC98 #include @@ -1164,7 +1159,7 @@ static int fd_attach(device_t dev) { struct fd_data *fd; -#ifdef DEVFS +#if 0 int i; int mynor; int typemynor; @@ -1173,14 +1168,9 @@ fd_attach(device_t dev) fd = device_get_softc(dev); -#ifdef DEVFS /* XXX bitrot */ - mynor = fd->fdu << 6; - fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK, - UID_ROOT, GID_OPERATOR, 0640, - "fd%d", fd->fdu); - fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR, - UID_ROOT, GID_OPERATOR, 0640, - "rfd%d", fd->fdu); + make_dev(&fd_cdevsw, (fd->fdu << 6), + UID_ROOT, GID_OPERATOR, 0640, "rfd%d", fd->fdu); +#if 0 /* DEVFS */ for (i = 1; i < 1 + NUMDENS; i++) { /* * XXX this and the lookup in Fdopen() should be diff --git a/sys/pc98/pc98/mse.c b/sys/pc98/pc98/mse.c index 47c9d59c0e62..b82d1d37bfde 100644 --- a/sys/pc98/pc98/mse.c +++ b/sys/pc98/pc98/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.21 1999/05/30 16:53:19 phk Exp $ + * $Id: mse.c,v 1.22 1999/05/31 11:28:36 phk Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -46,7 +46,6 @@ #include "mse.h" #if NMSE > 0 -#include "opt_devfs.h" #include #include @@ -55,9 +54,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif /*DEVFS*/ #include #include @@ -128,10 +124,6 @@ static struct mse_softc { mousehw_t hw; mousemode_t mode; mousestatus_t status; -#ifdef DEVFS - void *devfs_token; - void *n_devfs_token; -#endif } mse_sc[NMSE]; /* Flags */ @@ -342,14 +334,8 @@ mseattach(idp) idp->id_ointr = mseintr; sc->sc_port = idp->id_iobase; sc->mode.accelfactor = (idp->id_flags & MSE_CONFIG_ACCEL) >> 4; -#ifdef DEVFS - sc->devfs_token = - devfs_add_devswf(&mse_cdevsw, unit << 1, DV_CHR, 0, 0, - 0600, "mse%d", unit); - sc->n_devfs_token = - devfs_add_devswf(&mse_cdevsw, (unit<<1)+1, DV_CHR,0, 0, - 0600, "nmse%d", unit); -#endif + make_dev(&mse_cdevsw, unit << 1, 0, 0, 0600, "mse%d", unit); + make_dev(&mse_cdevsw, (unit<<1)+1, 0, 0, 0600, "nmse%d", unit); return (1); } diff --git a/sys/pc98/pc98/olpt.c b/sys/pc98/pc98/olpt.c index 5faeae47f19c..fd3529128419 100644 --- a/sys/pc98/pc98/olpt.c +++ b/sys/pc98/pc98/olpt.c @@ -46,7 +46,7 @@ * SUCH DAMAGE. * * from: unknown origin, 386BSD 0.1 - * $Id: olpt.c,v 1.1 1999/06/18 14:48:26 kato Exp $ + * $Id: olpt.c,v 1.2 1999/07/06 19:23:20 des Exp $ */ /* @@ -102,7 +102,6 @@ */ #include "olpt.h" -#include "opt_devfs.h" #include "opt_inet.h" #ifdef PC98 #undef INET /* PLIP is not supported for old PC-98 */ @@ -115,10 +114,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif /*DEVFS*/ - #include #include @@ -238,10 +233,6 @@ static struct lpt_softc { u_char *sc_ifbuf; int sc_iferrs; #endif -#ifdef DEVFS - void *devfs_token; - void *devfs_token_ctl; -#endif } lpt_sc[NOLPT] ; /* bits for state */ @@ -509,15 +500,10 @@ lptattach(struct isa_device *isdp) } lprintf(("irq %x\n", sc->sc_irq)); -#ifdef DEVFS /* XXX what to do about the flags in the minor number? */ - sc->devfs_token = devfs_add_devswf(&lpt_cdevsw, - unit, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "lpt%d", unit); - sc->devfs_token_ctl = devfs_add_devswf(&lpt_cdevsw, - unit | LP_BYPASS, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "lpctl%d", unit); -#endif + make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "lpt%d", unit); + make_dev(&lpt_cdevsw, unit | LP_BYPASS, + UID_ROOT, GID_WHEEL, 0600, "lpctl%d", unit); return (1); } diff --git a/sys/pc98/pc98/pcaudio.c b/sys/pc98/pc98/pcaudio.c index 76d6e277d9f8..5c8dbf27a1fc 100644 --- a/sys/pc98/pc98/pcaudio.c +++ b/sys/pc98/pc98/pcaudio.c @@ -25,12 +25,11 @@ * (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.23 1999/05/30 16:53:21 phk Exp $ + * $Id: pcaudio.c,v 1.24 1999/05/31 11:28:38 phk Exp $ */ #include "pca.h" #if NPCA > 0 -#include "opt_devfs.h" #include #include @@ -52,9 +51,6 @@ #include #include -#ifdef DEVFS -#include -#endif /* DEVFS */ #define BUF_SIZE 8192 #define SAMPLE_RATE 8000 @@ -122,11 +118,6 @@ static unsigned char alaw_linear[] = { 76, 181, 125, 130, 0, 255, 115, 141, }; -#ifdef DEVFS -static void *pca_devfs_token; -static void *pcac_devfs_token; -#endif - static int pca_sleep = 0; static int pca_initialized = 0; @@ -357,14 +348,8 @@ pcaattach(struct isa_device *dvp) { printf("pca%d: PC speaker audio driver\n", dvp->id_unit); pca_init(); -#ifdef DEVFS - pca_devfs_token = - devfs_add_devswf(&pca_cdevsw, 0, DV_CHR, 0, 0, 0600, "pcaudio"); - pcac_devfs_token = - devfs_add_devswf(&pca_cdevsw, 128, DV_CHR, 0, 0, 0600, - "pcaudioctl"); -#endif /*DEVFS*/ - + make_dev(&pca_cdevsw, 0, 0, 0, 0600, "pcaudio"); + make_dev(&pca_cdevsw, 128, 0, 0, 0600, "pcaudioctl"); return 1; } diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index 6d66b305b8af..857bd2b1c8c1 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.101 1999/08/09 13:03:35 nyan Exp $ + * $Id: sio.c,v 1.102 1999/08/17 04:33:11 nyan Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -38,7 +38,6 @@ #include "opt_comconsole.h" #include "opt_compat.h" #include "opt_ddb.h" -#include "opt_devfs.h" #include "opt_sio.h" #include "sio.h" /* #include "pnp.h" */ @@ -154,9 +153,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif #include #ifdef PC98 @@ -418,14 +414,6 @@ struct com_s { u_char obuf1[256]; u_char obuf2[256]; #endif -#ifdef DEVFS - void *devfs_token_ttyd; - void *devfs_token_ttyl; - void *devfs_token_ttyi; - void *devfs_token_cuaa; - void *devfs_token_cual; - void *devfs_token_cuai; -#endif }; #ifdef COM_ESP @@ -1833,26 +1821,18 @@ determined_type: ; register_swi(SWI_TTY, siopoll); sio_registered = TRUE; } -#ifdef DEVFS - com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw, - unit, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit); - com->devfs_token_ttyi = devfs_add_devswf(&sio_cdevsw, - unit | CONTROL_INIT_STATE, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "ttyid%r", unit); - com->devfs_token_ttyl = devfs_add_devswf(&sio_cdevsw, - unit | CONTROL_LOCK_STATE, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, "ttyld%r", unit); - com->devfs_token_cuaa = devfs_add_devswf(&sio_cdevsw, - unit | CALLOUT_MASK, DV_CHR, - UID_UUCP, GID_DIALER, 0660, "cuaa%r", unit); - com->devfs_token_cuai = devfs_add_devswf(&sio_cdevsw, - unit | CALLOUT_MASK | CONTROL_INIT_STATE, DV_CHR, - UID_UUCP, GID_DIALER, 0660, "cuaia%r", unit); - com->devfs_token_cual = devfs_add_devswf(&sio_cdevsw, - unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR, - UID_UUCP, GID_DIALER, 0660, "cuala%r", unit); -#endif + make_dev(&sio_cdevsw, unit, + UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit); + make_dev(&sio_cdevsw, unit | CONTROL_INIT_STATE, + UID_ROOT, GID_WHEEL, 0600, "ttyid%r", unit); + make_dev(&sio_cdevsw, unit | CONTROL_LOCK_STATE, + UID_ROOT, GID_WHEEL, 0600, "ttyld%r", unit); + make_dev(&sio_cdevsw, unit | CALLOUT_MASK, + UID_UUCP, GID_DIALER, 0660, "cuaa%r", unit); + make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_INIT_STATE, + UID_UUCP, GID_DIALER, 0660, "cuaia%r", unit); + make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_LOCK_STATE, + UID_UUCP, GID_DIALER, 0660, "cuala%r", unit); com->flags = isa_get_flags(dev); /* Heritate id_flags for later */ com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR; pps_init(&com->pps); diff --git a/sys/pc98/pc98/spkr.c b/sys/pc98/pc98/spkr.c index e00dc2a30850..44b2dd67d19a 100644 --- a/sys/pc98/pc98/spkr.c +++ b/sys/pc98/pc98/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 * - * $Id: spkr.c,v 1.16 1999/05/31 11:28:40 phk Exp $ + * $Id: spkr.c,v 1.17 1999/08/18 08:24:35 kato Exp $ */ /* @@ -15,7 +15,6 @@ #if NSPEAKER > 0 -#include "opt_devfs.h" #include #include @@ -32,11 +31,6 @@ #include #include -#ifdef DEVFS -#include -static void *devfs_token; -#endif - static d_open_t spkropen; static d_close_t spkrclose; static d_write_t spkrwrite; @@ -644,11 +638,7 @@ spkr_drvinit(void *unused) if( ! spkr_devsw_installed ) { cdevsw_add(&spkr_cdevsw); spkr_devsw_installed = 1; -#ifdef DEVFS - devfs_token = devfs_add_devswf(&spkr_cdevsw, 0, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "speaker"); -#endif + make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "speaker"); } } diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c index 0d8b80292787..3dd7bc4b7c31 100644 --- a/sys/pc98/pc98/syscons.c +++ b/sys/pc98/pc98/syscons.c @@ -25,14 +25,13 @@ * (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: syscons.c,v 1.125 1999/08/09 10:35:03 phk Exp $ + * $Id: syscons.c,v 1.126 1999/08/23 13:45:28 kato Exp $ */ #include "sc.h" #include "splash.h" #include "opt_syscons.h" #include "opt_ddb.h" -#include "opt_devfs.h" #ifdef __i386__ #include "apm.h" #endif @@ -48,10 +47,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif - #include #include #include @@ -88,10 +83,6 @@ static default_attr kernel_default = { static int sc_console_unit = -1; static scr_stat *sc_console; -#ifdef DEVFS -static void *sc_mouse_devfs_token; -static void *sc_console_devfs_token; -#endif static term_stat kernel_console; static default_attr *current_default; @@ -308,9 +299,7 @@ sc_attach_unit(int unit, int flags) #ifdef SC_PIXEL_MODE video_info_t info; #endif -#ifdef DEVFS int vc; -#endif scmeminit(NULL); /* XXX */ @@ -376,22 +365,15 @@ sc_attach_unit(int unit, int flags) */ cdevsw_add(&sc_cdevsw); /* XXX do this just once... */ -#ifdef DEVFS for (vc = sc->first_vty; vc < sc->first_vty + sc->vtys; vc++) - sc->devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, - DV_CHR, UID_ROOT, GID_WHEEL, - 0600, "ttyv%r", vc); + make_dev(&sc_cdevsw, vc, UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc); if (scp == sc_console) { #ifndef SC_NO_SYSMOUSE - sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, - DV_CHR, UID_ROOT, GID_WHEEL, - 0600, "sysmouse"); + make_dev(&sc_cdevsw, SC_MOUSE, UID_ROOT, GID_WHEEL, 0600, "sysmouse"); #endif /* SC_NO_SYSMOUSE */ - sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLECTL, - DV_CHR, UID_ROOT, GID_WHEEL, - 0600, "consolectl"); + make_dev(&sc_cdevsw, SC_CONSOLECTL, + UID_ROOT, GID_WHEEL, 0600, "consolectl"); } -#endif /* DEVFS */ return 0; } diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index c5098b83ef9a..1c20cb6fc6b5 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.85 1999/08/09 10:35:04 phk Exp $ + * $Id: wd.c,v 1.86 1999/08/14 11:40:47 phk Exp $ */ /* TODO: @@ -64,7 +64,6 @@ #if NWDC > 0 -#include "opt_devfs.h" #include "opt_hw_wdog.h" #include "opt_ide_delay.h" @@ -79,9 +78,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif /*DEVFS*/ #include #include #include @@ -176,10 +172,6 @@ struct disk { u_char dk_timeout; /* countdown to next timeout */ u_int32_t dk_port; /* i/o port base */ u_int32_t dk_altport; /* altstatus port base */ -#ifdef DEVFS - void *dk_bdev; /* devfs token for whole disk */ - void *dk_cdev; /* devfs token for raw whole disk */ -#endif /* DEVFS */ u_long cfg_flags; /* configured characteristics */ short dk_flags; /* drive characteristics found */ #define DKFL_SINGLE 0x00004 /* sector at a time mode */ @@ -485,9 +477,6 @@ wdprobe(struct isa_device *dvp) static int wdattach(struct isa_device *dvp) { -#if defined(DEVFS) - int mynor; -#endif int unit, lunit, flags, i; struct disk *du; struct wdparams *wp; @@ -609,17 +598,9 @@ wdattach(struct isa_device *dvp) */ wdtimeout(du); -#ifdef DEVFS - mynor = dkmakeminor(lunit, WHOLE_DISK_SLICE, RAW_PART); - du->dk_bdev = devfs_add_devswf(&wd_cdevsw, mynor, - DV_BLK, UID_ROOT, - GID_OPERATOR, 0640, - "wd%d", lunit); - du->dk_cdev = devfs_add_devswf(&wd_cdevsw, mynor, - DV_CHR, UID_ROOT, - GID_OPERATOR, 0640, - "rwd%d", lunit); -#endif + make_dev(&wd_cdevsw, + dkmakeminor(lunit, WHOLE_DISK_SLICE, RAW_PART), + UID_ROOT, GID_OPERATOR, 0640, "rwd%d", lunit); /* * Export the drive to the devstat interface.