Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/gehenna-devsw]: src/sys/dev Add the character device switch.



details:   https://anonhg.NetBSD.org/src/rev/ef86210efeb5
branches:  gehenna-devsw
changeset: 527068:ef86210efeb5
user:      gehenna <gehenna%NetBSD.org@localhost>
date:      Thu May 16 11:32:40 2002 +0000

description:
Add the character device switch.

diffstat:

 sys/dev/sun/bwtwo.c     |  39 ++++++++++++---------------------------
 sys/dev/sun/cgsix.c     |  31 +++++++++++++------------------
 sys/dev/sun/cgthree.c   |  40 ++++++++++++----------------------------
 sys/dev/sun/fb.c        |  16 +++++++++++++---
 sys/dev/sun/kbd.c       |  28 +++++++++++++---------------
 sys/dev/sun/ms.c        |  28 +++++++++++++---------------
 sys/dev/sysmon/sysmon.c |  13 ++++++++++---
 7 files changed, 86 insertions(+), 109 deletions(-)

diffs (truncated from 429 to 300 lines):

diff -r ebad6e6b9491 -r ef86210efeb5 sys/dev/sun/bwtwo.c
--- a/sys/dev/sun/bwtwo.c       Thu May 16 11:31:51 2002 +0000
+++ b/sys/dev/sun/bwtwo.c       Thu May 16 11:32:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwo.c,v 1.4 2001/11/13 06:54:32 lukem Exp $ */
+/*     $NetBSD: bwtwo.c,v 1.4.8.1 2002/05/16 11:35:43 gehenna Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.4 2001/11/13 06:54:32 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.4.8.1 2002/05/16 11:35:43 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,7 +103,6 @@
 
 #include <machine/autoconf.h>
 #include <machine/eeprom.h>
-#include <machine/conf.h>
 
 #include <dev/sun/fbio.h>
 #include <dev/sun/fbvar.h>
@@ -112,17 +111,23 @@
 #include <dev/sun/bwtwovar.h>
 #include <dev/sun/pfourreg.h>
 
-/* cdevsw prototypes */
-cdev_decl(bwtwo);
+extern struct cfdriver bwtwo_cd;
 
-extern struct cfdriver bwtwo_cd;
+dev_type_open(bwtwoopen);
+dev_type_ioctl(bwtwoioctl);
+dev_type_mmap(bwtwommap);
+
+const struct cdevsw bwtwo_cdevsw = {
+       bwtwoopen, nullclose, noread, nowrite, bwtwoioctl,
+       nostop, notty, nopoll, bwtwommap,
+};
 
 /* XXX we do not handle frame buffer interrupts (do not know how) */
 static void    bwtwounblank(struct device *);
 
 /* frame buffer generic driver */
 static struct fbdriver bwtwofbdriver = {
-       bwtwounblank, bwtwoopen, bwtwoclose, bwtwoioctl, bwtwopoll, bwtwommap
+       bwtwounblank, bwtwoopen, nullclose, bwtwoioctl, nopoll, bwtwommap
 };
 
 int
@@ -227,16 +232,6 @@
 }
 
 int
-bwtwoclose(dev, flags, mode, p)
-       dev_t dev;
-       int flags, mode;
-       struct proc *p;
-{
-
-       return (0);
-}
-
-int
 bwtwoioctl(dev, cmd, data, flags, p)
        dev_t dev;
        u_long cmd;
@@ -275,16 +270,6 @@
        sc->sc_set_video(sc, 1);
 }
 
-int
-bwtwopoll(dev, events, p)
-       dev_t dev;
-       int events;
-       struct proc *p;
-{
-
-       return (seltrue(dev, events, p));
-}
-
 /*
  * Return the address that would map the given device at the given
  * offset, allowing for the given protection, or return -1 for error.
diff -r ebad6e6b9491 -r ef86210efeb5 sys/dev/sun/cgsix.c
--- a/sys/dev/sun/cgsix.c       Thu May 16 11:31:51 2002 +0000
+++ b/sys/dev/sun/cgsix.c       Thu May 16 11:32:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsix.c,v 1.7 2001/11/13 06:54:32 lukem Exp $ */
+/*     $NetBSD: cgsix.c,v 1.7.8.1 2002/05/16 11:34:23 gehenna Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.7 2001/11/13 06:54:32 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.7.8.1 2002/05/16 11:34:23 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,18 +124,23 @@
 #include <dev/wscons/wsconsio.h>
 #endif
 
-#include <machine/conf.h>
-
 static void    cg6_unblank(struct device *);
 
-/* cdevsw prototypes */
-cdev_decl(cgsix);
-
 extern struct cfdriver cgsix_cd;
 
+dev_type_open(cgsixopen);
+dev_type_close(cgsixclose);
+dev_type_ioctl(cgsixioctl);
+dev_type_mmap(cgsixmmap);
+
+const struct cdevsw cgsix_cdevsw = {
+       cgsixopen, cgsixclose, noread, nowrite, cgsixioctl,
+       nostop, notty, nopoll, cgsixmmap,
+};
+
 /* frame buffer generic driver */
 static struct fbdriver cg6_fbdriver = {
-       cg6_unblank, cgsixopen, cgsixclose, cgsixioctl, cgsixpoll, cgsixmmap
+       cg6_unblank, cgsixopen, cgsixclose, cgsixioctl, nopoll, cgsixmmap
 };
 
 static void cg6_reset (struct cgsix_softc *);
@@ -733,16 +738,6 @@
        return (0);
 }
 
-int
-cgsixpoll(dev, events, p)
-       dev_t dev;
-       int events;
-       struct proc *p;
-{
-
-       return (seltrue(dev, events, p));
-}
-
 /*
  * Clean up hardware state (e.g., after bootup or after X crashes).
  */
diff -r ebad6e6b9491 -r ef86210efeb5 sys/dev/sun/cgthree.c
--- a/sys/dev/sun/cgthree.c     Thu May 16 11:31:51 2002 +0000
+++ b/sys/dev/sun/cgthree.c     Thu May 16 11:32:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgthree.c,v 1.4 2001/11/13 06:54:32 lukem Exp $ */
+/*     $NetBSD: cgthree.c,v 1.4.8.1 2002/05/16 11:34:24 gehenna Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.4 2001/11/13 06:54:32 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.4.8.1 2002/05/16 11:34:24 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -68,21 +68,25 @@
 #include <dev/sun/cgthreereg.h>
 #include <dev/sun/cgthreevar.h>
 
-#include <machine/conf.h>
-
 static void    cgthreeunblank(struct device *);
 static void    cgthreeloadcmap(struct cgthree_softc *, int, int);
 static void    cgthree_set_video(struct cgthree_softc *, int);
 static int     cgthree_get_video(struct cgthree_softc *);
 
-/* cdevsw prototypes */
-cdev_decl(cgthree);
+extern struct cfdriver cgthree_cd;
 
-extern struct cfdriver cgthree_cd;
+dev_type_open(cgthreeopen);
+dev_type_ioctl(cgthreeioctl);
+dev_type_mmap(cgthreemmap);
+
+const struct cdevsw cgthree_cdevsw = {
+       cgthreeopen, nullclose, noread, nowrite, cgthreeioctl,
+       nostop, notty, nopoll, cgthreemmap,
+};
 
 /* frame buffer generic driver */
 static struct fbdriver cgthreefbdriver = {
-       cgthreeunblank, cgthreeopen, cgthreeclose, cgthreeioctl, cgthreepoll,
+       cgthreeunblank, cgthreeopen, nullclose, cgthreeioctl, nopoll,
        cgthreemmap
 };
 
@@ -171,16 +175,6 @@
 }
 
 int
-cgthreeclose(dev, flags, mode, p)
-       dev_t dev;
-       int flags, mode;
-       struct proc *p;
-{
-
-       return (0);
-}
-
-int
 cgthreeioctl(dev, cmd, data, flags, p)
        dev_t dev;
        u_long cmd;
@@ -239,16 +233,6 @@
        return (0);
 }
 
-int
-cgthreepoll(dev, events, p)
-       dev_t dev;
-       int events;
-       struct proc *p;
-{
-
-       return (seltrue(dev, events, p));
-}
-
 /*
  * Undo the effect of an FBIOSVIDEO that turns the video off.
  */
diff -r ebad6e6b9491 -r ef86210efeb5 sys/dev/sun/fb.c
--- a/sys/dev/sun/fb.c  Thu May 16 11:31:51 2002 +0000
+++ b/sys/dev/sun/fb.c  Thu May 16 11:32:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fb.c,v 1.7 2002/03/22 00:14:37 fredette Exp $ */
+/*     $NetBSD: fb.c,v 1.7.4.1 2002/05/16 11:34:24 gehenna Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.7 2002/03/22 00:14:37 fredette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.7.4.1 2002/05/16 11:34:24 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,7 +60,6 @@
 
 #include <machine/autoconf.h>
 #include <machine/kbd.h>
-#include <machine/conf.h>
 #include <machine/eeprom.h>
 #include <sparc/dev/cons.h>
 
@@ -72,6 +71,17 @@
 
 static struct fbdevice *devfb;
 
+dev_type_open(fbopen);
+dev_type_close(fbclose);
+dev_type_ioctl(fbioctl);
+dev_type_poll(fbpoll);
+dev_type_mmap(fbmmap);
+
+const struct cdevsw fb_cdevsw = {
+       fbopen, fbclose, noread, nowrite, fbioctl,
+       nostop, notty, fbpoll, fbmmap,
+};
+
 void
 fb_unblank()
 {
diff -r ebad6e6b9491 -r ef86210efeb5 sys/dev/sun/kbd.c
--- a/sys/dev/sun/kbd.c Thu May 16 11:31:51 2002 +0000
+++ b/sys/dev/sun/kbd.c Thu May 16 11:32:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kbd.c,v 1.30 2002/05/13 09:42:12 pk Exp $      */
+/*     $NetBSD: kbd.c,v 1.30.2.1 2002/05/16 11:34:24 gehenna Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.30 2002/05/13 09:42:12 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.30.2.1 2002/05/16 11:34:24 gehenna Exp $");
 
 #include "opt_ddb.h"
 
@@ -101,9 +101,18 @@



Home | Main Index | Thread Index | Old Index