summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-08-23 20:59:21 +0000
committerphk <phk@FreeBSD.org>1999-08-23 20:59:21 +0000
commit663cbe4fc26065f7af7d10faaee492a626156145 (patch)
tree32e619fadb473bfb85ff8e06044176f2ff323cce /sys
parent2a5ff1f726f814a9e4717afe3f14250f8030cace (diff)
downloadFreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.zip
FreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.tar.gz
Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/mem.c73
-rw-r--r--sys/cam/cam_extend.c3
-rw-r--r--sys/cam/cam_xpt.c6
-rw-r--r--sys/cam/scsi/scsi_pass.c6
-rw-r--r--sys/coda/coda_fbsd.c36
-rw-r--r--sys/dev/ata/ata-disk.c23
-rw-r--r--sys/dev/ata/ata-disk.h6
-rw-r--r--sys/dev/ata/atapi-all.c3
-rw-r--r--sys/dev/ata/atapi-cd.c30
-rw-r--r--sys/dev/ata/atapi-cd.h8
-rw-r--r--sys/dev/ata/atapi-fd.c18
-rw-r--r--sys/dev/ata/atapi-fd.h6
-rw-r--r--sys/dev/ata/atapi-tape.c13
-rw-r--r--sys/dev/ata/atapi-tape.h6
-rw-r--r--sys/dev/atkbdc/atkbd.c3
-rw-r--r--sys/dev/atkbdc/psm.c20
-rw-r--r--sys/dev/bktr/bktr_core.c27
-rw-r--r--sys/dev/cy/cy.c36
-rw-r--r--sys/dev/cy/cy_isa.c36
-rw-r--r--sys/dev/dgb/dgb.c66
-rw-r--r--sys/dev/dgb/dgm.c59
-rw-r--r--sys/dev/dpt/dpt.h10
-rw-r--r--sys/dev/dpt/dpt_pci.c3
-rw-r--r--sys/dev/fb/fb.c4
-rw-r--r--sys/dev/fdc/fdc.c120
-rw-r--r--sys/dev/joy/joy.c15
-rw-r--r--sys/dev/kbd/atkbd.c3
-rw-r--r--sys/dev/mcd/mcd.c39
-rw-r--r--sys/dev/mse/mse.c21
-rw-r--r--sys/dev/pci/pci.c29
-rw-r--r--sys/dev/ppbus/lpt.c23
-rw-r--r--sys/dev/rc/rc.c17
-rw-r--r--sys/dev/rp/rp.c9
-rw-r--r--sys/dev/scd/scd.c38
-rw-r--r--sys/dev/si/si.c49
-rw-r--r--sys/dev/sio/sio.c46
-rw-r--r--sys/dev/snp/snp.c29
-rw-r--r--sys/dev/speaker/spkr.c15
-rw-r--r--sys/dev/streams/streams.c22
-rw-r--r--sys/dev/syscons/syscons.h7
-rw-r--r--sys/fs/coda/coda_fbsd.c36
-rw-r--r--sys/gnu/i386/isa/dgb.c66
-rw-r--r--sys/gnu/i386/isa/dgm.c59
-rw-r--r--sys/i386/apm/apm.c15
-rw-r--r--sys/i386/bios/apm.c15
-rw-r--r--sys/i386/i386/mem.c73
-rw-r--r--sys/i386/isa/asc.c36
-rw-r--r--sys/i386/isa/atapi-cd.c32
-rw-r--r--sys/i386/isa/atapi-cd.h8
-rw-r--r--sys/i386/isa/ctx.c15
-rw-r--r--sys/i386/isa/cy.c36
-rw-r--r--sys/i386/isa/gpib.c14
-rw-r--r--sys/i386/isa/gsc.c34
-rw-r--r--sys/i386/isa/if_cx.c19
-rw-r--r--sys/i386/isa/joy.c15
-rw-r--r--sys/i386/isa/labpc.c16
-rw-r--r--sys/i386/isa/matcd/matcd.c43
-rw-r--r--sys/i386/isa/mcd.c39
-rw-r--r--sys/i386/isa/mse.c21
-rw-r--r--sys/i386/isa/pcaudio.c22
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c20
-rw-r--r--sys/i386/isa/rc.c17
-rw-r--r--sys/i386/isa/rp.c9
-rw-r--r--sys/i386/isa/scd.c38
-rw-r--r--sys/i386/isa/si.c49
-rw-r--r--sys/i386/isa/snd/sound.c54
-rw-r--r--sys/i386/isa/sound/soundcard.c50
-rw-r--r--sys/i386/isa/spigot.c14
-rw-r--r--sys/i386/isa/spkr.c15
-rw-r--r--sys/i386/isa/tw.c17
-rw-r--r--sys/i386/isa/wd.c27
-rw-r--r--sys/i386/isa/wd_cd.c32
-rw-r--r--sys/i386/isa/wd_cd.h8
-rw-r--r--sys/i386/isa/wfd.c23
-rw-r--r--sys/i386/isa/wst.c15
-rw-r--r--sys/i386/isa/wt.c15
-rw-r--r--sys/isa/fd.c120
-rw-r--r--sys/isa/joy.c15
-rw-r--r--sys/isa/psm.c20
-rw-r--r--sys/isa/sio.c46
-rw-r--r--sys/kern/init_main.c3
-rw-r--r--sys/kern/kern_conf.c26
-rw-r--r--sys/kern/kern_descrip.c51
-rw-r--r--sys/kern/subr_diskslice.c6
-rw-r--r--sys/kern/subr_log.c23
-rw-r--r--sys/kern/tty_pty.c21
-rw-r--r--sys/kern/tty_snoop.c29
-rw-r--r--sys/kern/tty_tty.c22
-rw-r--r--sys/pc98/pc98/wd_cd.c32
-rw-r--r--sys/pc98/pc98/wfd.c23
-rw-r--r--sys/pc98/pc98/wst.c15
-rw-r--r--sys/pccard/pccard.c11
-rw-r--r--sys/pccard/slot.h4
-rw-r--r--sys/pci/brooktree848.c27
-rw-r--r--sys/pci/dpt_pci.c3
-rw-r--r--sys/pci/meteor.c9
-rw-r--r--sys/pci/meteor_reg.h3
-rw-r--r--sys/pci/pci.c29
-rw-r--r--sys/pci/xrpu.c18
-rw-r--r--sys/sys/conf.h21
-rw-r--r--sys/sys/linedisc.h21
-rw-r--r--sys/vm/vm_swap.c39
102 files changed, 479 insertions, 2158 deletions
diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c
index 02827d0..4c37086 100644
--- a/sys/amd64/amd64/mem.c
+++ b/sys/amd64/amd64/mem.c
@@ -38,23 +38,19 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.62 1999/05/30 16:52:04 phk Exp $
+ * $Id: mem.c,v 1.63 1999/05/31 11:25:44 phk Exp $
*/
/*
* Memory special file
*/
-#include "opt_devfs.h"
#include "opt_perfmon.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/buf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#include <sys/kernel.h>
#include <sys/uio.h>
#include <sys/ioccom.h>
@@ -118,51 +114,6 @@ static int random_ioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
struct mem_range_softc mem_range_softc;
-#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");
- io_devfs_token =
- devfs_add_devswf(&mem_cdevsw, 14, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600, "io");
-#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)
@@ -661,10 +612,6 @@ iszerodev(dev)
&& minor(dev) == 12);
}
-
-
-static int mem_devsw_installed;
-
static void
mem_drvinit(void *unused)
{
@@ -673,14 +620,16 @@ mem_drvinit(void *unused)
if (mem_range_softc.mr_op != NULL)
mem_range_softc.mr_op->init(&mem_range_softc);
- /* device registration */
- if( ! mem_devsw_installed ) {
- cdevsw_add(&mem_cdevsw);
- mem_devsw_installed = 1;
-#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");
+ make_dev(&mem_cdevsw, 14, UID_ROOT, GID_WHEEL, 0600, "io");
+#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/cam/cam_extend.c b/sys/cam/cam_extend.c
index c7acbdf..8570a35 100644
--- a/sys/cam/cam_extend.c
+++ b/sys/cam/cam_extend.c
@@ -12,11 +12,12 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
- * $Id$
+ * $Id: cam_extend.c,v 1.1 1998/09/15 06:33:23 gibbs Exp $
*/
/*
* XXX XXX XXX XXX We should get DEVFS working so that we
* don't have to do this, possibly sparse, array based junk.
+ * XXX: We can do this now with dev_t, that's even better.
*/
/*
* Extensible arrays: Use a realloc like implementation to permit
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index d5dfa30..0f92c6e 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_xpt.c,v 1.66 1999/08/16 17:47:39 mjacob Exp $
+ * $Id: cam_xpt.c,v 1.67 1999/08/16 22:22:41 gibbs Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -207,10 +207,6 @@ typedef enum {
struct xpt_softc {
xpt_flags flags;
u_int32_t generation;
-#ifdef DEVFS
- void *xpt_devfs_token;
- void *ctl_devfs_token;
-#endif
};
static const char quantum[] = "QUANTUM";
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index c68fb98..b900c3b 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pass.c,v 1.11 1999/05/30 16:51:03 phk Exp $
+ * $Id: scsi_pass.c,v 1.12 1999/05/31 11:24:05 phk Exp $
*/
#include <sys/param.h>
@@ -82,10 +82,6 @@ struct pass_softc {
struct buf_queue_head buf_queue;
union ccb saved_ccb;
struct devstat device_stats;
-#ifdef DEVFS
- void *pass_devfs_token;
- void *ctl_devfs_token;
-#endif
};
#ifndef MIN
diff --git a/sys/coda/coda_fbsd.c b/sys/coda/coda_fbsd.c
index 9c349f8..22a5963 100644
--- a/sys/coda/coda_fbsd.c
+++ b/sys/coda/coda_fbsd.c
@@ -27,12 +27,11 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_fbsd.cr,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_fbsd.c,v 1.14 1999/05/30 16:51:10 phk Exp $
+ * $Id: coda_fbsd.c,v 1.15 1999/05/31 11:24:16 phk Exp $
*
*/
#include "vcoda.h"
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -52,13 +51,6 @@
#include <coda/coda_vnops.h>
#include <coda/coda_psdev.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-
-static void *cfs_devfs_token[NVCODA];
-static void *coda_devfs_token[NVCODA];
-#endif
-
/*
From: "Jordan K. Hubbard" <jkh@time.cdrom.com>
Subject: Re: New 3.0 SNAPshot CDROM about ready for production..
@@ -101,38 +93,12 @@ int vcdebug = 1;
static int
codadev_modevent(module_t mod, int type, void *data)
{
-#ifdef DEVFS
- int i;
-#endif
- static struct cdevsw *oldcdevsw;
switch (type) {
case MOD_LOAD:
cdevsw_add(&codadevsw);
-#ifdef DEVFS
- /* tmp */
-#undef NVCODA
-#define NVCODA 1
- for (i = 0; i < NVCODA; i++) {
- cfs_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "cfs%d", i);
- coda_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "coda%d", i);
- }
-#endif
break;
case MOD_UNLOAD:
-#ifdef DEVFS
- for (i = 0; i < NVCODA; i++) {
- devfs_remove_dev(cfs_devfs_token[i]);
- devfs_remove_dev(coda_devfs_token[i]);
- }
-#endif
- cdevsw_add(oldcdevsw);
break;
default:
break;
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c
index 2206642..8546501 100644
--- a/sys/dev/ata/ata-disk.c
+++ b/sys/dev/ata/ata-disk.c
@@ -25,13 +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: ata-disk.c,v 1.16 1999/08/10 21:59:57 sos Exp $
+ * $Id: ata-disk.c,v 1.17 1999/08/14 11:40:33 phk Exp $
*/
#include "ata.h"
#include "atadisk.h"
-#include "opt_devfs.h"
-
#if NATA > 0 && NATADISK > 0
#include <sys/param.h>
@@ -47,9 +45,6 @@
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/stat.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <vm/vm.h>
#include <vm/vm_prot.h>
#include <vm/pmap.h>
@@ -236,18 +231,10 @@ ad_attach(void *notused)
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_IDE,
0x180);
-#ifdef DEVFS
- adp->cdevs_token = devfs_add_devswf(&ad_cdevsw,
- dkmakeminor(adp->lun, 0, 0),
- DV_CHR,
- UID_ROOT, GID_OPERATOR,
- 0640, "rad%d", adp->lun);
- adp->bdevs_token = devfs_add_devswf(&ad_cdevsw,
- dkmakeminor(adp->lun, 0, 0),
- DV_BLK,
- UID_ROOT, GID_OPERATOR,
- 0640, "ad%d", adp->lun);
-#endif
+ make_dev(&ad_cdevsw, dkmakeminor(adp->lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rad%d", adp->lun);
+ make_dev(&ad_cdevsw, dkmakeminor(adp->lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "ad%d", adp->lun);
bufq_init(&adp->queue);
adtab[adnlun++] = adp;
}
diff --git a/sys/dev/ata/ata-disk.h b/sys/dev/ata/ata-disk.h
index ad9a0d3..db4147b 100644
--- a/sys/dev/ata/ata-disk.h
+++ b/sys/dev/ata/ata-disk.h
@@ -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: ata-disk.h,v 1.6 1999/05/20 09:12:03 sos Exp $
+ * $Id: ata-disk.h,v 1.7 1999/06/25 09:03:00 sos Exp $
*/
/* ATA device parameter information */
@@ -140,10 +140,6 @@ struct ad_softc {
struct buf_queue_head queue; /* head of request queue */
struct devstat stats; /* devstat entry */
-#ifdef DEVFS
- void *cdevs_token;
- void *bdevs_token;
-#endif
};
struct ad_request {
diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c
index e85bbbd..ff13d46 100644
--- a/sys/dev/ata/atapi-all.c
+++ b/sys/dev/ata/atapi-all.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: atapi-all.c,v 1.10 1999/06/25 09:03:01 sos Exp $
+ * $Id: atapi-all.c,v 1.11 1999/08/10 21:59:58 sos Exp $
*/
#include "ata.h"
#include "atapicd.h"
#include "atapist.h"
#include "atapifd.h"
-#include "opt_devfs.h"
#if NATA > 0
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index a0cf35a..439c4d6 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.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: atapi-cd.c,v 1.10 1999/05/31 11:24:27 phk Exp $
+ * $Id: atapi-cd.c,v 1.11 1999/06/25 09:03:04 sos Exp $
*/
#include "ata.h"
#include "atapicd.h"
-#include "opt_devfs.h"
#if NATA > 0 && NATAPICD > 0
@@ -47,9 +46,6 @@
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/stat.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <pci/pcivar.h>
#include <dev/ata/ata-all.h>
#include <dev/ata/atapi-all.h>
@@ -239,22 +235,14 @@ acd_init_lun(struct atapi_softc *atp, int32_t lun, struct devstat *stats)
}
else
acd->stats = stats;
-#ifdef DEVFS
- acd->a_cdevfs_token = devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0644,
- "racd%da", lun);
- acd->c_cdevfs_token = devfs_add_devswf(&acd_cdevsw,
- dkmakeminor(lun, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0644,
- "racd%dc", lun);
- acd->a_bdevfs_token = devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0644,
- "acd%da", lun);
- acd->c_bdevfs_token = devfs_add_devswf(&acd_cdevsw,
- dkmakeminor(lun, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0644,
- "acd%dc", lun);
-#endif
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0644, "racd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0644, "racd%dc", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0644, "acd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0644, "acd%dc", lun);
return acd;
}
diff --git a/sys/dev/ata/atapi-cd.h b/sys/dev/ata/atapi-cd.h
index 2531989..95a0af6 100644
--- a/sys/dev/ata/atapi-cd.h
+++ b/sys/dev/ata/atapi-cd.h
@@ -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: atapi-cd.h,v 1.1 1999/03/01 21:19:18 sos Exp $
+ * $Id: atapi-cd.h,v 1.2 1999/03/03 21:10:29 sos Exp $
*/
/* CDROM Table Of Contents */
@@ -334,12 +334,6 @@ struct acd_softc {
u_int32_t next_writeable_lba; /* next writable position */
struct wormio_prepare_track preptrack; /* scratch region */
struct devstat *stats; /* devstat entry */
-#ifdef DEVFS
- void *a_cdevfs_token;
- void *c_cdevfs_token;
- void *a_bdevfs_token;
- void *c_bdevfs_token;
-#endif
};
#define CDRIOCBLANK _IO('c',100) /* blank a CDRW disc */
diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c
index 13684b4..f8c3865 100644
--- a/sys/dev/ata/atapi-fd.c
+++ b/sys/dev/ata/atapi-fd.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: atapi-fd.c,v 1.11 1999/06/25 09:03:05 sos Exp $
+ * $Id: atapi-fd.c,v 1.12 1999/08/14 11:40:33 phk Exp $
*/
#include "ata.h"
#include "atapifd.h"
-#include "opt_devfs.h"
#if NATA > 0 && NATAPIFD > 0
@@ -48,9 +47,6 @@
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/stat.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <pci/pcivar.h>
#include <dev/ata/ata-all.h>
#include <dev/ata/atapi-all.h>
@@ -137,14 +133,10 @@ afdattach(struct atapi_softc *atp)
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_IDE,
0x174);
-#ifdef DEVFS
- fdp->cdevs_token = devfs_add_devswf(&afd_cdevsw, dkmakeminor(fdp->lun, 0,0),
- DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640, "rafd%d", fdp->lun);
- fdp->bdevs_token = devfs_add_devswf(&afd_cdevsw, dkmakeminor(fdp->lun, 0,0),
- DV_BLK, UID_ROOT, GID_OPERATOR,
- 0640, "afd%d", fdp->lun);
-#endif
+ make_dev(&afd_cdevsw, dkmakeminor(fdp->lun, 0,0),
+ UID_ROOT, GID_OPERATOR, 0640, "rafd%d", fdp->lun);
+ make_dev(&afd_cdevsw, dkmakeminor(fdp->lun, 0,0),
+ UID_ROOT, GID_OPERATOR, 0640, "afd%d", fdp->lun);
return 0;
}
diff --git a/sys/dev/ata/atapi-fd.h b/sys/dev/ata/atapi-fd.h
index 4d6a6d2..59babb0 100644
--- a/sys/dev/ata/atapi-fd.h
+++ b/sys/dev/ata/atapi-fd.h
@@ -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: atapi-fd.h,v 1.1 1999/03/03 21:10:29 sos Exp $
+ * $Id: atapi-fd.h,v 1.2 1999/05/20 09:12:06 sos Exp $
*/
/* MODE SENSE parameter header */
@@ -82,9 +82,5 @@ struct afd_softc {
struct afd_cappage cap; /* capabilities page info */
struct diskslices *slices; /* virtual drives */
struct devstat stats;
-#ifdef DEVFS
- void *cdevs_token;
- void *bdevs_token;
-#endif
};
diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c
index 3f618c8..8dc2044 100644
--- a/sys/dev/ata/atapi-tape.c
+++ b/sys/dev/ata/atapi-tape.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: atapi-tape.c,v 1.10 1999/05/31 11:24:30 phk Exp $
+ * $Id: atapi-tape.c,v 1.11 1999/06/25 09:03:06 sos Exp $
*/
#include "ata.h"
#include "atapist.h"
-#include "opt_devfs.h"
#if NATA > 0 && NATAPIST > 0
@@ -43,9 +42,6 @@
#include <sys/mtio.h>
#include <sys/disklabel.h>
#include <sys/devicestat.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <machine/clock.h>
#include <pci/pcivar.h>
#include <dev/ata/ata-all.h>
@@ -136,11 +132,8 @@ astattach(struct atapi_softc *atp)
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_SEQUENTIAL | DEVSTAT_TYPE_IF_IDE,
0x170);
-#ifdef DEVFS
- stp->cdevs_token = devfs_add_devswf(&ast_cdevsw, dkmakeminor(stp->lun, 0,0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rast%d", stp->lun);
-#endif
+ make_dev(&ast_cdevsw, dkmakeminor(stp->lun, 0,0),
+ UID_ROOT, GID_OPERATOR, 0640, "rast%d", stp->lun);
return 0;
}
diff --git a/sys/dev/ata/atapi-tape.h b/sys/dev/ata/atapi-tape.h
index 666ac96..9c61225 100644
--- a/sys/dev/ata/atapi-tape.h
+++ b/sys/dev/ata/atapi-tape.h
@@ -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: atapi-tape.h,v 1.3 1999/03/07 21:49:14 sos Exp $
+ * $Id: atapi-tape.h,v 1.4 1999/06/25 09:03:07 sos Exp $
*/
/* MODE SENSE parameter header */
@@ -86,8 +86,4 @@ struct ast_softc {
struct ast_header header; /* MODE SENSE param header */
struct ast_cappage cap; /* capabilities page info */
struct devstat stats; /* devstat entry */
-#ifdef DEVFS
- void *cdevs_token;
- void *bdevs_token;
-#endif
};
diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c
index 0d00ee6..3786ee9 100644
--- a/sys/dev/atkbdc/atkbd.c
+++ b/sys/dev/atkbdc/atkbd.c
@@ -23,13 +23,12 @@
* (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: atkbd.c,v 1.13 1999/08/15 06:06:14 yokota Exp $
+ * $Id: atkbd.c,v 1.14 1999/08/22 09:52:32 yokota Exp $
*/
#include "atkbd.h"
#include "opt_kbd.h"
#include "opt_atkbd.h"
-#include "opt_devfs.h"
#if NATKBD > 0
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index bdc39dc..e7c82c9 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -20,7 +20,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: psm.c,v 1.15 1999/08/17 12:14:13 yokota Exp $
+ * $Id: psm.c,v 1.16 1999/08/22 06:11:52 yokota Exp $
*/
/*
@@ -65,7 +65,6 @@
#ifdef __i386__
#include "apm.h"
#endif
-#include "opt_devfs.h"
#include "opt_psm.h"
#if NPSM > 0
@@ -81,9 +80,6 @@
#include <sys/malloc.h>
#include <machine/bus.h>
#include <sys/rman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <sys/select.h>
#include <sys/uio.h>
@@ -181,10 +177,6 @@ struct psm_softc { /* Driver status information */
int button; /* the latest button state */
int xold; /* previous absolute X position */
int yold; /* previous absolute Y position */
-#ifdef DEVFS
- void *devfs_token;
- void *b_devfs_token;
-#endif
#ifdef PSM_HOOKAPM
struct apmhook resumehook;
#endif
@@ -1094,14 +1086,8 @@ psmattach(device_t dev)
sc->state = PSM_VALID;
/* Done */
-#ifdef DEVFS
- sc->devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, FALSE),
- DV_CHR, 0, 0, 0666, "psm%d", unit);
- sc->b_devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, TRUE),
- DV_CHR, 0, 0, 0666, "bpsm%d", unit);
-#endif /* DEVFS */
+ make_dev(&psm_cdevsw, PSM_MKMINOR(unit, FALSE), 0, 0, 0666, "psm%d", unit);
+ make_dev(&psm_cdevsw, PSM_MKMINOR(unit, TRUE), 0, 0, 0666, "bpsm%d", unit);
#ifdef PSM_HOOKAPM
sc->resumehook.ah_name = "PS/2 mouse";
diff --git a/sys/dev/bktr/bktr_core.c b/sys/dev/bktr/bktr_core.c
index 1c5cfdd..27b73d0 100644
--- a/sys/dev/bktr/bktr_core.c
+++ b/sys/dev/bktr/bktr_core.c
@@ -1,4 +1,4 @@
-/* $Id: brooktree848.c,v 1.85 1999/06/12 14:54:54 roger Exp $ */
+/* $Id: brooktree848.c,v 1.89 1999/07/12 15:51:48 roger Exp $ */
/* BT848 Driver for Brooktree's Bt848, Bt848A, Bt849A, Bt878, Bt879 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@@ -444,7 +444,6 @@ They are unrelated to Revision Control numbering of FreeBSD or any other system.
#ifdef __FreeBSD__
#include "bktr.h"
#include "opt_bktr.h"
-#include "opt_devfs.h"
#include "pci.h"
#endif /* __FreeBSD__ */
@@ -485,10 +484,6 @@ They are unrelated to Revision Control numbering of FreeBSD or any other system.
#define NSMBUS 0
#endif
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-
#if (__FreeBSD_version >=400000) || (NSMBUS > 0)
#include <sys/bus.h> /* used by smbus and newbus */
#endif
@@ -6961,13 +6956,9 @@ bktr_attach( device_t dev )
/* call the common attach code */
common_bktr_attach( bktr, unit, fun, rev );
-#ifdef DEVFS
- /* XXX This just throw away the token, which should probably be fixed when
- DEVFS is finally made really operational. */
- devfs_add_devswf(&bktr_cdevsw, unit, DV_CHR, 0, 0, 0444, "bktr%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+16, DV_CHR, 0, 0, 0444, "tuner%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+32, DV_CHR, 0, 0, 0444, "vbi%d", unit);
-#endif /* DEVFS */
+ make_dev(&bktr_cdevsw, unit, 0, 0, 0444, "bktr%d", unit);
+ make_dev(&bktr_cdevsw, unit+16, 0, 0, 0444, "tuner%d", unit);
+ make_dev(&bktr_cdevsw, unit+32, 0, 0, 0444, "vbi%d", unit);
return 0;
@@ -7473,13 +7464,9 @@ bktr_attach( pcici_t tag, int unit )
/* call the common attach code */
common_bktr_attach( bktr, unit, fun, rev );
-#ifdef DEVFS
- /* XXX This just throw away the token, which should probably be fixed when
- DEVFS is finally made really operational. */
- devfs_add_devswf(&bktr_cdevsw, unit, DV_CHR, 0, 0, 0444, "bktr%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+16, DV_CHR, 0, 0, 0444, "tuner%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+32, DV_CHR, 0, 0, 0444, "vbi%d", unit);
-#endif /* DEVFS */
+ make_dev(&bktr_cdevsw, unit, 0, 0, 0444, "bktr%d", unit);
+ make_dev(&bktr_cdevsw, unit+16, 0, 0, 0444, "tuner%d", unit);
+ make_dev(&bktr_cdevsw, unit+32, 0, 0, 0444, "vbi%d", unit);
}
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 48ecb9f..56b0bbc 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,12 +27,10 @@
* 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.90 1999/05/31 11:25:57 phk Exp $
+ * $Id: cy.c,v 1.91 1999/06/04 18:13:25 bde Exp $
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
-
#include "cy.h"
/*
@@ -80,10 +78,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/syslog.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
#include <machine/clock.h>
#include <machine/ipl.h>
#ifndef SMP
@@ -325,14 +319,6 @@ struct com_s {
*/
u_char obuf1[256];
u_char obuf2[256];
-#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
};
/* PCI driver entry point. */
@@ -636,32 +622,24 @@ cyattach_common(cy_iobase, cy_align)
register_swi(SWI_TTY, siopoll);
sio_registered = TRUE;
}
-#ifdef DEVFS
- com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw,
- unit, DV_CHR,
+ make_dev(&sio_cdevsw, unit,
UID_ROOT, GID_WHEEL, 0600, "ttyc%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_ttyi = devfs_add_devswf(&sio_cdevsw,
- unit | CONTROL_INIT_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CONTROL_INIT_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttyic%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_ttyl = devfs_add_devswf(&sio_cdevsw,
- unit | CONTROL_LOCK_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CONTROL_LOCK_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttylc%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cuaa = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK,
UID_UUCP, GID_DIALER, 0660, "cuac%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cuai = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK | CONTROL_INIT_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_INIT_STATE,
UID_UUCP, GID_DIALER, 0660, "cuaic%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cual = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_LOCK_STATE,
UID_UUCP, GID_DIALER, 0660, "cualc%r%r", adapter,
unit % CY_MAX_PORTS);
-#endif
}
}
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 48ecb9f..56b0bbc 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,12 +27,10 @@
* 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.90 1999/05/31 11:25:57 phk Exp $
+ * $Id: cy.c,v 1.91 1999/06/04 18:13:25 bde Exp $
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
-
#include "cy.h"
/*
@@ -80,10 +78,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/syslog.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
#include <machine/clock.h>
#include <machine/ipl.h>
#ifndef SMP
@@ -325,14 +319,6 @@ struct com_s {
*/
u_char obuf1[256];
u_char obuf2[256];
-#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
};
/* PCI driver entry point. */
@@ -636,32 +622,24 @@ cyattach_common(cy_iobase, cy_align)
register_swi(SWI_TTY, siopoll);
sio_registered = TRUE;
}
-#ifdef DEVFS
- com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw,
- unit, DV_CHR,
+ make_dev(&sio_cdevsw, unit,
UID_ROOT, GID_WHEEL, 0600, "ttyc%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_ttyi = devfs_add_devswf(&sio_cdevsw,
- unit | CONTROL_INIT_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CONTROL_INIT_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttyic%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_ttyl = devfs_add_devswf(&sio_cdevsw,
- unit | CONTROL_LOCK_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CONTROL_LOCK_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttylc%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cuaa = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK,
UID_UUCP, GID_DIALER, 0660, "cuac%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cuai = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK | CONTROL_INIT_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_INIT_STATE,
UID_UUCP, GID_DIALER, 0660, "cuaic%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cual = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_LOCK_STATE,
UID_UUCP, GID_DIALER, 0660, "cualc%r%r", adapter,
unit % CY_MAX_PORTS);
-#endif
}
}
diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c
index e16c979..3e7e14e 100644
--- a/sys/dev/dgb/dgb.c
+++ b/sys/dev/dgb/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.49 1999/05/30 16:51:56 phk Exp $
+ * dgb.c $Id: dgb.c,v 1.50 1999/05/31 11:25:31 phk Exp $
*
* Digiboard driver.
*
@@ -28,7 +28,6 @@
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
#include "opt_dgb.h"
#include "dgb.h"
@@ -55,9 +54,6 @@
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
@@ -148,16 +144,6 @@ struct dgb_p {
u_char draining; /* port is being drained now */
u_char used; /* port is being used now */
u_char mustdrain; /* data must be waited to drain in dgbparam() */
-#ifdef DEVFS
- struct {
- void *tty;
- void *ttyi;
- void *ttyl;
- void *cua;
- void *cuai;
- void *cual;
- } devfs_token;
-#endif
};
/* Digiboard per-board structure */
@@ -546,9 +532,7 @@ dgbattach(dev)
ushort *pstat;
int lowwater;
static int nports=0;
-#ifdef DEVFS
char suffix;
-#endif
if(sc->status!=ENABLED) {
DPRINT2(DB_EXCEPT,"dbg%d: try to attach a disabled card\n",unit);
@@ -917,39 +901,25 @@ load_fep:
termioschars(&port->it_in);
port->it_in.c_ispeed = port->it_in.c_ospeed = dgbdefaultrate;
port->it_out = port->it_in;
-#ifdef DEVFS
/* MAX_DGB_PORTS is 32 => [0-9a-v] */
suffix = i < 10 ? '0' + i : 'a' + i - 10;
- port->devfs_token.tty =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyD%d%c", unit, suffix);
-
- port->devfs_token.ttyi =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+32,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyiD%d%c", unit, suffix);
-
- port->devfs_token.ttyl =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+64,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttylD%d%c", unit, suffix);
-
- port->devfs_token.cua =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+128,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaD%d%c", unit, suffix);
-
- port->devfs_token.cuai =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+160,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaiD%d%c", unit, suffix);
-
- port->devfs_token.cual =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+192,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cualD%d%c", unit, suffix);
-#endif
+ make_dev(&dgb_cdevsw, (unit*32)+i,
+ UID_ROOT, GID_WHEEL, 0600, "ttyD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+32,
+ UID_ROOT, GID_WHEEL, 0600, "ttyiD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+64,
+ UID_ROOT, GID_WHEEL, 0600, "ttylD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+128,
+ UID_UUCP, GID_DIALER, 0660, "cuaD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+160,
+ UID_UUCP, GID_DIALER, 0660, "cuaiD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+192,
+ UID_UUCP, GID_DIALER, 0660, "cualD%d%c", unit, suffix);
}
hidewin(sc);
diff --git a/sys/dev/dgb/dgm.c b/sys/dev/dgb/dgm.c
index 6fa36ba..b289be4 100644
--- a/sys/dev/dgb/dgm.c
+++ b/sys/dev/dgb/dgm.c
@@ -1,5 +1,5 @@
/*-
- * $Id: dgm.c,v 1.14 1999/05/30 16:51:58 phk Exp $
+ * $Id: dgm.c,v 1.15 1999/05/31 11:25:33 phk Exp $
*
* This driver and the associated header files support the ISA PC/Xem
* Digiboards. Its evolutionary roots are described below.
@@ -32,7 +32,6 @@
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
#include "dgm.h"
@@ -59,9 +58,6 @@
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <machine/clock.h>
@@ -150,16 +146,6 @@ struct dgm_p {
u_char draining; /* port is being drained now */
u_char used; /* port is being used now */
u_char mustdrain; /* data must be waited to drain in dgmparam() */
-#ifdef DEVFS
- struct {
- void *tty;
- void *ttyi;
- void *ttyl;
- void *cua;
- void *cuai;
- void *cual;
- } devfs_token;
-#endif
};
/* Digiboard per-board structure */
@@ -726,37 +712,18 @@ dgmattach(dev)
termioschars(&port->it_in);
port->it_in.c_ispeed = port->it_in.c_ospeed = dgmdefaultrate;
port->it_out = port->it_in;
-#ifdef DEVFS
- port->devfs_token.tty =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyM%d%x", unit, i + 0xa0);
-
- port->devfs_token.ttyi =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+64,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyiM%d%x", unit, i + 0xa0);
-
- port->devfs_token.ttyl =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+128,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttylM%d%x", unit, i + 0xa0);
-
- port->devfs_token.cua =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+262144,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaM%d%x", unit, i + 0xa0);
-
- port->devfs_token.cuai =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+262208,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaiM%d%x", unit, i + 0xa0);
-
- port->devfs_token.cual =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+262272,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cualM%d%x", unit, i + 0xa0);
-#endif
+ make_dev(&dgm_cdevsw, (unit*65536)+i,
+ UID_ROOT, GID_WHEEL, 0600, "ttyM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+64,
+ UID_ROOT, GID_WHEEL, 0600, "ttyiM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+128,
+ UID_ROOT, GID_WHEEL, 0600, "ttylM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+262144,
+ UID_UUCP, GID_DIALER, 0660, "cuaM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+262208,
+ UID_UUCP, GID_DIALER, 0660, "cuaiM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+262272,
+ UID_UUCP, GID_DIALER, 0660, "cualM%d%x", unit, i + 0xa0);
}
hidewin(sc);
diff --git a/sys/dev/dpt/dpt.h b/sys/dev/dpt/dpt.h
index af59b81..298f132 100644
--- a/sys/dev/dpt/dpt.h
+++ b/sys/dev/dpt/dpt.h
@@ -40,21 +40,13 @@
*/
-#ident "$Id: dpt.h,v 1.3 1998/09/20 07:19:52 gibbs Exp $"
+#ident "$Id: dpt.h,v 1.4 1998/09/22 04:55:07 gibbs Exp $"
#ifndef _DPT_H
#define _DPT_H
#include <sys/ioccom.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#ifdef SLICE
-#include <sys/device.h>
-#include <dev/slice/slice.h>
-#endif /* SLICE */
-#endif
-
#define DPT_CDEV_MAJOR 88
#undef DPT_USE_DLM_SWI
diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c
index 4e03f78..3828d08 100644
--- a/sys/dev/dpt/dpt_pci.c
+++ b/sys/dev/dpt/dpt_pci.c
@@ -32,9 +32,8 @@
* dptpci.c: PCI Bus Attachment for DPT SCSI HBAs
*/
-#ident "$Id: dpt_pci.c,v 1.13 1999/05/09 17:06:44 peter Exp $"
+#ident "$Id: dpt_pci.c,v 1.14 1999/08/16 01:52:20 gibbs Exp $"
-#include "opt_devfs.h"
#include "opt_dpt.h"
#include <sys/param.h>
diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c
index 2b1eead..ba697cf 100644
--- a/sys/dev/fb/fb.c
+++ b/sys/dev/fb/fb.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: fb.c,v 1.6 1999/06/22 14:13:22 yokota Exp $
+ * $Id: fb.c,v 1.7 1999/07/04 14:58:15 phk Exp $
*/
#include "fb.h"
@@ -409,8 +409,6 @@ fb_attach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw)
vidcdevsw[adp->va_index] = cdevsw;
splx(s);
- /* XXX: DEVFS? */
-
printf("fb%d at %s%d\n", adp->va_index, adp->va_name, adp->va_unit);
return 0;
}
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index c86bc86..dc1a699 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -47,12 +47,11 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.151 1999/07/29 11:27:33 joerg Exp $
+ * $Id: fd.c,v 1.152 1999/08/14 11:40:41 phk Exp $
*
*/
#include "fd.h"
-#include "opt_devfs.h"
#include "opt_fdc.h"
#if NFDC > 0
@@ -80,10 +79,6 @@
#include <machine/resource.h>
#include <machine/stdarg.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-
#include <isa/isavar.h>
#include <isa/isareg.h>
#include <isa/fdreg.h>
@@ -184,10 +179,6 @@ struct fd_data {
struct callout_handle toffhandle;
struct callout_handle tohandle;
struct devstat device_stats;
-#ifdef DEVFS
- void *bdevs[1 + NUMDENS + MAXPARTITIONS];
- void *cdevs[1 + NUMDENS + MAXPARTITIONS];
-#endif
device_t dev;
fdu_t fdu;
};
@@ -915,78 +906,9 @@ static int
fd_attach(device_t dev)
{
struct fd_data *fd;
-#ifdef DEVFS
- int i;
- int mynor;
- int typemynor;
- int typesize;
-#endif
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);
- for (i = 1; i < 1 + NUMDENS; i++) {
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- switch (fd->type) {
- case FD_360:
- if (i != FD_360)
- continue;
- break;
- case FD_720:
- if (i != FD_720 && i != FD_800 && i != FD_820)
- continue;
- break;
- case FD_1200:
- if (i != FD_360 && i != FD_720 && i != FD_800
- && i != FD_820 && i != FD_1200
- && i != FD_1440 && i != FD_1480)
- continue;
- break;
- case FD_1440:
- if (i != FD_720 && i != FD_800 && i != FD_820
- && i != FD_1200 && i != FD_1440
- && i != FD_1480 && i != FD_1720)
- continue;
- break;
- }
- typesize = fd_types[i - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- typemynor = mynor | i;
- fd->bdevs[i] =
- devfs_add_devswf(&fd_cdevsw, typemynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d.%d", fd->fdu, typesize);
- fd->cdevs[i] =
- devfs_add_devswf(&fd_cdevsw, typemynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d.%d", fd->fdu, typesize);
- }
-
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fd->fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] =
- devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fd->fdu, 'a' + i);
- }
-#endif /* DEVFS */
/*
* Export the drive to the devstat interface.
*/
@@ -1010,11 +932,6 @@ static int yeattach(struct isa_device *dev)
fdu_t fdu;
fd_p fd;
int st0, st3, i;
-#ifdef DEVFS
- int mynor;
- int typemynor;
- int typesize;
-#endif
fdc->fdcu = fdcu;
/*
* the FDC_PCMCIA flag is used to to indicate special PIO is used
@@ -1090,41 +1007,6 @@ static int yeattach(struct isa_device *dev)
printf("fdc%d: 1.44MB 3.5in PCMCIA\n", fdcu);
fd->type = FD_1440;
-#ifdef DEVFS
- mynor = fdcu << 6;
- fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d", fdu);
- fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d", fdu);
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- typemynor = mynor | FD_1440;
- typesize = fd_types[FD_1440 - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- fd->bdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_BLK, UID_ROOT, GID_OPERATOR,
- 0640, "fd%d.%d", fdu, typesize);
- fd->cdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640,"rfd%d.%d", fdu, typesize);
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] = devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fdu, 'a' + i);
- }
-#endif /* DEVFS */
return (1);
}
#endif
diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c
index a2edbd5..56c90d1 100644
--- a/sys/dev/joy/joy.c
+++ b/sys/dev/joy/joy.c
@@ -29,16 +29,10 @@
#include "joy.h"
#if NJOY > 0
-
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/uio.h>
#include <machine/clock.h>
@@ -75,9 +69,6 @@ static struct {
int port;
int x_off[2], y_off[2];
int timeout[2];
-#ifdef DEVFS
- void *devfs_token;
-#endif
} joy[NJOY];
@@ -141,11 +132,7 @@ joyattach (struct isa_device *dev)
joy[unit].port = dev->id_iobase;
joy[unit].timeout[0] = joy[unit].timeout[1] = 0;
printf("joy%d: joystick\n", unit);
-#ifdef DEVFS
- joy[dev->id_unit].devfs_token =
- devfs_add_devswf(&joy_cdevsw, 0, DV_CHR, 0, 0,
- 0600, "joy%d", unit);
-#endif
+ make_dev(&joy_cdevsw, 0, 0, 0, 0600, "joy%d", unit);
return 1;
}
diff --git a/sys/dev/kbd/atkbd.c b/sys/dev/kbd/atkbd.c
index 0d00ee6..3786ee9 100644
--- a/sys/dev/kbd/atkbd.c
+++ b/sys/dev/kbd/atkbd.c
@@ -23,13 +23,12 @@
* (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: atkbd.c,v 1.13 1999/08/15 06:06:14 yokota Exp $
+ * $Id: atkbd.c,v 1.14 1999/08/22 09:52:32 yokota Exp $
*/
#include "atkbd.h"
#include "opt_kbd.h"
#include "opt_atkbd.h"
-#include "opt_devfs.h"
#if NATKBD > 0
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index 17e9b0c..0f50017 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -40,14 +40,12 @@
* 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.107 1999/05/30 16:52:19 phk Exp $
+ * $Id: mcd.c,v 1.108 1999/05/31 11:26:15 phk Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
#include "mcd.h"
#if NMCD > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -57,9 +55,6 @@ static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
#include <sys/dkbad.h>
#include <sys/disklabel.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
@@ -150,12 +145,6 @@ static struct mcd_data {
short debug;
struct buf_queue_head head; /* head of buf queue */
struct mcd_mbx mbx;
-#ifdef DEVFS
- void *ra_devfs_token; /* store the devfs handle here */
- void *rc_devfs_token; /* store the devfs handle here */
- void *a_devfs_token; /* store the devfs handle here */
- void *c_devfs_token; /* store the devfs handle here */
-#endif
} mcd_data[NMCD];
/* reader state machine */
@@ -275,24 +264,14 @@ int mcd_attach(struct isa_device *dev)
mcd_configure(cd);
#endif
/* name filled in probe */
-#ifdef DEVFS
- cd->ra_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rmcd%da", unit);
- cd->rc_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rmcd%dc", unit);
- cd->a_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "mcd%da", unit);
- cd->c_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "mcd%dc", unit);
-#endif
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rmcd%da", unit);
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rmcd%dc", unit);
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "mcd%da", unit);
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "mcd%dc", unit);
return 1;
}
diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c
index a8676bc..ddc41a8 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.43 1999/05/30 16:52:20 phk Exp $
+ * $Id: mse.c,v 1.44 1999/05/31 11:26:17 phk Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -46,8 +46,6 @@
#include "mse.h"
#if NMSE > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -55,9 +53,6 @@
#include <sys/poll.h>
#include <sys/select.h>
#include <sys/uio.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
#include <machine/mouse.h>
@@ -127,10 +122,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 */
@@ -281,14 +272,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/dev/pci/pci.c b/sys/dev/pci/pci.c
index 78b0cda..75f41e8 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -23,13 +23,12 @@
* (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: pci.c,v 1.113 1999/07/28 07:57:47 dfr Exp $
+ * $Id: pci.c,v 1.114 1999/07/29 01:03:03 mdodd Exp $
*
*/
#include "opt_bus.h"
-#include "opt_devfs.h"
#include "opt_simos.h"
#include <sys/param.h>
@@ -42,9 +41,6 @@
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/buf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -916,22 +912,6 @@ static struct cdevsw pcicdev = {
/* bmaj */ -1
};
-#ifdef DEVFS
-static void *pci_devfs_token;
-#endif
-
-static void
-pci_cdevinit(void *dummy)
-{
- cdevsw_add(&pcicdev);
-#ifdef DEVFS
- pci_devfs_token = devfs_add_devswf(&pcicdev, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0644, "pci");
-#endif
-}
-
-SYSINIT(pcidev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+PCI_CDEV, pci_cdevinit, NULL);
-
#include "pci_if.h"
/*
@@ -1109,9 +1089,14 @@ pci_add_children(device_t dev, int busno)
static int
pci_new_probe(device_t dev)
{
- device_set_desc(dev, "PCI bus");
+ static int once;
+ device_set_desc(dev, "PCI bus");
pci_add_children(dev, device_get_unit(dev));
+ if (!once) {
+ make_dev(&pcicdev, 0, UID_ROOT, GID_WHEEL, 0644, "pci");
+ once++;
+ }
return 0;
}
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index cfc8b13..956c6a7 100644
--- a/sys/dev/ppbus/lpt.c
+++ b/sys/dev/ppbus/lpt.c
@@ -48,7 +48,7 @@
* from: unknown origin, 386BSD 0.1
* From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
* From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp
- * $Id: lpt.c,v 1.5 1999/05/31 11:24:56 phk Exp $
+ * $Id: lpt.c,v 1.6 1999/06/03 22:03:35 peter Exp $
*/
/*
@@ -63,7 +63,6 @@
#ifdef KERNEL
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -72,9 +71,6 @@
#include <sys/kernel.h>
#include <sys/uio.h>
#include <sys/syslog.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/malloc.h>
#include <machine/clock.h>
@@ -136,10 +132,6 @@ struct lpt_data {
#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
u_char sc_backoff ; /* time to call lptout() again */
-#ifdef DEVFS
- void *devfs_token;
- void *devfs_token_ctl;
-#endif
};
static int nlpt = 0;
@@ -438,15 +430,10 @@ lptattach(struct ppb_device *dev)
lpt_release_ppbus(sc);
-#ifdef DEVFS
- sc->devfs_token = devfs_add_devswf(&lpt_cdevsw,
- dev->id_unit, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", dev->id_unit);
- sc->devfs_token_ctl = devfs_add_devswf(&lpt_cdevsw,
- dev->id_unit | LP_BYPASS, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", dev->id_unit);
-#endif
-
+ make_dev(&lpt_cdevsw, dev->id_unit,
+ UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", dev->id_unit);
+ make_dev(&lpt_cdevsw, dev->id_unit | LP_BYPASS,
+ UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", dev->id_unit);
return (1);
}
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 78b94f2..78dd5f5 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -33,8 +33,6 @@
#include "rc.h"
#if NRC > 0
-#include "opt_devfs.h"
-
/*#define RCDEBUG*/
#include <sys/param.h>
@@ -46,10 +44,6 @@
#include <sys/fcntl.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
-
#include <machine/clock.h>
#include <machine/ipl.h>
@@ -148,9 +142,6 @@ static struct rc_chans {
u_char *rc_obufend; /* end of output buf */
u_char rc_ibuf[4 * RC_IBUFSIZE]; /* input buffer */
u_char rc_obuf[RC_OBUFSIZE]; /* output buffer */
-#ifdef DEVFS
- void *devfs_token;
-#endif
} rc_chans[NRC * CD180_NCHAN];
static int rc_scheduled_event = 0;
@@ -274,14 +265,6 @@ rcattach(dvp)
tp->t_lflag = tp->t_iflag = tp->t_oflag = 0;
tp->t_cflag = TTYDEF_CFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
-#ifdef DEVFS
-/* FIX THIS to reflect real devices */
- rc->devfs_token =
- devfs_add_devswf(&rc_cdevsw,
- (dvp->id_unit * CD180_NCHAN) + chan,
- DV_CHR, 0, 0, 0600, "rc%d.%d",
- dvp->id_unit, chan);
-#endif
}
rcb->rcb_probed = RC_ATTACHED;
if (!rc_started) {
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c
index c1913a0..b16f6e4 100644
--- a/sys/dev/rp/rp.c
+++ b/sys/dev/rp/rp.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rp.c,v 1.27 1999/05/30 16:52:22 phk Exp $
+ * $Id: rp.c,v 1.28 1999/05/31 11:26:24 phk Exp $
*/
/*
@@ -1178,13 +1178,6 @@ rp_pciattach(pcici_t tag, int unit)
rp->rp_cts = (ChanStatus & CTS_ACT) != 0;
line = (unit << 5) | (aiop << 3) | chan;
rp_table(line) = rp;
-/* devfs_add_devswf(&rp_cdevsw,
- port, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyR%r", port);
- devfs_add_devswf(&rp_cdevsw,
- port | CONTROL_INIT_STATE, DV_CHR, UID_ROOT,
- GID_WHEEL, 0600, "ttyRi%r", port);
-*/
}
}
}
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index ff4832d..a9e39f1 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.46 1999/05/30 16:52:24 phk Exp $ */
+/* $Id: scd.c,v 1.47 1999/05/31 11:26:26 phk Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -49,7 +49,6 @@
#include "scd.h"
#if NSCD > 0
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -58,9 +57,6 @@
#include <sys/dkbad.h>
#include <sys/disklabel.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
#include <machine/stdarg.h>
@@ -136,12 +132,6 @@ static struct scd_data {
short audio_status;
struct buf_queue_head head; /* head of buf queue */
struct scd_mbx mbx;
-#ifdef DEVFS
- void *ra_devfs_token;
- void *rc_devfs_token;
- void *a_devfs_token;
- void *c_devfs_token;
-#endif
} scd_data[NSCD];
/* prototypes */
@@ -232,24 +222,14 @@ scd_attach(struct isa_device *dev)
cd->audio_status = CD_AS_AUDIO_INVALID;
bufq_init(&cd->head);
-#ifdef DEVFS
- cd->ra_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rscd%da", unit);
- cd->rc_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rscd%dc", unit);
- cd->a_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "scd%da", unit);
- cd->c_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "scd%dc", unit);
-#endif
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rscd%da", unit);
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rscd%dc", unit);
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "scd%da", unit);
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "scd%dc", unit);
return 1;
}
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index 5ec570a..c2f3b98 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.87 1999/05/31 11:26:28 phk Exp $
+ * $Id: si.c,v 1.88 1999/08/18 17:42:41 nsayer Exp $
*/
#ifndef lint
@@ -41,7 +41,6 @@ static const char si_copyright1[] = "@(#) Copyright (C) Specialix International
#include "opt_compat.h"
#include "opt_debug_si.h"
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -56,9 +55,6 @@ static const char si_copyright1[] = "@(#) Copyright (C) Specialix International
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/sysctl.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
@@ -249,17 +245,6 @@ struct si_softc {
int sc_eisa_iobase; /* EISA io port address */
int sc_eisa_irq; /* EISA irq number */
#endif
-#ifdef DEVFS
- struct {
- void *ttya;
- void *cuaa;
- void *ttyl;
- void *cual;
- void *ttyi;
- void *cuai;
- } devfs_token[32]; /* what is the max per card? */
- void *control_token;
-#endif
};
static struct si_softc si_softc[NSI]; /* up to 4 elements */
@@ -1100,34 +1085,18 @@ try_next2:
done_chartimes = 1;
}
-#ifdef DEVFS
/* path name devsw minor type uid gid perm*/
for ( x = 0; x < sc->sc_nport; x++ ) {
/* sync with the manuals that start at 1 */
y = x + 1 + id->id_unit * (1 << SI_CARDSHIFT);
- sc->devfs_token[x].ttya = devfs_add_devswf(
- &si_cdevsw, x,
- DV_CHR, 0, 0, 0600, "ttyA%02d", y);
- sc->devfs_token[x].cuaa = devfs_add_devswf(
- &si_cdevsw, x + 0x00080,
- DV_CHR, 0, 0, 0600, "cuaA%02d", y);
- sc->devfs_token[x].ttyi = devfs_add_devswf(
- &si_cdevsw, x + 0x10000,
- DV_CHR, 0, 0, 0600, "ttyiA%02d", y);
- sc->devfs_token[x].cuai = devfs_add_devswf(
- &si_cdevsw, x + 0x10080,
- DV_CHR, 0, 0, 0600, "cuaiA%02d", y);
- sc->devfs_token[x].ttyl = devfs_add_devswf(
- &si_cdevsw, x + 0x20000,
- DV_CHR, 0, 0, 0600, "ttylA%02d", y);
- sc->devfs_token[x].cual = devfs_add_devswf(
- &si_cdevsw, x + 0x20080,
- DV_CHR, 0, 0, 0600, "cualA%02d", y);
- }
- sc->control_token =
- devfs_add_devswf(&si_cdevsw, 0x40000, DV_CHR, 0, 0, 0600,
- "si_control");
-#endif
+ make_dev( &si_cdevsw, x, 0, 0, 0600, "ttyA%02d", y);
+ make_dev( &si_cdevsw, x + 0x00080, 0, 0, 0600, "cuaA%02d", y);
+ make_dev( &si_cdevsw, x + 0x10000, 0, 0, 0600, "ttyiA%02d", y);
+ make_dev( &si_cdevsw, x + 0x10080, 0, 0, 0600, "cuaiA%02d", y);
+ make_dev( &si_cdevsw, x + 0x20000, 0, 0, 0600, "ttylA%02d", y);
+ make_dev( &si_cdevsw, x + 0x20080, 0, 0, 0600, "cualA%02d", y);
+ }
+ make_dev(&si_cdevsw, 0x40000, 0, 0, 0600, "si_control");
return (1);
}
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 815209b..7a8c247 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/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.254 1999/08/09 10:34:55 phk Exp $
+ * $Id: sio.c,v 1.255 1999/08/09 11:02:38 phk 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" */
@@ -70,9 +69,6 @@
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <sys/timepps.h>
#include <isa/isareg.h>
@@ -298,14 +294,6 @@ struct com_s {
*/
u_char obuf1[256];
u_char obuf2[256];
-#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
@@ -1124,26 +1112,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/dev/snp/snp.c b/sys/dev/snp/snp.c
index 936ce92..0e7bf1a 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -12,7 +12,7 @@
*
* Snoop stuff.
*
- * $Id$
+ * $Id: tty_snoop.c,v 1.40 1999/06/17 23:42:44 gpalmer Exp $
*/
#include "snp.h"
@@ -20,8 +20,6 @@
#if NSNP > 0
#include "opt_compat.h"
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/filio.h>
@@ -34,9 +32,6 @@
#include <sys/conf.h>
#include <sys/poll.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/snoop.h>
#include <sys/vnode.h>
@@ -521,31 +516,17 @@ snppoll(dev, events, p)
return (revents);
}
-#ifdef DEVFS
-static void *snp_devfs_token[NSNP];
-#endif
-static int snp_devsw_installed;
-
static void snp_drvinit __P((void *unused));
+
static void
snp_drvinit(unused)
void *unused;
{
-#ifdef DEVFS
int i;
-#endif
- if( ! snp_devsw_installed ) {
- cdevsw_add(&snp_cdevsw);
- snp_devsw_installed = 1;
-#ifdef DEVFS
- for ( i = 0 ; i < NSNP ; i++) {
- snp_devfs_token[i] =
- devfs_add_devswf(&snp_cdevsw, i, DV_CHR, 0, 0,
- 0600, "snp%d", i);
- }
-#endif
- }
+ cdevsw_add(&snp_cdevsw);
+ for ( i = 0 ; i < NSNP ; i++)
+ make_dev(&snp_cdevsw, i, 0, 0, 0600, "snp%d", i);
}
SYSINIT(snpdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,snp_drvinit,NULL)
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index b11251f..29f8205 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -4,15 +4,13 @@
* 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.38 1999/08/17 20:25:49 billf Exp $
+ * $Id: spkr.c,v 1.39 1999/08/23 20:35:17 bde Exp $
*/
#include "speaker.h"
#if NSPEAKER > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -24,11 +22,6 @@
#include <machine/clock.h>
#include <machine/speaker.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-static void *devfs_token;
-#endif
-
static d_open_t spkropen;
static d_close_t spkrclose;
static d_write_t spkrwrite;
@@ -604,11 +597,7 @@ spkrioctl(dev, cmd, cmdarg, flags, p)
static void
spkr_drvinit(void *unused)
{
- cdevsw_add(&spkr_cdevsw);
-#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");
}
SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL)
diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c
index 07717d5..685d724 100644
--- a/sys/dev/streams/streams.c
+++ b/sys/dev/streams/streams.c
@@ -30,11 +30,10 @@
* skeleton produced from /usr/share/examples/drivers/make_pseudo_driver.sh
* in 3.0-980524-SNAP then hacked a bit (but probably not enough :-).
*
- * $Id: streams.c,v 1.8 1999/08/01 12:51:06 newton Exp $
+ * $Id: streams.c,v 1.9 1999/08/04 18:53:37 green Exp $
*/
#include "streams.h" /* generated file.. defines NSTREAMS */
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h> /* SYSINIT stuff */
@@ -53,9 +52,6 @@
#include <netinet/in.h>
#include <sys/proc.h>
#include <sys/uio.h>
-#ifdef DEVFS
-#include <sys/devfsext.h> /* DEVFS defintitions */
-#endif /* DEVFS */
#include <sys/sysproto.h>
@@ -129,22 +125,6 @@ static struct cdevsw streams_cdevsw = {
struct streams_softc {
struct isa_device *dev;
-#ifdef DEVFS
- /*
- * If this ever becomes an LKM we'll want this crud so we can deallocate
- * devfs entries when the module is unloaded
- */
- void *devfs_ptm;
- void *devfs_arp;
- void *devfs_icmp;
- void *devfs_ip;
- void *devfs_tcp;
- void *devfs_udp;
- void *devfs_rawip;
- void *devfs_unix_dgram;
- void *devfs_unix_stream;
- void *devfs_unix_ord_stream;
-#endif
} ;
#define UNIT(dev) minor(dev) /* assume one minor number per unit */
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
index a65ba2c..57f19a5 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/dev/syscons/syscons.h
@@ -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: syscons.h,v 1.50 1999/07/07 13:48:50 yokota Exp $
+ * $Id: syscons.h,v 1.51 1999/08/20 20:25:00 julian Exp $
*/
#ifndef _DEV_SYSCONS_SYSCONS_H_
@@ -207,11 +207,6 @@ typedef struct sc_softc {
struct scr_stat *old_scp;
int delayed_next_scr;
- /* uncontitional as you'd need to check opt_devfs in about 25 files */
- void *devfs_token[MAXCONS];
- void *mouse_devfs_token;
- void *console_devfs_token;
-
char font_loading_in_progress;
char switch_in_progress;
char videoio_in_progress;
diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c
index 9c349f8..22a5963 100644
--- a/sys/fs/coda/coda_fbsd.c
+++ b/sys/fs/coda/coda_fbsd.c
@@ -27,12 +27,11 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_fbsd.cr,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_fbsd.c,v 1.14 1999/05/30 16:51:10 phk Exp $
+ * $Id: coda_fbsd.c,v 1.15 1999/05/31 11:24:16 phk Exp $
*
*/
#include "vcoda.h"
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -52,13 +51,6 @@
#include <coda/coda_vnops.h>
#include <coda/coda_psdev.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-
-static void *cfs_devfs_token[NVCODA];
-static void *coda_devfs_token[NVCODA];
-#endif
-
/*
From: "Jordan K. Hubbard" <jkh@time.cdrom.com>
Subject: Re: New 3.0 SNAPshot CDROM about ready for production..
@@ -101,38 +93,12 @@ int vcdebug = 1;
static int
codadev_modevent(module_t mod, int type, void *data)
{
-#ifdef DEVFS
- int i;
-#endif
- static struct cdevsw *oldcdevsw;
switch (type) {
case MOD_LOAD:
cdevsw_add(&codadevsw);
-#ifdef DEVFS
- /* tmp */
-#undef NVCODA
-#define NVCODA 1
- for (i = 0; i < NVCODA; i++) {
- cfs_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "cfs%d", i);
- coda_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "coda%d", i);
- }
-#endif
break;
case MOD_UNLOAD:
-#ifdef DEVFS
- for (i = 0; i < NVCODA; i++) {
- devfs_remove_dev(cfs_devfs_token[i]);
- devfs_remove_dev(coda_devfs_token[i]);
- }
-#endif
- cdevsw_add(oldcdevsw);
break;
default:
break;
diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c
index e16c979..3e7e14e 100644
--- a/sys/gnu/i386/isa/dgb.c
+++ b/sys/gnu/i386/isa/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.49 1999/05/30 16:51:56 phk Exp $
+ * dgb.c $Id: dgb.c,v 1.50 1999/05/31 11:25:31 phk Exp $
*
* Digiboard driver.
*
@@ -28,7 +28,6 @@
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
#include "opt_dgb.h"
#include "dgb.h"
@@ -55,9 +54,6 @@
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
@@ -148,16 +144,6 @@ struct dgb_p {
u_char draining; /* port is being drained now */
u_char used; /* port is being used now */
u_char mustdrain; /* data must be waited to drain in dgbparam() */
-#ifdef DEVFS
- struct {
- void *tty;
- void *ttyi;
- void *ttyl;
- void *cua;
- void *cuai;
- void *cual;
- } devfs_token;
-#endif
};
/* Digiboard per-board structure */
@@ -546,9 +532,7 @@ dgbattach(dev)
ushort *pstat;
int lowwater;
static int nports=0;
-#ifdef DEVFS
char suffix;
-#endif
if(sc->status!=ENABLED) {
DPRINT2(DB_EXCEPT,"dbg%d: try to attach a disabled card\n",unit);
@@ -917,39 +901,25 @@ load_fep:
termioschars(&port->it_in);
port->it_in.c_ispeed = port->it_in.c_ospeed = dgbdefaultrate;
port->it_out = port->it_in;
-#ifdef DEVFS
/* MAX_DGB_PORTS is 32 => [0-9a-v] */
suffix = i < 10 ? '0' + i : 'a' + i - 10;
- port->devfs_token.tty =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyD%d%c", unit, suffix);
-
- port->devfs_token.ttyi =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+32,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyiD%d%c", unit, suffix);
-
- port->devfs_token.ttyl =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+64,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttylD%d%c", unit, suffix);
-
- port->devfs_token.cua =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+128,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaD%d%c", unit, suffix);
-
- port->devfs_token.cuai =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+160,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaiD%d%c", unit, suffix);
-
- port->devfs_token.cual =
- devfs_add_devswf(&dgb_cdevsw, (unit*32)+i+192,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cualD%d%c", unit, suffix);
-#endif
+ make_dev(&dgb_cdevsw, (unit*32)+i,
+ UID_ROOT, GID_WHEEL, 0600, "ttyD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+32,
+ UID_ROOT, GID_WHEEL, 0600, "ttyiD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+64,
+ UID_ROOT, GID_WHEEL, 0600, "ttylD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+128,
+ UID_UUCP, GID_DIALER, 0660, "cuaD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+160,
+ UID_UUCP, GID_DIALER, 0660, "cuaiD%d%c", unit, suffix);
+
+ make_dev(&dgb_cdevsw, (unit*32)+i+192,
+ UID_UUCP, GID_DIALER, 0660, "cualD%d%c", unit, suffix);
}
hidewin(sc);
diff --git a/sys/gnu/i386/isa/dgm.c b/sys/gnu/i386/isa/dgm.c
index 6fa36ba..b289be4 100644
--- a/sys/gnu/i386/isa/dgm.c
+++ b/sys/gnu/i386/isa/dgm.c
@@ -1,5 +1,5 @@
/*-
- * $Id: dgm.c,v 1.14 1999/05/30 16:51:58 phk Exp $
+ * $Id: dgm.c,v 1.15 1999/05/31 11:25:33 phk Exp $
*
* This driver and the associated header files support the ISA PC/Xem
* Digiboards. Its evolutionary roots are described below.
@@ -32,7 +32,6 @@
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
#include "dgm.h"
@@ -59,9 +58,6 @@
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <machine/clock.h>
@@ -150,16 +146,6 @@ struct dgm_p {
u_char draining; /* port is being drained now */
u_char used; /* port is being used now */
u_char mustdrain; /* data must be waited to drain in dgmparam() */
-#ifdef DEVFS
- struct {
- void *tty;
- void *ttyi;
- void *ttyl;
- void *cua;
- void *cuai;
- void *cual;
- } devfs_token;
-#endif
};
/* Digiboard per-board structure */
@@ -726,37 +712,18 @@ dgmattach(dev)
termioschars(&port->it_in);
port->it_in.c_ispeed = port->it_in.c_ospeed = dgmdefaultrate;
port->it_out = port->it_in;
-#ifdef DEVFS
- port->devfs_token.tty =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyM%d%x", unit, i + 0xa0);
-
- port->devfs_token.ttyi =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+64,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyiM%d%x", unit, i + 0xa0);
-
- port->devfs_token.ttyl =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+128,
- DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttylM%d%x", unit, i + 0xa0);
-
- port->devfs_token.cua =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+262144,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaM%d%x", unit, i + 0xa0);
-
- port->devfs_token.cuai =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+262208,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cuaiM%d%x", unit, i + 0xa0);
-
- port->devfs_token.cual =
- devfs_add_devswf(&dgm_cdevsw, (unit*65536)+i+262272,
- DV_CHR, UID_UUCP, GID_DIALER, 0660,
- "cualM%d%x", unit, i + 0xa0);
-#endif
+ make_dev(&dgm_cdevsw, (unit*65536)+i,
+ UID_ROOT, GID_WHEEL, 0600, "ttyM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+64,
+ UID_ROOT, GID_WHEEL, 0600, "ttyiM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+128,
+ UID_ROOT, GID_WHEEL, 0600, "ttylM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+262144,
+ UID_UUCP, GID_DIALER, 0660, "cuaM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+262208,
+ UID_UUCP, GID_DIALER, 0660, "cuaiM%d%x", unit, i + 0xa0);
+ make_dev(&dgm_cdevsw, (unit*65536)+i+262272,
+ UID_UUCP, GID_DIALER, 0660, "cualM%d%x", unit, i + 0xa0);
}
hidewin(sc);
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c
index 69c5692..eb5ed62 100644
--- a/sys/i386/apm/apm.c
+++ b/sys/i386/apm/apm.c
@@ -15,19 +15,14 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.101 1999/08/22 14:48:00 iwasaki Exp $
+ * $Id: apm.c,v 1.102 1999/08/22 19:51:33 peter Exp $
*/
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/eventhandler.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/time.h>
#include <sys/reboot.h>
#include <sys/bus.h>
@@ -79,9 +74,6 @@ struct apm_softc {
int event_ptr;
struct apm_event_info event_list[APM_NEVENTS];
u_char event_filter[APM_NPMEV];
-#ifdef DEVFS
- void *sc_devfs_token;
-#endif
};
#define SCFLAG_ONORMAL 0x0000001
#define SCFLAG_OCTL 0x0000002
@@ -1131,10 +1123,7 @@ apm_attach(device_t dev)
sc->initialized = 1;
-#ifdef DEVFS
- sc->sc_devfs_token =
- devfs_add_devswf(&apm_cdevsw, 0, DV_CHR, 0, 0, 0600, "apm");
-#endif
+ make_dev(&apm_cdevsw, 0, 0, 0, 0600, "apm");
return 0;
}
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c
index 69c5692..eb5ed62 100644
--- a/sys/i386/bios/apm.c
+++ b/sys/i386/bios/apm.c
@@ -15,19 +15,14 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.101 1999/08/22 14:48:00 iwasaki Exp $
+ * $Id: apm.c,v 1.102 1999/08/22 19:51:33 peter Exp $
*/
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/eventhandler.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/time.h>
#include <sys/reboot.h>
#include <sys/bus.h>
@@ -79,9 +74,6 @@ struct apm_softc {
int event_ptr;
struct apm_event_info event_list[APM_NEVENTS];
u_char event_filter[APM_NPMEV];
-#ifdef DEVFS
- void *sc_devfs_token;
-#endif
};
#define SCFLAG_ONORMAL 0x0000001
#define SCFLAG_OCTL 0x0000002
@@ -1131,10 +1123,7 @@ apm_attach(device_t dev)
sc->initialized = 1;
-#ifdef DEVFS
- sc->sc_devfs_token =
- devfs_add_devswf(&apm_cdevsw, 0, DV_CHR, 0, 0, 0600, "apm");
-#endif
+ make_dev(&apm_cdevsw, 0, 0, 0, 0600, "apm");
return 0;
}
diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c
index 02827d0..4c37086 100644
--- a/sys/i386/i386/mem.c
+++ b/sys/i386/i386/mem.c
@@ -38,23 +38,19 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.62 1999/05/30 16:52:04 phk Exp $
+ * $Id: mem.c,v 1.63 1999/05/31 11:25:44 phk Exp $
*/
/*
* Memory special file
*/
-#include "opt_devfs.h"
#include "opt_perfmon.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/buf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#include <sys/kernel.h>
#include <sys/uio.h>
#include <sys/ioccom.h>
@@ -118,51 +114,6 @@ static int random_ioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
struct mem_range_softc mem_range_softc;
-#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");
- io_devfs_token =
- devfs_add_devswf(&mem_cdevsw, 14, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600, "io");
-#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)
@@ -661,10 +612,6 @@ iszerodev(dev)
&& minor(dev) == 12);
}
-
-
-static int mem_devsw_installed;
-
static void
mem_drvinit(void *unused)
{
@@ -673,14 +620,16 @@ mem_drvinit(void *unused)
if (mem_range_softc.mr_op != NULL)
mem_range_softc.mr_op->init(&mem_range_softc);
- /* device registration */
- if( ! mem_devsw_installed ) {
- cdevsw_add(&mem_cdevsw);
- mem_devsw_installed = 1;
-#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");
+ make_dev(&mem_cdevsw, 14, UID_ROOT, GID_WHEEL, 0600, "io");
+#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/i386/isa/asc.c b/sys/i386/isa/asc.c
index 700271a..dce5783 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.37 1999/05/30 16:52:07 phk Exp $
+ * $Id: asc.c,v 1.38 1999/05/31 11:25:50 phk Exp $
*/
#include "asc.h"
@@ -48,12 +48,6 @@
#include <sys/kernel.h>
#include <sys/poll.h>
#include <sys/select.h>
-
-#include "opt_devfs.h"
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/uio.h>
#include <machine/asc_ioctl.h>
@@ -162,12 +156,6 @@ struct asc_unit {
struct selinfo selp;
int height; /* height, for pnm modes */
size_t bcount; /* bytes to read, for pnm modes */
-#ifdef DEVFS
- void *devfs_asc; /* storage for devfs tokens (handles) */
- void *devfs_ascp;
- void *devfs_ascd;
- void *devfs_ascpd;
-#endif
};
static struct asc_unit unittab[NASC];
@@ -497,23 +485,15 @@ ascattach(struct isa_device *isdp)
scu->selp.si_flags=0;
scu->selp.si_pid=(pid_t)0;
-#ifdef DEVFS
#define ASC_UID 0
#define ASC_GID 13
- scu->devfs_asc =
- devfs_add_devswf(&asc_cdevsw, unit<<6, DV_CHR, ASC_UID,
- ASC_GID, 0666, "asc%d", unit);
- scu->devfs_ascp =
- devfs_add_devswf(&asc_cdevsw, ((unit<<6) + FRMT_PBM), DV_CHR,
- ASC_UID, ASC_GID, 0666, "asc%dp", unit);
- scu->devfs_ascd =
- devfs_add_devswf(&asc_cdevsw, ((unit<<6) + DBUG_MASK), DV_CHR,
- ASC_UID, ASC_GID, 0666, "asc%dd", unit);
- scu->devfs_ascpd =
- devfs_add_devswf(&asc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM),
- DV_CHR, ASC_UID, ASC_GID, 0666, "asc%dpd",
- unit);
-#endif /*DEVFS*/
+ make_dev(&asc_cdevsw, unit<<6, ASC_UID, ASC_GID, 0666, "asc%d", unit);
+ make_dev(&asc_cdevsw, ((unit<<6) + FRMT_PBM),
+ ASC_UID, ASC_GID, 0666, "asc%dp", unit);
+ make_dev(&asc_cdevsw, ((unit<<6) + DBUG_MASK),
+ ASC_UID, ASC_GID, 0666, "asc%dd", unit);
+ make_dev(&asc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM),
+ ASC_UID, ASC_GID, 0666, "asc%dpd", unit);
return ATTACH_SUCCESS;
}
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c
index 0613e7e..865f82b 100644
--- a/sys/i386/isa/atapi-cd.c
+++ b/sys/i386/isa/atapi-cd.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: atapi-cd.c,v 1.19 1999/05/30 16:52:08 phk Exp $
+ * $Id: atapi-cd.c,v 1.20 1999/05/31 11:25:51 phk Exp $
*/
#include "wdc.h"
#include "wcd.h"
-#include "opt_devfs.h"
#if NWCD > 0 && NWDC > 0
@@ -47,9 +46,6 @@
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/stat.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <i386/isa/atapi.h>
#include <i386/isa/atapi-cd.h>
@@ -144,24 +140,14 @@ acd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun,
}
else
ptr->device_stats = device_stats;
-#ifdef DEVFS
- ptr->ra_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwcd%da", lun);
- ptr->rc_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwcd%dc", lun);
- ptr->a_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wcd%da", lun);
- ptr->c_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wcd%dc", lun);
-#endif
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rwcd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rwcd%dc", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "wcd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "wcd%dc", lun);
return ptr;
}
diff --git a/sys/i386/isa/atapi-cd.h b/sys/i386/isa/atapi-cd.h
index 86ab345..5bde4b7 100644
--- a/sys/i386/isa/atapi-cd.h
+++ b/sys/i386/isa/atapi-cd.h
@@ -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: atapi-cd.h,v 1.2 1998/10/15 08:11:55 sos Exp $
+ * $Id: atapi-cd.h,v 1.3 1999/01/31 21:51:03 sos Exp $
*/
/*
@@ -346,12 +346,6 @@ struct acd {
u_char speed; /* Select drive speed */
u_int next_writeable_lba; /* Next writable position */
struct wormio_prepare_track preptrack; /* Scratch region */
-#ifdef DEVFS
- void *ra_devfs_token;
- void *rc_devfs_token;
- void *a_devfs_token;
- void *c_devfs_token;
-#endif
};
#define CDRIOCBLANK _IO('c',100) /* Blank a CDRW disc */
diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c
index 0fc5f1e..d3bda19 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.31 1999/05/30 16:52:09 phk Exp $
+ * $Id: ctx.c,v 1.32 1999/05/31 11:25:54 phk Exp $
*/
/*
@@ -111,18 +111,12 @@
#include "ctx.h"
#if NCTX > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
-
#include <i386/isa/isa_device.h>
#include <i386/isa/ctxreg.h>
#include <machine/ioctl_ctx.h>
@@ -184,7 +178,6 @@ static struct ctx_soft_registers {
int iobase;
caddr_t maddr;
int msize;
- void *devfs_token;
} ctx_sr[NCTX];
@@ -216,11 +209,7 @@ ctxattach(struct isa_device * devp)
sr->iobase = devp->id_iobase;
sr->maddr = devp->id_maddr;
sr->msize = devp->id_msize;
-#ifdef DEVFS
- sr->devfs_token =
- devfs_add_devswf(&ctx_cdevsw, 0, DV_CHR, 0, 0, 0600,
- "ctx%d", devp->id_unit);
-#endif /* DEVFS */
+ make_dev(&ctx_cdevsw, 0, 0, 0, 0600, "ctx%d", devp->id_unit);
return (1);
}
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 48ecb9f..56b0bbc 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,12 +27,10 @@
* 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.90 1999/05/31 11:25:57 phk Exp $
+ * $Id: cy.c,v 1.91 1999/06/04 18:13:25 bde Exp $
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
-
#include "cy.h"
/*
@@ -80,10 +78,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/syslog.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
#include <machine/clock.h>
#include <machine/ipl.h>
#ifndef SMP
@@ -325,14 +319,6 @@ struct com_s {
*/
u_char obuf1[256];
u_char obuf2[256];
-#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
};
/* PCI driver entry point. */
@@ -636,32 +622,24 @@ cyattach_common(cy_iobase, cy_align)
register_swi(SWI_TTY, siopoll);
sio_registered = TRUE;
}
-#ifdef DEVFS
- com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw,
- unit, DV_CHR,
+ make_dev(&sio_cdevsw, unit,
UID_ROOT, GID_WHEEL, 0600, "ttyc%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_ttyi = devfs_add_devswf(&sio_cdevsw,
- unit | CONTROL_INIT_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CONTROL_INIT_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttyic%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_ttyl = devfs_add_devswf(&sio_cdevsw,
- unit | CONTROL_LOCK_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CONTROL_LOCK_STATE,
UID_ROOT, GID_WHEEL, 0600, "ttylc%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cuaa = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK,
UID_UUCP, GID_DIALER, 0660, "cuac%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cuai = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK | CONTROL_INIT_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_INIT_STATE,
UID_UUCP, GID_DIALER, 0660, "cuaic%r%r", adapter,
unit % CY_MAX_PORTS);
- com->devfs_token_cual = devfs_add_devswf(&sio_cdevsw,
- unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR,
+ make_dev(&sio_cdevsw, unit | CALLOUT_MASK | CONTROL_LOCK_STATE,
UID_UUCP, GID_DIALER, 0660, "cualc%r%r", adapter,
unit % CY_MAX_PORTS);
-#endif
}
}
diff --git a/sys/i386/isa/gpib.c b/sys/i386/isa/gpib.c
index 1aff398..a809a2e 100644
--- a/sys/i386/isa/gpib.c
+++ b/sys/i386/isa/gpib.c
@@ -24,18 +24,12 @@
#if NGP > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
-
#include <i386/isa/gpibreg.h>
#include <i386/isa/gpib.h>
#include <i386/isa/isa_device.h>
@@ -110,9 +104,6 @@ static struct gpib_softc {
u_char sc_flags; /* flags (open and internal) */
char sc_unit; /* gpib device number */
char *sc_inbuf; /* buffer for data */
-#ifdef DEVFS
- void *devfs_token; /* handle for devfs entry */
-#endif
} gpib_sc; /* only support one of these? */
static int oldcount;
static char oldbytes[2];
@@ -158,10 +149,7 @@ gpattach(isdp)
printf ("gp%d: type AT-GPIB chip NAT4882A\n",sc->sc_unit);
sc->sc_flags |=ATTACHED;
-#ifdef DEVFS
- sc->devfs_token =
- devfs_add_devswf(&gp_cdevsw, 0, DV_CHR, 0, 0, 0600, "gp");
-#endif
+ make_dev(&gp_cdevsw, 0, 0, 0, 0600, "gp");
return (1);
}
diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c
index 48bd5f2..b7f429a 100644
--- a/sys/i386/isa/gsc.c
+++ b/sys/i386/isa/gsc.c
@@ -34,18 +34,12 @@
#include "gsc.h"
#if NGSC > 0
-
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/buf.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/uio.h>
#include <machine/gsc.h>
@@ -159,12 +153,6 @@ struct gsc_unit {
int height; /* height, for pnm modes */
size_t bcount; /* bytes to read, for pnm modes */
struct _sbuf hbuf; /* buffer for pnm header data */
-#ifdef DEVFS
- void *devfs_gsc; /* storage for devfs tokens (handles) */
- void *devfs_gscp;
- void *devfs_gscd;
- void *devfs_gscpd;
-#endif
};
static struct gsc_unit unittab[NGSC];
@@ -546,23 +534,15 @@ gscattach(struct isa_device *isdp)
scu->flags |= ATTACHED;
lprintf(("gsc%d.attach: ok\n", unit));
scu->flags &= ~FLAG_DEBUG;
-#ifdef DEVFS
#define GSC_UID 0
#define GSC_GID 13
- scu->devfs_gsc =
- devfs_add_devswf(&gsc_cdevsw, unit<<6, DV_CHR, GSC_UID, GSC_GID,
- 0666, "gsc%d", unit);
- scu->devfs_gscp =
- devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + FRMT_PBM), DV_CHR,
- GSC_UID, GSC_GID, 0666, "gsc%dp", unit);
- scu->devfs_gscd =
- devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + DBUG_MASK), DV_CHR,
- GSC_UID, GSC_GID, 0666, "gsc%dd", unit);
- scu->devfs_gscpd =
- devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM),
- DV_CHR, GSC_UID, GSC_GID, 0666, "gsc%dpd",
- unit);
-#endif /*DEVFS*/
+ make_dev(&gsc_cdevsw, unit<<6, GSC_UID, GSC_GID, 0666, "gsc%d", unit);
+ make_dev(&gsc_cdevsw, ((unit<<6) + FRMT_PBM),
+ GSC_UID, GSC_GID, 0666, "gsc%dp", unit);
+ make_dev(&gsc_cdevsw, ((unit<<6) + DBUG_MASK),
+ GSC_UID, GSC_GID, 0666, "gsc%dd", unit);
+ make_dev(&gsc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM),
+ GSC_UID, GSC_GID, 0666, "gsc%dpd", unit);
return ATTACH_SUCCESS;
}
diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c
index 260a1c2..e29fb51 100644
--- a/sys/i386/isa/if_cx.c
+++ b/sys/i386/isa/if_cx.c
@@ -20,8 +20,6 @@
#include "cx.h"
#include "bpf.h"
-#include "opt_devfs.h"
-
#include "sppp.h"
#if NSPPP <= 0
#error The device 'cx' requires sppp.
@@ -43,10 +41,6 @@
#endif
#include <i386/isa/isa_device.h>
-#ifdef DEVFS
-extern struct cdevsw cx_cdevsw;
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#define watchdog_func_t void(*)(struct ifnet *)
#define start_func_t void(*)(struct ifnet*)
@@ -216,10 +210,6 @@ cxprobe (struct isa_device *id)
* The adapter is present, initialize the driver structures.
*/
-#ifdef DEVFS
-static void *cx_devfs_token;
-#endif
-
static int
cxattach (struct isa_device *id)
{
@@ -300,10 +290,11 @@ cxattach (struct isa_device *id)
timeout (cxtimeout, 0, hz*5);
printf ("cx%d: <Cronyx-%s>\n", unit, b->name);
-#ifdef DEVFS
- cx_devfs_token =
- devfs_add_devswf(&cx_cdevsw, 0, DV_CHR, 0, 0, 0600, "cx");
-#endif
+ {
+ extern struct cdevsw cx_cdevsw;
+
+ make_dev(&cx_cdevsw, 0, 0, 0, 0600, "cx");
+ }
return (1);
}
diff --git a/sys/i386/isa/joy.c b/sys/i386/isa/joy.c
index a2edbd5..56c90d1 100644
--- a/sys/i386/isa/joy.c
+++ b/sys/i386/isa/joy.c
@@ -29,16 +29,10 @@
#include "joy.h"
#if NJOY > 0
-
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/uio.h>
#include <machine/clock.h>
@@ -75,9 +69,6 @@ static struct {
int port;
int x_off[2], y_off[2];
int timeout[2];
-#ifdef DEVFS
- void *devfs_token;
-#endif
} joy[NJOY];
@@ -141,11 +132,7 @@ joyattach (struct isa_device *dev)
joy[unit].port = dev->id_iobase;
joy[unit].timeout[0] = joy[unit].timeout[1] = 0;
printf("joy%d: joystick\n", unit);
-#ifdef DEVFS
- joy[dev->id_unit].devfs_token =
- devfs_add_devswf(&joy_cdevsw, 0, DV_CHR, 0, 0,
- 0600, "joy%d", unit);
-#endif
+ make_dev(&joy_cdevsw, 0, 0, 0, 0600, "joy%d", unit);
return 1;
}
diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c
index d1b9798..a19b86a 100644
--- a/sys/i386/isa/labpc.c
+++ b/sys/i386/isa/labpc.c
@@ -41,8 +41,6 @@
#include "labpc.h"
#include "opt_debug_outb.h"
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
@@ -53,9 +51,6 @@
#define b_actf b_act.tqe_next
#include <sys/dataacq.h>
#include <sys/conf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#ifdef LOUTB
#include <machine/clock.h>
@@ -151,9 +146,6 @@ struct ctlr
/* Device configuration structure:
*/
-#ifdef DEVFS
- void *devfs_token;
-#endif
};
#ifdef LOUTB
@@ -503,13 +495,7 @@ labpcattach(struct isa_device *dev)
ctlr->dcr_is = 0x80;
loutb(DCR(ctlr), ctlr->dcr_val);
-#ifdef DEVFS
- ctlr->devfs_token =
- devfs_add_devswf(&labpc_cdevsw, 0, DV_CHR,
- /* what UID GID PERM */
- 0, 0, 0600,
- "labpc%d", dev->id_unit);
-#endif
+ make_dev(&labpc_cdevsw, 0, 0, 0, 0600, "labpc%d", dev->id_unit);
return 1;
}
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index 9ffd002..4705d15 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -337,14 +337,13 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95";
static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV";
/* The proceeding strings may not be changed*/
-/* $Id: matcd.c,v 1.41 1999/05/31 11:26:55 phk Exp $ */
+/* $Id: matcd.c,v 1.42 1999/07/03 21:02:09 peter Exp $ */
/*---------------------------------------------------------------------------
Include declarations
---------------------------------------------------------------------------*/
#include "matcd.h"
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -362,9 +361,6 @@ static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank
#include <sys/conf.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <i386/isa/isa_device.h>
@@ -428,16 +424,6 @@ static struct matcd_data {
struct matcd_mbx mbx;
u_char patch[2]; /*<12>Last known audio routing*/
u_char volume[2]; /*<12>Last known volume setting*/
-#ifdef DEVFS
- void *ra_devfs_token; /* handle for devfs entry */
- void *rc_devfs_token;
- void *a_devfs_token;
- void *c_devfs_token;
- void *rla_devfs_token;
- void *rlc_devfs_token;
- void *la_devfs_token;
- void *lc_devfs_token;
-#endif /* DEVFS */
} matcd_data[TOTALDRIVES];
@@ -1414,32 +1400,15 @@ matcd_attach(struct isa_device *dev)
for (i=0; i<MAXPARTITIONS; i++) {
cd->partflags[i]=0;
}
-#ifdef DEVFS
- cd->ra_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- dkmakeminor(i, 0, 0), DV_CHR,
+ make_dev(&matcd_cdevsw, dkmakeminor(i, 0, 0),
UID_ROOT, GID_OPERATOR, 0640, "rmatcd%da", i);
- cd->rc_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- dkmakeminor(i, 0, RAW_PART), DV_CHR,
+ make_dev(&matcd_cdevsw, dkmakeminor(i, 0, RAW_PART),
UID_ROOT, GID_OPERATOR, 0640, "rmatcd%dc", i);
- cd->a_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- dkmakeminor(i, 0, 0), DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640, "matcd%da", i);
- cd->c_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- dkmakeminor(i, 0, RAW_PART), DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640, "matcd%dc", i);
- cd->rla_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- 0x80 | dkmakeminor(i, 0, 0), DV_CHR,
+ make_dev(&matcd_cdevsw, 0x80 | dkmakeminor(i, 0, 0),
UID_ROOT, GID_OPERATOR, 0640, "rmatcd%dla", i);
- cd->rlc_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- 0x80 | dkmakeminor(i, 0, RAW_PART), DV_CHR,
+ make_dev(&matcd_cdevsw,
+ 0x80 | dkmakeminor(i, 0, RAW_PART),
UID_ROOT, GID_OPERATOR, 0640, "rmatcd%dc", i);
- cd->la_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- 0x80 | dkmakeminor(i, 0, 0), DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640, "matcd%dla", i);
- cd->lc_devfs_token = devfs_add_devswf(&matcd_cdevsw,
- 0x80 | dkmakeminor(i, 0, RAW_PART), DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640, "matcd%dlc", i);
-#endif
}
}
nextcontroller++; /*Bump ctlr assign to next number*/
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index 17e9b0c..0f50017 100644
--- a/sys/i386/isa/mcd.c
+++ b/sys/i386/isa/mcd.c
@@ -40,14 +40,12 @@
* 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.107 1999/05/30 16:52:19 phk Exp $
+ * $Id: mcd.c,v 1.108 1999/05/31 11:26:15 phk Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
#include "mcd.h"
#if NMCD > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -57,9 +55,6 @@ static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
#include <sys/dkbad.h>
#include <sys/disklabel.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
@@ -150,12 +145,6 @@ static struct mcd_data {
short debug;
struct buf_queue_head head; /* head of buf queue */
struct mcd_mbx mbx;
-#ifdef DEVFS
- void *ra_devfs_token; /* store the devfs handle here */
- void *rc_devfs_token; /* store the devfs handle here */
- void *a_devfs_token; /* store the devfs handle here */
- void *c_devfs_token; /* store the devfs handle here */
-#endif
} mcd_data[NMCD];
/* reader state machine */
@@ -275,24 +264,14 @@ int mcd_attach(struct isa_device *dev)
mcd_configure(cd);
#endif
/* name filled in probe */
-#ifdef DEVFS
- cd->ra_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rmcd%da", unit);
- cd->rc_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rmcd%dc", unit);
- cd->a_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "mcd%da", unit);
- cd->c_devfs_token =
- devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "mcd%dc", unit);
-#endif
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rmcd%da", unit);
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rmcd%dc", unit);
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "mcd%da", unit);
+ make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "mcd%dc", unit);
return 1;
}
diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c
index a8676bc..ddc41a8 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.43 1999/05/30 16:52:20 phk Exp $
+ * $Id: mse.c,v 1.44 1999/05/31 11:26:17 phk Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -46,8 +46,6 @@
#include "mse.h"
#if NMSE > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -55,9 +53,6 @@
#include <sys/poll.h>
#include <sys/select.h>
#include <sys/uio.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
#include <machine/mouse.h>
@@ -127,10 +122,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 */
@@ -281,14 +272,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/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c
index 8ed04da..cdf3b35 100644
--- a/sys/i386/isa/pcaudio.c
+++ b/sys/i386/isa/pcaudio.c
@@ -25,13 +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.49 1999/05/30 16:52:21 phk Exp $
+ * $Id: pcaudio.c,v 1.50 1999/05/31 11:26:19 phk Exp $
*/
#include "pca.h"
#if NPCA > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -48,10 +46,6 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-
#define BUF_SIZE 8192
#define SAMPLE_RATE 8000
#define INTERRUPT_RATE 16000
@@ -118,11 +112,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;
@@ -329,13 +318,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/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index c4e9f94..4f0bfd6 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -79,18 +79,9 @@
#include "vt.h"
#if NVT > 0
-#include "opt_devfs.h"
-
#define EXTERN /* allocate mem */
#include <i386/isa/pcvt/pcvt_hdr.h> /* global include */
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#if !defined(MAXCONS)
-#define MAXCONS 16
-#endif
-static void *pcvt_devfs_token[MAXCONS];
-#endif /*DEVFS*/
#if PCVT_FREEBSD >= 200
#include <sys/bus.h>
@@ -220,9 +211,6 @@ pcattach(struct isa_device *dev)
{
#endif /* PCVT_NETBSD > 9 */
-#ifdef DEVFS
- int vt;
-#endif /*DEVFS*/
int i;
vt_coldmalloc(); /* allocate memory for screens */
@@ -389,14 +377,6 @@ pcattach(struct isa_device *dev)
#if PCVT_FREEBSD > 205
cdevsw_add(&pc_cdevsw);
-
-#ifdef DEVFS
- for(vt = 0; vt < MAXCONS; vt++) {
- pcvt_devfs_token[vt] =
- devfs_add_devswf(&pc_cdevsw, vt,
- DV_CHR, 0, 0, 0600, "ttyv%r", vt );
- }
-#endif DEVFS
#endif /* PCVT_FREEBSD > 205 */
#if PCVT_NETBSD > 9
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index 78b94f2..78dd5f5 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -33,8 +33,6 @@
#include "rc.h"
#if NRC > 0
-#include "opt_devfs.h"
-
/*#define RCDEBUG*/
#include <sys/param.h>
@@ -46,10 +44,6 @@
#include <sys/fcntl.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
-
#include <machine/clock.h>
#include <machine/ipl.h>
@@ -148,9 +142,6 @@ static struct rc_chans {
u_char *rc_obufend; /* end of output buf */
u_char rc_ibuf[4 * RC_IBUFSIZE]; /* input buffer */
u_char rc_obuf[RC_OBUFSIZE]; /* output buffer */
-#ifdef DEVFS
- void *devfs_token;
-#endif
} rc_chans[NRC * CD180_NCHAN];
static int rc_scheduled_event = 0;
@@ -274,14 +265,6 @@ rcattach(dvp)
tp->t_lflag = tp->t_iflag = tp->t_oflag = 0;
tp->t_cflag = TTYDEF_CFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
-#ifdef DEVFS
-/* FIX THIS to reflect real devices */
- rc->devfs_token =
- devfs_add_devswf(&rc_cdevsw,
- (dvp->id_unit * CD180_NCHAN) + chan,
- DV_CHR, 0, 0, 0600, "rc%d.%d",
- dvp->id_unit, chan);
-#endif
}
rcb->rcb_probed = RC_ATTACHED;
if (!rc_started) {
diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c
index c1913a0..b16f6e4 100644
--- a/sys/i386/isa/rp.c
+++ b/sys/i386/isa/rp.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rp.c,v 1.27 1999/05/30 16:52:22 phk Exp $
+ * $Id: rp.c,v 1.28 1999/05/31 11:26:24 phk Exp $
*/
/*
@@ -1178,13 +1178,6 @@ rp_pciattach(pcici_t tag, int unit)
rp->rp_cts = (ChanStatus & CTS_ACT) != 0;
line = (unit << 5) | (aiop << 3) | chan;
rp_table(line) = rp;
-/* devfs_add_devswf(&rp_cdevsw,
- port, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "ttyR%r", port);
- devfs_add_devswf(&rp_cdevsw,
- port | CONTROL_INIT_STATE, DV_CHR, UID_ROOT,
- GID_WHEEL, 0600, "ttyRi%r", port);
-*/
}
}
}
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index ff4832d..a9e39f1 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.46 1999/05/30 16:52:24 phk Exp $ */
+/* $Id: scd.c,v 1.47 1999/05/31 11:26:26 phk Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -49,7 +49,6 @@
#include "scd.h"
#if NSCD > 0
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -58,9 +57,6 @@
#include <sys/dkbad.h>
#include <sys/disklabel.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
#include <machine/stdarg.h>
@@ -136,12 +132,6 @@ static struct scd_data {
short audio_status;
struct buf_queue_head head; /* head of buf queue */
struct scd_mbx mbx;
-#ifdef DEVFS
- void *ra_devfs_token;
- void *rc_devfs_token;
- void *a_devfs_token;
- void *c_devfs_token;
-#endif
} scd_data[NSCD];
/* prototypes */
@@ -232,24 +222,14 @@ scd_attach(struct isa_device *dev)
cd->audio_status = CD_AS_AUDIO_INVALID;
bufq_init(&cd->head);
-#ifdef DEVFS
- cd->ra_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rscd%da", unit);
- cd->rc_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rscd%dc", unit);
- cd->a_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "scd%da", unit);
- cd->c_devfs_token =
- devfs_add_devswf(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "scd%dc", unit);
-#endif
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rscd%da", unit);
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rscd%dc", unit);
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "scd%da", unit);
+ make_dev(&scd_cdevsw, dkmakeminor(unit, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "scd%dc", unit);
return 1;
}
diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c
index 5ec570a..c2f3b98 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.87 1999/05/31 11:26:28 phk Exp $
+ * $Id: si.c,v 1.88 1999/08/18 17:42:41 nsayer Exp $
*/
#ifndef lint
@@ -41,7 +41,6 @@ static const char si_copyright1[] = "@(#) Copyright (C) Specialix International
#include "opt_compat.h"
#include "opt_debug_si.h"
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -56,9 +55,6 @@ static const char si_copyright1[] = "@(#) Copyright (C) Specialix International
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/sysctl.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
@@ -249,17 +245,6 @@ struct si_softc {
int sc_eisa_iobase; /* EISA io port address */
int sc_eisa_irq; /* EISA irq number */
#endif
-#ifdef DEVFS
- struct {
- void *ttya;
- void *cuaa;
- void *ttyl;
- void *cual;
- void *ttyi;
- void *cuai;
- } devfs_token[32]; /* what is the max per card? */
- void *control_token;
-#endif
};
static struct si_softc si_softc[NSI]; /* up to 4 elements */
@@ -1100,34 +1085,18 @@ try_next2:
done_chartimes = 1;
}
-#ifdef DEVFS
/* path name devsw minor type uid gid perm*/
for ( x = 0; x < sc->sc_nport; x++ ) {
/* sync with the manuals that start at 1 */
y = x + 1 + id->id_unit * (1 << SI_CARDSHIFT);
- sc->devfs_token[x].ttya = devfs_add_devswf(
- &si_cdevsw, x,
- DV_CHR, 0, 0, 0600, "ttyA%02d", y);
- sc->devfs_token[x].cuaa = devfs_add_devswf(
- &si_cdevsw, x + 0x00080,
- DV_CHR, 0, 0, 0600, "cuaA%02d", y);
- sc->devfs_token[x].ttyi = devfs_add_devswf(
- &si_cdevsw, x + 0x10000,
- DV_CHR, 0, 0, 0600, "ttyiA%02d", y);
- sc->devfs_token[x].cuai = devfs_add_devswf(
- &si_cdevsw, x + 0x10080,
- DV_CHR, 0, 0, 0600, "cuaiA%02d", y);
- sc->devfs_token[x].ttyl = devfs_add_devswf(
- &si_cdevsw, x + 0x20000,
- DV_CHR, 0, 0, 0600, "ttylA%02d", y);
- sc->devfs_token[x].cual = devfs_add_devswf(
- &si_cdevsw, x + 0x20080,
- DV_CHR, 0, 0, 0600, "cualA%02d", y);
- }
- sc->control_token =
- devfs_add_devswf(&si_cdevsw, 0x40000, DV_CHR, 0, 0, 0600,
- "si_control");
-#endif
+ make_dev( &si_cdevsw, x, 0, 0, 0600, "ttyA%02d", y);
+ make_dev( &si_cdevsw, x + 0x00080, 0, 0, 0600, "cuaA%02d", y);
+ make_dev( &si_cdevsw, x + 0x10000, 0, 0, 0600, "ttyiA%02d", y);
+ make_dev( &si_cdevsw, x + 0x10080, 0, 0, 0600, "cuaiA%02d", y);
+ make_dev( &si_cdevsw, x + 0x20000, 0, 0, 0600, "ttylA%02d", y);
+ make_dev( &si_cdevsw, x + 0x20080, 0, 0, 0600, "cualA%02d", y);
+ }
+ make_dev(&si_cdevsw, 0x40000, 0, 0, 0600, "si_control");
return (1);
}
diff --git a/sys/i386/isa/snd/sound.c b/sys/i386/isa/snd/sound.c
index 6737ee5..4e2062f 100644
--- a/sys/i386/isa/snd/sound.c
+++ b/sys/i386/isa/snd/sound.c
@@ -50,12 +50,7 @@
*
*/
-#include "opt_devfs.h"
-
#include <i386/isa/snd/sound.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#if NPCM > 0 /* from "pcm.h" via disgusting #include in snd/sound.h */
@@ -337,10 +332,6 @@ pcmattach(struct isa_device * dev)
int
pcminit(snddev_info *d, int unit)
{
-#ifdef DEVFS
- void *cookie;
-#endif
-
cdevsw_add(&snd_cdevsw);
/*
@@ -354,7 +345,6 @@ pcminit(snddev_info *d, int unit)
d->play_blocksize = d->rec_blocksize = 2048 ;
d->play_fmt = d->rec_fmt = AFMT_MU_LAW ;
-#ifdef DEVFS
#ifndef GID_GAMES
#define GID_SND UID_ROOT
#else
@@ -363,42 +353,20 @@ pcminit(snddev_info *d, int unit)
#define UID_SND UID_ROOT
#define PERM_SND 0660
/*
- * XXX remember to store the returned tokens if you want to
- * be able to remove the device later
- *
* Make links to first successfully probed unit.
* Attempts by later devices to make these links will fail.
*/
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "dsp%r", unit);
- if (cookie) devfs_makelink(cookie, "dsp");
-
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP16,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "dspW%r", unit);
- if (cookie) devfs_makelink(cookie, "dspW");
-
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_AUDIO,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "audio%r", unit);
- if (cookie) devfs_makelink(cookie, "audio");
-
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_CTL,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "mixer%r", unit);
- if (cookie) devfs_makelink(cookie, "mixer");
-
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_STATUS,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "sndstat%r", unit);
- if (cookie) devfs_makelink(cookie, "sndstat");
-
-#if 0 /* these two are still unsupported... */
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_MIDIN,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "midi%r", unit);
- if (cookie) devfs_makelink(cookie, "midi");
-
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_SYNTH,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "sequencer%r", unit);
- if (cookie) devfs_makelink(cookie, "sequencer");
-#endif
-#endif /* DEVFS */
+ make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_DSP,
+ UID_SND, GID_SND, PERM_SND, "dsp%r", unit);
+ make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_DSP16,
+ UID_SND, GID_SND, PERM_SND, "dspW%r", unit);
+ make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_AUDIO,
+ UID_SND, GID_SND, PERM_SND, "audio%r", unit);
+ make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_CTL,
+ UID_SND, GID_SND, PERM_SND, "mixer%r", unit);
+ make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_STATUS,
+ UID_SND, GID_SND, PERM_SND, "sndstat%r", unit);
+
#if NAPM > 0
init_sound_apm(unit);
#endif
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c
index 0c97f90..746ea9b 100644
--- a/sys/i386/isa/sound/soundcard.c
+++ b/sys/i386/isa/sound/soundcard.c
@@ -26,13 +26,7 @@
* SUCH DAMAGE.
*
*/
-#include "opt_devfs.h"
-
#include <i386/isa/sound/sound_config.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-
#if NSND > 0 /* from "snd.h" */
#include "uart.h"
@@ -508,7 +502,6 @@ sndattach(struct isa_device * dev)
}
cdevsw_add(&snd_cdevsw);
-#ifdef DEVFS
#define GID_SND GID_GAMES
#define UID_SND UID_ROOT
#define PERM_SND 0660
@@ -517,40 +510,25 @@ sndattach(struct isa_device * dev)
* duplicate creation of same node failed (ie. bad cookie returned)
*/
if (dev->id_driver == &opldriver){
- tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ,
- DV_CHR, UID_SND, GID_SND, PERM_SND,
- "sequencer%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "sequencer");
+ make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ,
+ UID_SND, GID_SND, PERM_SND, "sequencer%r", dev->id_unit);
} else if (dev->id_driver == &mpudriver ||
dev->id_driver == &sbmididriver ||
dev->id_driver == &uartdriver){
- tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN,
- DV_CHR, UID_SND, GID_SND, PERM_SND,
- "midi%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "midi");
+ make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN,
+ UID_SND, GID_SND, PERM_SND, "midi%r", dev->id_unit);
} else {
- tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP,
- DV_CHR, UID_SND, GID_SND, PERM_SND,
- "dsp%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "dsp");
- tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16,
- DV_CHR, UID_SND, GID_SND, PERM_SND,
- "dspW%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "dspW");
- tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO,
- DV_CHR, UID_SND, GID_SND, PERM_SND,
- "audio%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "audio");
- tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL,
- DV_CHR, UID_SND, GID_SND, PERM_SND,
- "mixer%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "mixer");
- tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS,
- DV_CHR, UID_SND, GID_SND, PERM_SND,
- "sndstat%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "sndstat");
+ make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP,
+ UID_SND, GID_SND, PERM_SND, "dsp%r", dev->id_unit);
+ make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16,
+ UID_SND, GID_SND, PERM_SND, "dspW%r", dev->id_unit);
+ make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO,
+ UID_SND, GID_SND, PERM_SND, "audio%r", dev->id_unit);
+ make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL,
+ UID_SND, GID_SND, PERM_SND, "mixer%r", dev->id_unit);
+ make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS,
+ UID_SND, GID_SND, PERM_SND, "sndstat%r", dev->id_unit);
}
-#endif /* DEVFS */
return TRUE;
}
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c
index b2ce86d..3b64ff5 100644
--- a/sys/i386/isa/spigot.c
+++ b/sys/i386/isa/spigot.c
@@ -51,7 +51,6 @@
error "Can only have 1 spigot configured."
#endif
-#include "opt_devfs.h"
#include "opt_spigot.h"
#include <sys/param.h>
@@ -61,9 +60,6 @@ error "Can only have 1 spigot configured."
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/mman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#include <machine/frame.h>
#include <machine/md_var.h>
@@ -78,9 +74,6 @@ static struct spigot_softc {
struct proc *p;
u_long signal_num;
u_short irq;
-#ifdef DEVFS
- void *devfs_token;
-#endif
} spigot_softc[NSPIGOT];
/* flags in softc */
@@ -159,12 +152,7 @@ spigot_attach(struct isa_device *devp)
devp->id_ointr = spigintr;
ss->maddr = kvtop(devp->id_maddr);
ss->irq = devp->id_irq;
-#ifdef DEVFS
- ss->devfs_token =
- devfs_add_devswf(&spigot_cdevsw, unit, DV_CHR, 0, 0, 0644,
- "spigot%d", unit);
-#endif
-
+ make_dev(&spigot_cdevsw, unit, 0, 0, 0644, "spigot%d", unit);
return 1;
}
diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c
index b11251f..29f8205 100644
--- a/sys/i386/isa/spkr.c
+++ b/sys/i386/isa/spkr.c
@@ -4,15 +4,13 @@
* 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.38 1999/08/17 20:25:49 billf Exp $
+ * $Id: spkr.c,v 1.39 1999/08/23 20:35:17 bde Exp $
*/
#include "speaker.h"
#if NSPEAKER > 0
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -24,11 +22,6 @@
#include <machine/clock.h>
#include <machine/speaker.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-static void *devfs_token;
-#endif
-
static d_open_t spkropen;
static d_close_t spkrclose;
static d_write_t spkrwrite;
@@ -604,11 +597,7 @@ spkrioctl(dev, cmd, cmdarg, flags, p)
static void
spkr_drvinit(void *unused)
{
- cdevsw_add(&spkr_cdevsw);
-#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");
}
SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL)
diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c
index c7de9d3..3556255 100644
--- a/sys/i386/isa/tw.c
+++ b/sys/i386/isa/tw.c
@@ -32,8 +32,6 @@
#include "tw.h"
#if NTW > 0
-#include "opt_devfs.h"
-
/*
* Driver configuration parameters
*/
@@ -148,10 +146,6 @@
#include <sys/syslog.h>
#include <sys/select.h>
#include <sys/poll.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
-
#define MIN(a,b) ((a)<(b)?(a):(b))
#ifdef HIRESTIME
@@ -278,9 +272,6 @@ static struct tw_sc {
#define SC_RCV_TIME_LEN 128
int sc_rcv_time[SC_RCV_TIME_LEN]; /* usec time stamp on interrupt */
#endif /* HIRESTIME */
-#ifdef DEVFS
- void *devfs_token; /* store the devfs handle */
-#endif
} tw_sc[NTW];
static int tw_zcport; /* offset of port for zero crossing signal */
@@ -418,13 +409,7 @@ static int twattach(idp)
sc->sc_state = 0;
sc->sc_rcount = 0;
callout_handle_init(&sc->abortrcv_ch);
-
-#ifdef DEVFS
- sc->devfs_token =
- devfs_add_devswf(&tw_cdevsw, unit, DV_CHR, 0, 0,
- 0600, "tw%d", unit);
-#endif
-
+ make_dev(&tw_cdevsw, unit, 0, 0, 0600, "tw%d", unit);
return (1);
}
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index ff3d923..74de282 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.200 1999/08/09 10:34:52 phk Exp $
+ * $Id: wd.c,v 1.201 1999/08/14 11:40:40 phk Exp $
*/
/* TODO:
@@ -64,7 +64,6 @@
#if NWDC > 0
-#include "opt_devfs.h"
#include "opt_hw_wdog.h"
#include "opt_ide_delay.h"
@@ -80,9 +79,6 @@
#include <sys/devicestat.h>
#include <sys/malloc.h>
#include <sys/cons.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/bootinfo.h>
#include <machine/clock.h>
#include <machine/md_var.h>
@@ -157,10 +153,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 */
@@ -404,9 +396,6 @@ nodevice:
static int
wdattach(struct isa_device *dvp)
{
-#if defined(DEVFS)
- int mynor;
-#endif
int unit, lunit, flags, i;
struct disk *du;
struct wdparams *wp;
@@ -521,17 +510,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.
diff --git a/sys/i386/isa/wd_cd.c b/sys/i386/isa/wd_cd.c
index 0613e7e..865f82b 100644
--- a/sys/i386/isa/wd_cd.c
+++ b/sys/i386/isa/wd_cd.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: atapi-cd.c,v 1.19 1999/05/30 16:52:08 phk Exp $
+ * $Id: atapi-cd.c,v 1.20 1999/05/31 11:25:51 phk Exp $
*/
#include "wdc.h"
#include "wcd.h"
-#include "opt_devfs.h"
#if NWCD > 0 && NWDC > 0
@@ -47,9 +46,6 @@
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/stat.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <i386/isa/atapi.h>
#include <i386/isa/atapi-cd.h>
@@ -144,24 +140,14 @@ acd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun,
}
else
ptr->device_stats = device_stats;
-#ifdef DEVFS
- ptr->ra_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwcd%da", lun);
- ptr->rc_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwcd%dc", lun);
- ptr->a_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wcd%da", lun);
- ptr->c_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wcd%dc", lun);
-#endif
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rwcd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rwcd%dc", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "wcd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "wcd%dc", lun);
return ptr;
}
diff --git a/sys/i386/isa/wd_cd.h b/sys/i386/isa/wd_cd.h
index 86ab345..5bde4b7 100644
--- a/sys/i386/isa/wd_cd.h
+++ b/sys/i386/isa/wd_cd.h
@@ -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: atapi-cd.h,v 1.2 1998/10/15 08:11:55 sos Exp $
+ * $Id: atapi-cd.h,v 1.3 1999/01/31 21:51:03 sos Exp $
*/
/*
@@ -346,12 +346,6 @@ struct acd {
u_char speed; /* Select drive speed */
u_int next_writeable_lba; /* Next writable position */
struct wormio_prepare_track preptrack; /* Scratch region */
-#ifdef DEVFS
- void *ra_devfs_token;
- void *rc_devfs_token;
- void *a_devfs_token;
- void *c_devfs_token;
-#endif
};
#define CDRIOCBLANK _IO('c',100) /* Blank a CDRW disc */
diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c
index 9cf0684..a089527 100644
--- a/sys/i386/isa/wfd.c
+++ b/sys/i386/isa/wfd.c
@@ -23,7 +23,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: wfd.c,v 1.26 1999/06/24 03:09:11 msmith Exp $
+ * $Id: wfd.c,v 1.27 1999/08/14 11:40:41 phk Exp $
*/
/*
@@ -46,9 +46,6 @@
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/cdio.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <i386/isa/atapi.h>
@@ -146,10 +143,6 @@ struct wfd {
struct atapi_params *param; /* Drive parameters table */
struct cappage cap; /* Capabilities page info */
char description[80]; /* Device description */
-#ifdef DEVFS
- void *cdevs;
- void *bdevs;
-#endif
struct diskslices *dk_slices; /* virtual drives */
struct devstat device_stats;
@@ -188,9 +181,6 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
struct atapires result;
int lun, i;
-#ifdef DEVFS
- int mynor;
-#endif
if (wfdnlun >= NUNIT) {
printf ("wfd: too many units\n");
return (0);
@@ -262,15 +252,8 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
-#ifdef DEVFS
- mynor = dkmakeminor(t->lun, WHOLE_DISK_SLICE, RAW_PART);
- t->bdevs = devfs_add_devswf(&wfd_cdevsw, mynor,
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wfd%d", t->lun);
- t->cdevs = devfs_add_devswf(&wfd_cdevsw, mynor,
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwfd%d", t->lun);
-#endif /* DEVFS */
+ make_dev(&wfd_cdevsw, dkmakeminor(t->lun, WHOLE_DISK_SLICE, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rwfd%d", t->lun);
/*
* Export the drive to the devstat interface.
diff --git a/sys/i386/isa/wst.c b/sys/i386/isa/wst.c
index 94d4146..7337796 100644
--- a/sys/i386/isa/wst.c
+++ b/sys/i386/isa/wst.c
@@ -25,13 +25,12 @@
* (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: wst.c,v 1.22 1999/05/30 16:52:30 phk Exp $
+ * $Id: wst.c,v 1.23 1999/05/31 11:26:39 phk Exp $
*/
#include "wdc.h"
#include "wst.h"
#include "opt_ddb.h"
-#include "opt_devfs.h"
#if NWST > 0 && NWDC > 0
@@ -42,9 +41,6 @@
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/mtio.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <machine/clock.h>
#include <i386/isa/atapi.h>
@@ -198,10 +194,6 @@ struct wst {
struct atapi_params *param; /* Drive parameters table */
struct wst_header header; /* MODE SENSE param header */
struct wst_cappage cap; /* Capabilities page info */
-#ifdef DEVFS
- void *cdevs;
- void *bdevs;
-#endif
};
static struct wst *wsttab[NUNIT]; /* Drive info by unit number */
@@ -274,10 +266,7 @@ wstattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug)
wst_describe(t);
wstnlun++;
-#ifdef DEVFS
- t->cdevs = devfs_add_devswf(&wst_cdevsw, 0, DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640, "rwst%d", t->lun);
-#endif /* DEVFS */
+ make_dev(&wst_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0640, "rwst%d", t->lun);
return(1);
}
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index 73ccab3..36f2e01 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -20,7 +20,7 @@
* the original CMU copyright notice.
*
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
- * $Id: wt.c,v 1.51 1999/05/30 16:52:31 phk Exp $
+ * $Id: wt.c,v 1.52 1999/05/31 11:26:40 phk Exp $
*
*/
@@ -60,7 +60,6 @@
#include "wt.h"
#if NWT > 0
-#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -70,9 +69,6 @@
#include <sys/malloc.h>
#include <sys/mtio.h>
#include <sys/conf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <machine/clock.h>
@@ -162,9 +158,6 @@ typedef struct {
unsigned short DATAPORT, CMDPORT, STATPORT, CTLPORT, SDMAPORT, RDMAPORT;
unsigned char BUSY, NOEXCEP, RESETMASK, RESETVAL;
unsigned char ONLINE, RESET, REQUEST, IEN;
-#ifdef DEVFS
- void *devfs_token_r;
-#endif
} wtinfo_t;
static wtinfo_t wttab[NWT]; /* tape info by unit number */
@@ -283,11 +276,7 @@ wtattach (struct isa_device *id)
t->dens = -1; /* unknown density */
isa_dmainit(t->chan, 1024);
-#ifdef DEVFS
- t->devfs_token_r =
- devfs_add_devswf(&wt_cdevsw, id->id_unit, DV_CHR, 0, 0,
- 0600, "rwt%d", id->id_unit);
-#endif
+ make_dev(&wt_cdevsw, id->id_unit, 0, 0, 0600, "rwt%d", id->id_unit);
return (1);
}
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index c86bc86..dc1a699 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -47,12 +47,11 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.151 1999/07/29 11:27:33 joerg Exp $
+ * $Id: fd.c,v 1.152 1999/08/14 11:40:41 phk Exp $
*
*/
#include "fd.h"
-#include "opt_devfs.h"
#include "opt_fdc.h"
#if NFDC > 0
@@ -80,10 +79,6 @@
#include <machine/resource.h>
#include <machine/stdarg.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-
#include <isa/isavar.h>
#include <isa/isareg.h>
#include <isa/fdreg.h>
@@ -184,10 +179,6 @@ struct fd_data {
struct callout_handle toffhandle;
struct callout_handle tohandle;
struct devstat device_stats;
-#ifdef DEVFS
- void *bdevs[1 + NUMDENS + MAXPARTITIONS];
- void *cdevs[1 + NUMDENS + MAXPARTITIONS];
-#endif
device_t dev;
fdu_t fdu;
};
@@ -915,78 +906,9 @@ static int
fd_attach(device_t dev)
{
struct fd_data *fd;
-#ifdef DEVFS
- int i;
- int mynor;
- int typemynor;
- int typesize;
-#endif
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);
- for (i = 1; i < 1 + NUMDENS; i++) {
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- switch (fd->type) {
- case FD_360:
- if (i != FD_360)
- continue;
- break;
- case FD_720:
- if (i != FD_720 && i != FD_800 && i != FD_820)
- continue;
- break;
- case FD_1200:
- if (i != FD_360 && i != FD_720 && i != FD_800
- && i != FD_820 && i != FD_1200
- && i != FD_1440 && i != FD_1480)
- continue;
- break;
- case FD_1440:
- if (i != FD_720 && i != FD_800 && i != FD_820
- && i != FD_1200 && i != FD_1440
- && i != FD_1480 && i != FD_1720)
- continue;
- break;
- }
- typesize = fd_types[i - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- typemynor = mynor | i;
- fd->bdevs[i] =
- devfs_add_devswf(&fd_cdevsw, typemynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d.%d", fd->fdu, typesize);
- fd->cdevs[i] =
- devfs_add_devswf(&fd_cdevsw, typemynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d.%d", fd->fdu, typesize);
- }
-
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fd->fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] =
- devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fd->fdu, 'a' + i);
- }
-#endif /* DEVFS */
/*
* Export the drive to the devstat interface.
*/
@@ -1010,11 +932,6 @@ static int yeattach(struct isa_device *dev)
fdu_t fdu;
fd_p fd;
int st0, st3, i;
-#ifdef DEVFS
- int mynor;
- int typemynor;
- int typesize;
-#endif
fdc->fdcu = fdcu;
/*
* the FDC_PCMCIA flag is used to to indicate special PIO is used
@@ -1090,41 +1007,6 @@ static int yeattach(struct isa_device *dev)
printf("fdc%d: 1.44MB 3.5in PCMCIA\n", fdcu);
fd->type = FD_1440;
-#ifdef DEVFS
- mynor = fdcu << 6;
- fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d", fdu);
- fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d", fdu);
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- typemynor = mynor | FD_1440;
- typesize = fd_types[FD_1440 - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- fd->bdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_BLK, UID_ROOT, GID_OPERATOR,
- 0640, "fd%d.%d", fdu, typesize);
- fd->cdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640,"rfd%d.%d", fdu, typesize);
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] = devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fdu, 'a' + i);
- }
-#endif /* DEVFS */
return (1);
}
#endif
diff --git a/sys/isa/joy.c b/sys/isa/joy.c
index a2edbd5..56c90d1 100644
--- a/sys/isa/joy.c
+++ b/sys/isa/joy.c
@@ -29,16 +29,10 @@
#include "joy.h"
#if NJOY > 0
-
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/uio.h>
#include <machine/clock.h>
@@ -75,9 +69,6 @@ static struct {
int port;
int x_off[2], y_off[2];
int timeout[2];
-#ifdef DEVFS
- void *devfs_token;
-#endif
} joy[NJOY];
@@ -141,11 +132,7 @@ joyattach (struct isa_device *dev)
joy[unit].port = dev->id_iobase;
joy[unit].timeout[0] = joy[unit].timeout[1] = 0;
printf("joy%d: joystick\n", unit);
-#ifdef DEVFS
- joy[dev->id_unit].devfs_token =
- devfs_add_devswf(&joy_cdevsw, 0, DV_CHR, 0, 0,
- 0600, "joy%d", unit);
-#endif
+ make_dev(&joy_cdevsw, 0, 0, 0, 0600, "joy%d", unit);
return 1;
}
diff --git a/sys/isa/psm.c b/sys/isa/psm.c
index bdc39dc..e7c82c9 100644
--- a/sys/isa/psm.c
+++ b/sys/isa/psm.c
@@ -20,7 +20,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: psm.c,v 1.15 1999/08/17 12:14:13 yokota Exp $
+ * $Id: psm.c,v 1.16 1999/08/22 06:11:52 yokota Exp $
*/
/*
@@ -65,7 +65,6 @@
#ifdef __i386__
#include "apm.h"
#endif
-#include "opt_devfs.h"
#include "opt_psm.h"
#if NPSM > 0
@@ -81,9 +80,6 @@
#include <sys/malloc.h>
#include <machine/bus.h>
#include <sys/rman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <sys/select.h>
#include <sys/uio.h>
@@ -181,10 +177,6 @@ struct psm_softc { /* Driver status information */
int button; /* the latest button state */
int xold; /* previous absolute X position */
int yold; /* previous absolute Y position */
-#ifdef DEVFS
- void *devfs_token;
- void *b_devfs_token;
-#endif
#ifdef PSM_HOOKAPM
struct apmhook resumehook;
#endif
@@ -1094,14 +1086,8 @@ psmattach(device_t dev)
sc->state = PSM_VALID;
/* Done */
-#ifdef DEVFS
- sc->devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, FALSE),
- DV_CHR, 0, 0, 0666, "psm%d", unit);
- sc->b_devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, TRUE),
- DV_CHR, 0, 0, 0666, "bpsm%d", unit);
-#endif /* DEVFS */
+ make_dev(&psm_cdevsw, PSM_MKMINOR(unit, FALSE), 0, 0, 0666, "psm%d", unit);
+ make_dev(&psm_cdevsw, PSM_MKMINOR(unit, TRUE), 0, 0, 0666, "bpsm%d", unit);
#ifdef PSM_HOOKAPM
sc->resumehook.ah_name = "PS/2 mouse";
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index 815209b..7a8c247 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/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.254 1999/08/09 10:34:55 phk Exp $
+ * $Id: sio.c,v 1.255 1999/08/09 11:02:38 phk 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" */
@@ -70,9 +69,6 @@
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <sys/timepps.h>
#include <isa/isareg.h>
@@ -298,14 +294,6 @@ struct com_s {
*/
u_char obuf1[256];
u_char obuf2[256];
-#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
@@ -1124,26 +1112,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/kern/init_main.c b/sys/kern/init_main.c
index bcc7c86..7791f7f 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -39,10 +39,9 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id: init_main.c,v 1.123 1999/06/30 15:33:32 peter Exp $
+ * $Id: init_main.c,v 1.124 1999/07/01 13:21:36 peter Exp $
*/
-#include "opt_devfs.h"
#include "opt_init_path.h"
#include <sys/param.h>
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 4da89a7..2f86534 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -30,11 +30,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_conf.c,v 1.58 1999/08/17 20:25:50 billf Exp $
+ * $Id: kern_conf.c,v 1.59 1999/08/20 20:24:59 julian Exp $
*/
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
@@ -44,10 +42,6 @@
#include <sys/vnode.h>
#include <sys/queue.h>
#include <machine/stdarg.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-
#define cdevsw_ALLOCSTART (NUMCDEVSW/2)
@@ -64,6 +58,8 @@ static struct specinfo devt_stash[DEVT_STASH];
static SLIST_HEAD(devt_hash_head, specinfo) dev_hash[DEVT_HASH];
+devfs_create_t *devfs_create_hook;
+
/*
* Routine to convert from character to block device number.
*
@@ -239,9 +235,6 @@ makedev(int x, int y)
}
bzero(si, sizeof(*si));
si->si_udev = udev;
- si->si_bsize_phys = DEV_BSIZE;
- si->si_bsize_best = BLKDEV_IOSIZE;
- si->si_bsize_max = MAXBSIZE;
if (y > 256)
sprintf(si->si_name, "#%d/0x%x", x, y);
else
@@ -313,17 +306,8 @@ make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, char
va_end(ap);
dev->si_devsw = devsw;
-#ifdef DEVFS
- dev->si_devfs = devfs_add_devswf(devsw, minor, DV_CHR,
- uid, gid, perms, dev->si_name);
- /* XXX HACK .. name may not start in 'r' */
- if ((devsw->d_bmaj != -1)
- && (*dev->si_name == 'r')
- && ((devsw->d_flags & D_TYPEMASK) == D_DISK)) {
- dev->si_devfs = devfs_add_devswf(devsw, minor, DV_BLK,
- uid, gid, perms, dev->si_name + 1);
- }
-#endif /* DEVFS */
+ if (devfs_create_hook)
+ devfs_create_hook(dev, uid, gid, perms);
return (dev);
}
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index c90ce11..6532596 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -36,12 +36,10 @@
* SUCH DAMAGE.
*
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
- * $Id: kern_descrip.c,v 1.64 1999/06/07 20:37:27 msmith Exp $
+ * $Id: kern_descrip.c,v 1.65 1999/08/04 18:53:44 green Exp $
*/
#include "opt_compat.h"
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
@@ -65,10 +63,6 @@
#include <vm/vm.h>
#include <vm/vm_extern.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
-
static MALLOC_DEFINE(M_FILEDESC, "file desc", "Open file descriptor table");
MALLOC_DEFINE(M_FILE, "file", "Open file structure");
static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures");
@@ -1292,43 +1286,18 @@ SYSCTL_INT(_kern, KERN_MAXFILESPERPROC, maxfilesperproc, CTLFLAG_RW,
SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW,
&maxfiles, 0, "Maximum number of files");
-static int fildesc_devsw_installed;
-#ifdef DEVFS
-static void *devfs_token_stdin;
-static void *devfs_token_stdout;
-static void *devfs_token_stderr;
-static void *devfs_token_fildesc[NUMFDESC];
-#endif
-
-static void fildesc_drvinit(void *unused)
+static void
+fildesc_drvinit(void *unused)
{
-#ifdef DEVFS
int fd;
-#endif
- if( ! fildesc_devsw_installed ) {
- cdevsw_add(&fildesc_cdevsw);
- fildesc_devsw_installed = 1;
-#ifdef DEVFS
- for (fd = 0; fd < NUMFDESC; fd++)
- devfs_token_fildesc[fd] =
- devfs_add_devswf(&fildesc_cdevsw, fd, DV_CHR,
- UID_BIN, GID_BIN, 0666,
- "fd/%d", fd);
- devfs_token_stdin =
- devfs_add_devswf(&fildesc_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0666,
- "stdin");
- devfs_token_stdout =
- devfs_add_devswf(&fildesc_cdevsw, 1, DV_CHR,
- UID_ROOT, GID_WHEEL, 0666,
- "stdout");
- devfs_token_stderr =
- devfs_add_devswf(&fildesc_cdevsw, 2, DV_CHR,
- UID_ROOT, GID_WHEEL, 0666,
- "stderr");
-#endif
- }
+ cdevsw_add(&fildesc_cdevsw);
+ for (fd = 0; fd < NUMFDESC; fd++)
+ make_dev(&fildesc_cdevsw, fd,
+ UID_BIN, GID_BIN, 0666, "fd/%d", fd);
+ make_dev(&fildesc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "stdin");
+ make_dev(&fildesc_cdevsw, 1, UID_ROOT, GID_WHEEL, 0666, "stdout");
+ make_dev(&fildesc_cdevsw, 2, UID_ROOT, GID_WHEEL, 0666, "stderr");
}
struct fileops badfileops = {
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index 5f8ef71..d72940e 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -43,7 +43,7 @@
* from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: subr_diskslice.c,v 1.65 1999/06/21 03:48:16 grog Exp $
+ * $Id: subr_diskslice.c,v 1.66 1999/08/14 11:40:43 phk Exp $
*/
#include "opt_devfs.h"
@@ -715,6 +715,10 @@ dsopen(dname, dev, mode, flags, sspp, lp)
struct diskslices *ssp;
int unit;
+ dev->si_bsize_phys = DEV_BSIZE;
+ dev->si_bsize_best = BLKDEV_IOSIZE;
+ dev->si_bsize_max = MAXBSIZE;
+
unit = dkunit(dev);
if (lp->d_secsize % DEV_BSIZE) {
printf("%s%d: invalid sector size %lu\n", dname, unit,
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 9f6b84f..7272789 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -31,15 +31,13 @@
* SUCH DAMAGE.
*
* @(#)subr_log.c 8.1 (Berkeley) 6/10/93
- * $Id: subr_log.c,v 1.35 1999/05/30 16:52:56 phk Exp $
+ * $Id: subr_log.c,v 1.36 1999/05/31 11:27:35 phk Exp $
*/
/*
* Error log buffer for kernel printf's.
*/
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -52,9 +50,6 @@
#include <sys/kernel.h>
#include <sys/poll.h>
#include <sys/filedesc.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#define LOG_RDPRI (PZERO + 1)
@@ -264,26 +259,14 @@ logioctl(dev, com, data, flag, p)
return (0);
}
-static int log_devsw_installed;
-#ifdef DEVFS
-static void *log_devfs_token;
-#endif
static void log_drvinit __P((void *unused));
+
static void
log_drvinit(unused)
void *unused;
{
-
- if( ! log_devsw_installed ) {
- cdevsw_add(&log_cdevsw);
- log_devsw_installed = 1;
-#ifdef DEVFS
- log_devfs_token = devfs_add_devswf(&log_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "klog");
-#endif
- }
+ make_dev(&log_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "klog");
}
SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,log_drvinit,NULL)
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 0309b1e..47b7df9 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tty_pty.c 8.4 (Berkeley) 2/20/95
- * $Id: tty_pty.c,v 1.64 1999/08/17 23:08:51 julian Exp $
+ * $Id: tty_pty.c,v 1.65 1999/08/20 20:25:00 julian Exp $
*/
/*
@@ -40,8 +40,6 @@
*/
#include "pty.h" /* XXX */
#include "opt_compat.h"
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
@@ -185,10 +183,9 @@ ptsopen(dev, flag, devtype, p)
dev_t nextdev;
/*
+ * XXX: Gross hack for DEVFS:
* If we openned this device, ensure we have the
- * next ready in the DEVFS (up to 256 of them).
- * XXX probably a more efficient way of know if the next one has
- * been made already would be to just keep track..
+ * next one too, so people can open it.
*/
minr = lminor(dev);
if (minr < 255) {
@@ -837,14 +834,10 @@ static void
ptc_drvinit(unused)
void *unused;
{
- static int ptc_devsw_installed;
-
- if( ! ptc_devsw_installed ) {
- cdevsw_add(&pts_cdevsw);
- cdevsw_add(&ptc_cdevsw);
- ptc_devsw_installed = 1;
- }
- ptyinit(0); /* Add the first pty into the system.. prime the pump */
+ cdevsw_add(&pts_cdevsw);
+ cdevsw_add(&ptc_cdevsw);
+ /* XXX: Gross hack for DEVFS */
+ ptyinit(0);
}
SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR_C,ptc_drvinit,NULL)
diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c
index 936ce92..0e7bf1a 100644
--- a/sys/kern/tty_snoop.c
+++ b/sys/kern/tty_snoop.c
@@ -12,7 +12,7 @@
*
* Snoop stuff.
*
- * $Id$
+ * $Id: tty_snoop.c,v 1.40 1999/06/17 23:42:44 gpalmer Exp $
*/
#include "snp.h"
@@ -20,8 +20,6 @@
#if NSNP > 0
#include "opt_compat.h"
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/filio.h>
@@ -34,9 +32,6 @@
#include <sys/conf.h>
#include <sys/poll.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/snoop.h>
#include <sys/vnode.h>
@@ -521,31 +516,17 @@ snppoll(dev, events, p)
return (revents);
}
-#ifdef DEVFS
-static void *snp_devfs_token[NSNP];
-#endif
-static int snp_devsw_installed;
-
static void snp_drvinit __P((void *unused));
+
static void
snp_drvinit(unused)
void *unused;
{
-#ifdef DEVFS
int i;
-#endif
- if( ! snp_devsw_installed ) {
- cdevsw_add(&snp_cdevsw);
- snp_devsw_installed = 1;
-#ifdef DEVFS
- for ( i = 0 ; i < NSNP ; i++) {
- snp_devfs_token[i] =
- devfs_add_devswf(&snp_cdevsw, i, DV_CHR, 0, 0,
- 0600, "snp%d", i);
- }
-#endif
- }
+ cdevsw_add(&snp_cdevsw);
+ for ( i = 0 ; i < NSNP ; i++)
+ make_dev(&snp_cdevsw, i, 0, 0, 0600, "snp%d", i);
}
SYSINIT(snpdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,snp_drvinit,NULL)
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index fd88fcd..1109c07 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -31,15 +31,13 @@
* SUCH DAMAGE.
*
* @(#)tty_tty.c 8.2 (Berkeley) 9/23/93
- * $Id: tty_tty.c,v 1.26 1999/05/30 16:53:00 phk Exp $
+ * $Id: tty_tty.c,v 1.27 1999/05/31 11:27:41 phk Exp $
*/
/*
* Indirect driver for controlling tty.
*/
-#include "opt_devfs.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -48,9 +46,6 @@
#include <sys/ttycom.h>
#include <sys/vnode.h>
#include <sys/kernel.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
static d_open_t cttyopen;
static d_read_t cttyread;
@@ -193,26 +188,13 @@ cttypoll(dev, events, p)
return (VOP_POLL(ttyvp, events, p->p_ucred, p));
}
-static int ctty_devsw_installed;
-#ifdef DEVFS
-static void *ctty_devfs_token;
-#endif
-
static void ctty_drvinit __P((void *unused));
static void
ctty_drvinit(unused)
void *unused;
{
- if( ! ctty_devsw_installed ) {
- cdevsw_add(&ctty_cdevsw);
- ctty_devsw_installed = 1;
-#ifdef DEVFS
- ctty_devfs_token =
- devfs_add_devswf(&ctty_cdevsw, 0, DV_CHR, 0, 0,
- 0666, "tty");
-#endif
- }
+ make_dev(&ctty_cdevsw, 0, 0, 0, 0666, "tty");
}
SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ctty_drvinit,NULL)
diff --git a/sys/pc98/pc98/wd_cd.c b/sys/pc98/pc98/wd_cd.c
index 0613e7e..865f82b 100644
--- a/sys/pc98/pc98/wd_cd.c
+++ b/sys/pc98/pc98/wd_cd.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: atapi-cd.c,v 1.19 1999/05/30 16:52:08 phk Exp $
+ * $Id: atapi-cd.c,v 1.20 1999/05/31 11:25:51 phk Exp $
*/
#include "wdc.h"
#include "wcd.h"
-#include "opt_devfs.h"
#if NWCD > 0 && NWDC > 0
@@ -47,9 +46,6 @@
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/stat.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <i386/isa/atapi.h>
#include <i386/isa/atapi-cd.h>
@@ -144,24 +140,14 @@ acd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun,
}
else
ptr->device_stats = device_stats;
-#ifdef DEVFS
- ptr->ra_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwcd%da", lun);
- ptr->rc_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwcd%dc", lun);
- ptr->a_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, 0),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wcd%da", lun);
- ptr->c_devfs_token =
- devfs_add_devswf(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wcd%dc", lun);
-#endif
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "rwcd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rwcd%dc", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, 0),
+ UID_ROOT, GID_OPERATOR, 0640, "wcd%da", lun);
+ make_dev(&acd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "wcd%dc", lun);
return ptr;
}
diff --git a/sys/pc98/pc98/wfd.c b/sys/pc98/pc98/wfd.c
index 9cf0684..a089527 100644
--- a/sys/pc98/pc98/wfd.c
+++ b/sys/pc98/pc98/wfd.c
@@ -23,7 +23,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: wfd.c,v 1.26 1999/06/24 03:09:11 msmith Exp $
+ * $Id: wfd.c,v 1.27 1999/08/14 11:40:41 phk Exp $
*/
/*
@@ -46,9 +46,6 @@
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/cdio.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <i386/isa/atapi.h>
@@ -146,10 +143,6 @@ struct wfd {
struct atapi_params *param; /* Drive parameters table */
struct cappage cap; /* Capabilities page info */
char description[80]; /* Device description */
-#ifdef DEVFS
- void *cdevs;
- void *bdevs;
-#endif
struct diskslices *dk_slices; /* virtual drives */
struct devstat device_stats;
@@ -188,9 +181,6 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
struct atapires result;
int lun, i;
-#ifdef DEVFS
- int mynor;
-#endif
if (wfdnlun >= NUNIT) {
printf ("wfd: too many units\n");
return (0);
@@ -262,15 +252,8 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
-#ifdef DEVFS
- mynor = dkmakeminor(t->lun, WHOLE_DISK_SLICE, RAW_PART);
- t->bdevs = devfs_add_devswf(&wfd_cdevsw, mynor,
- DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
- "wfd%d", t->lun);
- t->cdevs = devfs_add_devswf(&wfd_cdevsw, mynor,
- DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
- "rwfd%d", t->lun);
-#endif /* DEVFS */
+ make_dev(&wfd_cdevsw, dkmakeminor(t->lun, WHOLE_DISK_SLICE, RAW_PART),
+ UID_ROOT, GID_OPERATOR, 0640, "rwfd%d", t->lun);
/*
* Export the drive to the devstat interface.
diff --git a/sys/pc98/pc98/wst.c b/sys/pc98/pc98/wst.c
index 94d4146..7337796 100644
--- a/sys/pc98/pc98/wst.c
+++ b/sys/pc98/pc98/wst.c
@@ -25,13 +25,12 @@
* (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: wst.c,v 1.22 1999/05/30 16:52:30 phk Exp $
+ * $Id: wst.c,v 1.23 1999/05/31 11:26:39 phk Exp $
*/
#include "wdc.h"
#include "wst.h"
#include "opt_ddb.h"
-#include "opt_devfs.h"
#if NWST > 0 && NWDC > 0
@@ -42,9 +41,6 @@
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/mtio.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <machine/clock.h>
#include <i386/isa/atapi.h>
@@ -198,10 +194,6 @@ struct wst {
struct atapi_params *param; /* Drive parameters table */
struct wst_header header; /* MODE SENSE param header */
struct wst_cappage cap; /* Capabilities page info */
-#ifdef DEVFS
- void *cdevs;
- void *bdevs;
-#endif
};
static struct wst *wsttab[NUNIT]; /* Drive info by unit number */
@@ -274,10 +266,7 @@ wstattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug)
wst_describe(t);
wstnlun++;
-#ifdef DEVFS
- t->cdevs = devfs_add_devswf(&wst_cdevsw, 0, DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640, "rwst%d", t->lun);
-#endif /* DEVFS */
+ make_dev(&wst_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0640, "rwst%d", t->lun);
return(1);
}
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index c450951..07be6c1 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -28,10 +28,9 @@
* (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: pccard.c,v 1.80 1999/05/31 11:28:48 phk Exp $
+ * $Id: pccard.c,v 1.81 1999/08/01 18:12:50 imp Exp $
*/
-#include "opt_devfs.h"
#include "opt_pcic.h"
#include <sys/param.h>
@@ -42,9 +41,6 @@
#include <sys/select.h>
#include <sys/sysctl.h>
#include <sys/conf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /*DEVFS*/
#include <sys/uio.h>
#include <sys/poll.h>
#include <sys/interrupt.h>
@@ -477,10 +473,7 @@ pccard_alloc_slot(struct slot_ctrl *ctrl)
MALLOC(slt, struct slot *, sizeof(*slt), M_DEVBUF, M_WAITOK);
bzero(slt, sizeof(*slt));
-#ifdef DEVFS
- slt->devfs_token = devfs_add_devswf(&crd_cdevsw,
- slotno, DV_CHR, 0, 0, 0600, "card%d", slotno);
-#endif
+ make_dev(&crd_cdevsw, slotno, 0, 0, 0600, "card%d", slotno);
if (ctrl->extra) {
MALLOC(slt->cdata, void *, ctrl->extra, M_DEVBUF, M_WAITOK);
bzero(slt->cdata, ctrl->extra);
diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h
index 396b967..619d6f5 100644
--- a/sys/pccard/slot.h
+++ b/sys/pccard/slot.h
@@ -149,10 +149,6 @@ struct slot {
struct slot_ctrl *ctrl; /* Per-controller data */
void *cdata; /* Controller specific data */
int pwr_off_pending;/* Power status of slot */
-#ifdef DEVFS
- void *devfs_token;
-#endif /* DEVFS*/
-
struct slot *next; /* Master list */
};
diff --git a/sys/pci/brooktree848.c b/sys/pci/brooktree848.c
index 1c5cfdd..27b73d0 100644
--- a/sys/pci/brooktree848.c
+++ b/sys/pci/brooktree848.c
@@ -1,4 +1,4 @@
-/* $Id: brooktree848.c,v 1.85 1999/06/12 14:54:54 roger Exp $ */
+/* $Id: brooktree848.c,v 1.89 1999/07/12 15:51:48 roger Exp $ */
/* BT848 Driver for Brooktree's Bt848, Bt848A, Bt849A, Bt878, Bt879 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@@ -444,7 +444,6 @@ They are unrelated to Revision Control numbering of FreeBSD or any other system.
#ifdef __FreeBSD__
#include "bktr.h"
#include "opt_bktr.h"
-#include "opt_devfs.h"
#include "pci.h"
#endif /* __FreeBSD__ */
@@ -485,10 +484,6 @@ They are unrelated to Revision Control numbering of FreeBSD or any other system.
#define NSMBUS 0
#endif
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-
#if (__FreeBSD_version >=400000) || (NSMBUS > 0)
#include <sys/bus.h> /* used by smbus and newbus */
#endif
@@ -6961,13 +6956,9 @@ bktr_attach( device_t dev )
/* call the common attach code */
common_bktr_attach( bktr, unit, fun, rev );
-#ifdef DEVFS
- /* XXX This just throw away the token, which should probably be fixed when
- DEVFS is finally made really operational. */
- devfs_add_devswf(&bktr_cdevsw, unit, DV_CHR, 0, 0, 0444, "bktr%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+16, DV_CHR, 0, 0, 0444, "tuner%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+32, DV_CHR, 0, 0, 0444, "vbi%d", unit);
-#endif /* DEVFS */
+ make_dev(&bktr_cdevsw, unit, 0, 0, 0444, "bktr%d", unit);
+ make_dev(&bktr_cdevsw, unit+16, 0, 0, 0444, "tuner%d", unit);
+ make_dev(&bktr_cdevsw, unit+32, 0, 0, 0444, "vbi%d", unit);
return 0;
@@ -7473,13 +7464,9 @@ bktr_attach( pcici_t tag, int unit )
/* call the common attach code */
common_bktr_attach( bktr, unit, fun, rev );
-#ifdef DEVFS
- /* XXX This just throw away the token, which should probably be fixed when
- DEVFS is finally made really operational. */
- devfs_add_devswf(&bktr_cdevsw, unit, DV_CHR, 0, 0, 0444, "bktr%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+16, DV_CHR, 0, 0, 0444, "tuner%d", unit);
- devfs_add_devswf(&bktr_cdevsw, unit+32, DV_CHR, 0, 0, 0444, "vbi%d", unit);
-#endif /* DEVFS */
+ make_dev(&bktr_cdevsw, unit, 0, 0, 0444, "bktr%d", unit);
+ make_dev(&bktr_cdevsw, unit+16, 0, 0, 0444, "tuner%d", unit);
+ make_dev(&bktr_cdevsw, unit+32, 0, 0, 0444, "vbi%d", unit);
}
diff --git a/sys/pci/dpt_pci.c b/sys/pci/dpt_pci.c
index 4e03f78..3828d08 100644
--- a/sys/pci/dpt_pci.c
+++ b/sys/pci/dpt_pci.c
@@ -32,9 +32,8 @@
* dptpci.c: PCI Bus Attachment for DPT SCSI HBAs
*/
-#ident "$Id: dpt_pci.c,v 1.13 1999/05/09 17:06:44 peter Exp $"
+#ident "$Id: dpt_pci.c,v 1.14 1999/08/16 01:52:20 gibbs Exp $"
-#include "opt_devfs.h"
#include "opt_dpt.h"
#include <sys/param.h>
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index f96c1e2..47960c1 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -147,7 +147,6 @@
#include "meteor.h"
-#include "opt_devfs.h"
#include "opt_meteor.h"
#include <sys/param.h>
@@ -156,9 +155,6 @@
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/mman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#include <sys/uio.h>
#if defined(METEOR_FreeBSD_210)
@@ -1126,10 +1122,7 @@ met_attach(pcici_t tag, int unit)
mtr->flags |= METEOR_INITALIZED | METEOR_AUTOMODE | METEOR_DEV0 |
METEOR_RGB16;
-#ifdef DEVFS
- mtr->devfs_token = devfs_add_devswf(&meteor_cdevsw, unit,
- DV_CHR, 0, 0, 0644, "meteor");
-#endif
+ make_dev(&meteor_cdevsw, unit, 0, 0, 0644, "meteor");
}
#define UNIT(x) ((x) & 0x07)
diff --git a/sys/pci/meteor_reg.h b/sys/pci/meteor_reg.h
index 5293ba4..40d06e0 100644
--- a/sys/pci/meteor_reg.h
+++ b/sys/pci/meteor_reg.h
@@ -238,9 +238,6 @@ typedef struct meteor_softc {
u_char pcf_i2c[NUM_PCF8574_I2C_REGS]; /* PCF8574 register values */
u_char bt254_reg[NUM_BT254_REGS]; /* BT254 register values */
u_short fps; /* frames per second */
-#ifdef DEVFS
- void *devfs_token;
-#endif
#ifdef METEOR_TEST_VIDEO
struct meteor_video video;
#endif
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 78b0cda..75f41e8 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -23,13 +23,12 @@
* (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: pci.c,v 1.113 1999/07/28 07:57:47 dfr Exp $
+ * $Id: pci.c,v 1.114 1999/07/29 01:03:03 mdodd Exp $
*
*/
#include "opt_bus.h"
-#include "opt_devfs.h"
#include "opt_simos.h"
#include <sys/param.h>
@@ -42,9 +41,6 @@
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/buf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -916,22 +912,6 @@ static struct cdevsw pcicdev = {
/* bmaj */ -1
};
-#ifdef DEVFS
-static void *pci_devfs_token;
-#endif
-
-static void
-pci_cdevinit(void *dummy)
-{
- cdevsw_add(&pcicdev);
-#ifdef DEVFS
- pci_devfs_token = devfs_add_devswf(&pcicdev, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0644, "pci");
-#endif
-}
-
-SYSINIT(pcidev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+PCI_CDEV, pci_cdevinit, NULL);
-
#include "pci_if.h"
/*
@@ -1109,9 +1089,14 @@ pci_add_children(device_t dev, int busno)
static int
pci_new_probe(device_t dev)
{
- device_set_desc(dev, "PCI bus");
+ static int once;
+ device_set_desc(dev, "PCI bus");
pci_add_children(dev, device_get_unit(dev));
+ if (!once) {
+ make_dev(&pcicdev, 0, UID_ROOT, GID_WHEEL, 0644, "pci");
+ once++;
+ }
return 0;
}
diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c
index 839263c..e34e3c2 100644
--- a/sys/pci/xrpu.c
+++ b/sys/pci/xrpu.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: xrpu.c,v 1.14 1999/07/03 08:23:00 phk Exp $
+ * $Id: xrpu.c,v 1.15 1999/07/13 08:15:22 phk Exp $
*
* A very simple device driver for PCI cards based on Xilinx 6200 series
* FPGA/RPU devices. Current Functionality is to allow you to open and
@@ -17,8 +17,6 @@
*
*/
-#include "opt_devfs.h"
-
#include "xrpu.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -26,9 +24,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/timepps.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <sys/xrpuio.h>
#include <pci/pcireg.h>
#include <pci/pcivar.h>
@@ -184,10 +179,8 @@ xrpu_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
if (xt->xt_pps[i].xt_addr_assert == 0
&& xt->xt_pps[i].xt_addr_clear == 0)
continue;
-#ifdef DEVFS
- devfs_add_devswf(&xrpu_cdevsw, (i+1)<<16, DV_CHR, UID_ROOT, GID_WHEEL,
- 0600, "xpps%d", i);
-#endif
+ make_dev(&xrpu_cdevsw, (i+1)<<16,
+ UID_ROOT, GID_WHEEL, 0600, "xpps%d", i);
sc->pps[i].ppscap = 0;
if (xt->xt_pps[i].xt_addr_assert) {
sc->assert[i] = sc->virbase62 + xt->xt_pps[i].xt_addr_assert;
@@ -263,8 +256,5 @@ xrpu_attach (pcici_t tag, int unit)
(u_long)sc->physbase, (u_long)sc->virbase);
-#ifdef DEVFS
- devfs_add_devswf(&xrpu_cdevsw, 0, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "xrpu%d", unit);
-#endif
+ make_dev(&xrpu_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "xrpu%d", unit);
}
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 9471593..ca9b879 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id: conf.h,v 1.75 1999/08/17 20:25:48 billf Exp $
+ * $Id: conf.h,v 1.76 1999/08/20 20:24:59 julian Exp $
*/
#ifndef _SYS_CONF_H_
@@ -50,10 +50,6 @@ struct tty;
struct vnode;
struct specinfo {
- struct mount *si_mountpoint;
- int si_bsize_phys; /* minimum physical block size */
- int si_bsize_best; /* optimal block size / VBLK */
- int si_bsize_max; /* maximum block size */
udev_t si_udev;
SLIST_ENTRY(specinfo) si_hash;
@@ -66,10 +62,20 @@ struct specinfo {
struct {
struct tty *__sit_tty;
} __si_tty;
+ struct {
+ struct mount *__sid_mountpoint;
+ int __sid_bsize_phys; /* min physical block size */
+ int __sid_bsize_best; /* optimal block size */
+ int __sid_bsize_max; /* maximum block size */
+ } __si_disk;
} __si_u;
};
#define si_tty_tty __si_u.__si_tty.__sit_tty
+#define si_mountpoint __si_u.__si_disk.__sid_mountpoint
+#define si_bsize_phys __si_u.__si_disk.__sid_bsize_phys
+#define si_bsize_best __si_u.__si_disk.__sid_bsize_best
+#define si_bsize_max __si_u.__si_disk.__sid_bsize_max
/*
* Exported shorthand
@@ -118,6 +124,9 @@ typedef int l_rint_t __P((int c, struct tty *tp));
typedef int l_start_t __P((struct tty *tp));
typedef int l_modem_t __P((struct tty *tp, int flag));
+/* This is type of the function DEVFS uses to hook into the kernel with */
+typedef void devfs_create_t __P((dev_t dev, uid_t uid, gid_t gid, int perms));
+
/*
* XXX: The dummy argument can be used to do what strategy1() never
* did anywhere: Create a per device flag to lock the device during
@@ -272,6 +281,8 @@ dev_t make_dev __P((struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int p
int lminor __P((dev_t dev));
void setconf __P((void));
+extern devfs_create_t *devfs_create_hook;
+
/*
* XXX: This included for when DEVFS resurfaces
*/
diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h
index 9471593..ca9b879 100644
--- a/sys/sys/linedisc.h
+++ b/sys/sys/linedisc.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id: conf.h,v 1.75 1999/08/17 20:25:48 billf Exp $
+ * $Id: conf.h,v 1.76 1999/08/20 20:24:59 julian Exp $
*/
#ifndef _SYS_CONF_H_
@@ -50,10 +50,6 @@ struct tty;
struct vnode;
struct specinfo {
- struct mount *si_mountpoint;
- int si_bsize_phys; /* minimum physical block size */
- int si_bsize_best; /* optimal block size / VBLK */
- int si_bsize_max; /* maximum block size */
udev_t si_udev;
SLIST_ENTRY(specinfo) si_hash;
@@ -66,10 +62,20 @@ struct specinfo {
struct {
struct tty *__sit_tty;
} __si_tty;
+ struct {
+ struct mount *__sid_mountpoint;
+ int __sid_bsize_phys; /* min physical block size */
+ int __sid_bsize_best; /* optimal block size */
+ int __sid_bsize_max; /* maximum block size */
+ } __si_disk;
} __si_u;
};
#define si_tty_tty __si_u.__si_tty.__sit_tty
+#define si_mountpoint __si_u.__si_disk.__sid_mountpoint
+#define si_bsize_phys __si_u.__si_disk.__sid_bsize_phys
+#define si_bsize_best __si_u.__si_disk.__sid_bsize_best
+#define si_bsize_max __si_u.__si_disk.__sid_bsize_max
/*
* Exported shorthand
@@ -118,6 +124,9 @@ typedef int l_rint_t __P((int c, struct tty *tp));
typedef int l_start_t __P((struct tty *tp));
typedef int l_modem_t __P((struct tty *tp, int flag));
+/* This is type of the function DEVFS uses to hook into the kernel with */
+typedef void devfs_create_t __P((dev_t dev, uid_t uid, gid_t gid, int perms));
+
/*
* XXX: The dummy argument can be used to do what strategy1() never
* did anywhere: Create a per device flag to lock the device during
@@ -272,6 +281,8 @@ dev_t make_dev __P((struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int p
int lminor __P((dev_t dev));
void setconf __P((void));
+extern devfs_create_t *devfs_create_hook;
+
/*
* XXX: This included for when DEVFS resurfaces
*/
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 387cfeb..4f7592c 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -31,19 +31,15 @@
* SUCH DAMAGE.
*
* @(#)vm_swap.c 8.5 (Berkeley) 2/17/94
- * $Id: vm_swap.c,v 1.80 1999/08/08 18:43:05 phk Exp $
+ * $Id: vm_swap.c,v 1.81 1999/08/13 10:29:38 phk Exp $
*/
-#include "opt_devfs.h"
#include "opt_swap.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/buf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <sys/proc.h>
#include <sys/namei.h>
#include <sys/dmap.h> /* XXX */
@@ -206,7 +202,12 @@ swapon(p, uap)
dev_t dev;
struct nameidata nd;
int error;
+ static int once;
+ if (!once) {
+ make_dev(&sw_cdevsw, 0, UID_ROOT, GID_KMEM, 0640, "drum");
+ once++;
+ }
error = suser(p);
if (error)
return (error);
@@ -356,31 +357,3 @@ swaponvp(p, vp, dev, nblks)
}
return (0);
}
-
-static int sw_devsw_installed;
-#ifdef DEVFS
-static void *drum_devfs_token;
-#endif
-
-static void sw_drvinit(void *unused)
-{
-
- if( ! sw_devsw_installed ) {
- cdevsw_add(&sw_cdevsw);
- /*
- * XXX: This is pretty gross, but it will disappear with
- * the blockdevices RSN.
- */
- sw_cdevsw.d_open = nullopen;
- sw_cdevsw.d_close = nullclose;
- sw_devsw_installed = 1;
-#ifdef DEVFS
- drum_devfs_token = devfs_add_devswf(&sw_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_KMEM, 0640,
- "drum");
-#endif
- }
-}
-
-SYSINIT(swdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,sw_drvinit,NULL)
-
OpenPOWER on IntegriCloud