Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Split device_t/softc. Tested on SS1+.



details:   https://anonhg.NetBSD.org/src/rev/e001c302ec5c
branches:  trunk
changeset: 747516:e001c302ec5c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Sep 18 16:43:19 2009 +0000

description:
Split device_t/softc.  Tested on SS1+.

XXX: sparc/dev/cgthree.c in Attic had an attachment for cgthree* at obio?
XXX: and sparc/conf/files.sparc still has an entry of nonexistent (or not yet)
XXX: sparc/dev/cgthree_obio.c. Is there any sun4m machine which requires it?

diffstat:

 sys/dev/sbus/cgthree_sbus.c |   8 +++++---
 sys/dev/sun/cgthree.c       |  11 ++++++-----
 sys/dev/sun/cgthreevar.h    |   4 ++--
 3 files changed, 13 insertions(+), 10 deletions(-)

diffs (95 lines):

diff -r 6168b6f9db37 -r e001c302ec5c sys/dev/sbus/cgthree_sbus.c
--- a/sys/dev/sbus/cgthree_sbus.c       Fri Sep 18 15:07:10 2009 +0000
+++ b/sys/dev/sbus/cgthree_sbus.c       Fri Sep 18 16:43:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgthree_sbus.c,v 1.28 2009/09/18 12:23:16 tsutsui Exp $ */
+/*     $NetBSD: cgthree_sbus.c,v 1.29 2009/09/18 16:43:19 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree_sbus.c,v 1.28 2009/09/18 12:23:16 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree_sbus.c,v 1.29 2009/09/18 16:43:19 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -108,7 +108,7 @@
 static int     cgthreematch_sbus(device_t, cfdata_t, void *);
 static void    cgthreeattach_sbus(device_t, device_t, void *);
 
-CFATTACH_DECL(cgthree_sbus, sizeof(struct cgthree_softc),
+CFATTACH_DECL_NEW(cgthree_sbus, sizeof(struct cgthree_softc),
     cgthreematch_sbus, cgthreeattach_sbus, NULL, NULL);
 
 /*
@@ -139,6 +139,8 @@
        const char *name;
        bus_space_handle_t bh;
 
+       sc->sc_dev = self;
+
        /* Remember cookies for cgthree_mmap() */
        sc->sc_bustag = sa->sa_bustag;
        sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot, sa->sa_offset);
diff -r 6168b6f9db37 -r e001c302ec5c sys/dev/sun/cgthree.c
--- a/sys/dev/sun/cgthree.c     Fri Sep 18 15:07:10 2009 +0000
+++ b/sys/dev/sun/cgthree.c     Fri Sep 18 16:43:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgthree.c,v 1.23 2009/05/12 14:46:39 cegger Exp $ */
+/*     $NetBSD: cgthree.c,v 1.24 2009/09/18 16:43:19 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.23 2009/05/12 14:46:39 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.24 2009/09/18 16:43:19 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -257,7 +257,7 @@
        aa.console = isconsole;
        aa.accessops = &cgthree_accessops;
        aa.accesscookie = &sc->vd;
-       config_found(&sc->sc_dev, &aa, wsemuldisplaydevprint);
+       config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
 #else
        /* Initialize the default color map. */
        bt_initcmap(&sc->sc_cmap, 256);
@@ -336,10 +336,11 @@
  * Undo the effect of an FBIOSVIDEO that turns the video off.
  */
 static void
-cgthreeunblank(device_t dev)
+cgthreeunblank(device_t self)
 {
+       struct cgthree_softc *sc = device_private(self);
 
-       cgthree_set_video(device_private(dev), 1);
+       cgthree_set_video(sc, 1);
 }
 
 static void
diff -r 6168b6f9db37 -r e001c302ec5c sys/dev/sun/cgthreevar.h
--- a/sys/dev/sun/cgthreevar.h  Fri Sep 18 15:07:10 2009 +0000
+++ b/sys/dev/sun/cgthreevar.h  Fri Sep 18 16:43:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgthreevar.h,v 1.7 2009/02/23 22:44:27 jdc Exp $ */
+/*     $NetBSD: cgthreevar.h,v 1.8 2009/09/18 16:43:19 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 /* per-display variables */
 struct cgthree_softc {
-       struct device   sc_dev;         /* base device */
+       device_t        sc_dev;         /* base device */
        struct fbdevice sc_fb;          /* frame buffer device */
        bus_space_tag_t sc_bustag;
        bus_addr_t      sc_paddr;       /* phys address for device mmap() */



Home | Main Index | Thread Index | Old Index