Module Name: src Committed By: tsutsui Date: Fri Sep 18 16:43:19 UTC 2009
Modified Files: src/sys/dev/sbus: cgthree_sbus.c src/sys/dev/sun: cgthree.c cgthreevar.h Log Message: 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? To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sbus/cgthree_sbus.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/sun/cgthree.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/sun/cgthreevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/sbus/cgthree_sbus.c diff -u src/sys/dev/sbus/cgthree_sbus.c:1.28 src/sys/dev/sbus/cgthree_sbus.c:1.29 --- src/sys/dev/sbus/cgthree_sbus.c:1.28 Fri Sep 18 12:23:16 2009 +++ src/sys/dev/sbus/cgthree_sbus.c Fri Sep 18 16:43:19 2009 @@ -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); Index: src/sys/dev/sun/cgthree.c diff -u src/sys/dev/sun/cgthree.c:1.23 src/sys/dev/sun/cgthree.c:1.24 --- src/sys/dev/sun/cgthree.c:1.23 Tue May 12 14:46:39 2009 +++ src/sys/dev/sun/cgthree.c Fri Sep 18 16:43:19 2009 @@ -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 Index: src/sys/dev/sun/cgthreevar.h diff -u src/sys/dev/sun/cgthreevar.h:1.7 src/sys/dev/sun/cgthreevar.h:1.8 --- src/sys/dev/sun/cgthreevar.h:1.7 Mon Feb 23 22:44:27 2009 +++ src/sys/dev/sun/cgthreevar.h Fri Sep 18 16:43:19 2009 @@ -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() */