Module Name:    src
Committed By:   tsutsui
Date:           Sat Jun  4 01:49:44 UTC 2011

Modified Files:
        src/sys/arch/alpha/tc: ioasic.c
        src/sys/arch/pmax/tc: ioasic.c
        src/sys/dev/tc: ioasic_subr.c ioasicvar.h

Log Message:
Split device_t/softc. pmax is tested on GXemul, compile test only for alpha.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/alpha/tc/ioasic.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/pmax/tc/ioasic.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/tc/ioasic_subr.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/tc/ioasicvar.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/arch/alpha/tc/ioasic.c
diff -u src/sys/arch/alpha/tc/ioasic.c:1.42 src/sys/arch/alpha/tc/ioasic.c:1.43
--- src/sys/arch/alpha/tc/ioasic.c:1.42	Sat Mar 14 21:04:03 2009
+++ src/sys/arch/alpha/tc/ioasic.c	Sat Jun  4 01:49:43 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ioasic.c,v 1.42 2009/03/14 21:04:03 dsl Exp $ */
+/* $NetBSD: ioasic.c,v 1.43 2011/06/04 01:49:43 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.42 2009/03/14 21:04:03 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.43 2011/06/04 01:49:43 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -79,10 +79,10 @@
 #include <dev/tc/ioasicvar.h>
 
 /* Definition of the driver for autoconfig. */
-int	ioasicmatch(struct device *, struct cfdata *, void *);
-void	ioasicattach(struct device *, struct device *, void *);
+int	ioasicmatch(device_t, cfdata_t, void *);
+void	ioasicattach(device_t, device_t, void *);
 
-CFATTACH_DECL(ioasic, sizeof(struct ioasic_softc),
+CFATTACH_DECL_NEW(ioasic, sizeof(struct ioasic_softc),
     ioasicmatch, ioasicattach, NULL, NULL);
 
 int	ioasic_intr(void *);
@@ -125,7 +125,7 @@
 int ioasicfound;
 
 int
-ioasicmatch(struct device *parent, struct cfdata *cfdata, void *aux)
+ioasicmatch(device_t parent, cfdata_t cf, void *aux)
 {
 	struct tc_attach_args *ta = aux;
 
@@ -144,9 +144,9 @@
 }
 
 void
-ioasicattach(struct device *parent, struct device *self, void *aux)
+ioasicattach(device_t parent, device_t self, void *aux)
 {
-	struct ioasic_softc *sc = (struct ioasic_softc *)self;
+	struct ioasic_softc *sc = device_private(self);
 	struct tc_attach_args *ta = aux;
 #ifdef DEC_3000_300
 	u_long ssr;
@@ -157,10 +157,11 @@
 
 	ioasicfound = 1;
 
+	sc->sc_dev = self;
 	sc->sc_bst = ta->ta_memt; 
 	if (bus_space_map(ta->ta_memt, ta->ta_addr,
 			0x400000, 0, &sc->sc_bsh)) {
-		printf("%s: unable to map device\n", sc->sc_dv.dv_xname);
+		printf("%s: unable to map device\n", device_xname(self));
 		return;
 	}
 	sc->sc_dmat = ta->ta_dmat;
@@ -199,7 +200,7 @@
 			panic("ioasicattach");
 		sprintf(cp, "slot %lu", i);
 		evcnt_attach_dynamic(&ioasicintrs[i].iai_evcnt,
-		    EVCNT_TYPE_INTR, pevcnt, self->dv_xname, cp);
+		    EVCNT_TYPE_INTR, pevcnt, device_xname(self), cp);
 	}
 	tc_intr_establish(parent, ta->ta_cookie, TC_IPL_NONE, ioasic_intr, sc);
 

Index: src/sys/arch/pmax/tc/ioasic.c
diff -u src/sys/arch/pmax/tc/ioasic.c:1.19 src/sys/arch/pmax/tc/ioasic.c:1.20
--- src/sys/arch/pmax/tc/ioasic.c:1.19	Mon Mar 16 23:11:14 2009
+++ src/sys/arch/pmax/tc/ioasic.c	Sat Jun  4 01:49:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioasic.c,v 1.19 2009/03/16 23:11:14 dsl Exp $	*/
+/*	$NetBSD: ioasic.c,v 1.20 2011/06/04 01:49:43 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.19 2009/03/16 23:11:14 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.20 2011/06/04 01:49:43 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,10 +95,10 @@
 static int kn03_ioasic_ndevs = ARRAY_SIZEOF(kn03_ioasic_devs);
 #endif
 
-static int	ioasicmatch(struct device *, struct cfdata *, void *);
-static void	ioasicattach(struct device *, struct device *, void *);
+static int	ioasicmatch(device_t, cfdata_t, void *);
+static void	ioasicattach(device_t, device_t, void *);
 
-CFATTACH_DECL(ioasic, sizeof(struct ioasic_softc),
+CFATTACH_DECL_NEW(ioasic, sizeof(struct ioasic_softc),
     ioasicmatch, ioasicattach, NULL, NULL);
 
 tc_addr_t ioasic_base;	/* XXX XXX XXX */
@@ -107,7 +107,7 @@
 int ioasicfound;
 
 static int
-ioasicmatch(struct device *parent, struct cfdata *cfdata, void *aux)
+ioasicmatch(device_t parent, cfdata_t cfdata, void *aux)
 {
 	struct tc_attach_args *ta = aux;
 
@@ -122,19 +122,20 @@
 }
 
 static void
-ioasicattach(struct device *parent, struct device *self, void *aux)
+ioasicattach(device_t parent, device_t self, void *aux)
 {
-	struct ioasic_softc *sc = (struct ioasic_softc *)self;
+	struct ioasic_softc *sc = device_private(self);
 	struct tc_attach_args *ta = aux;
 	struct ioasic_dev *ioasic_devs;
 	int ioasic_ndevs, builtin_ndevs;
 
 	ioasicfound = 1;
 
+	sc->sc_dev = self;
 	sc->sc_bst = ta->ta_memt;
 	if (bus_space_map(ta->ta_memt, ta->ta_addr,
 			0x400000, 0, &sc->sc_bsh)) {
-		printf("%s: unable to map device\n", sc->sc_dv.dv_xname);
+		printf("%s: unable to map device\n", device_xname(self));
 		return;
 	}
 	sc->sc_dmat = ta->ta_dmat;
@@ -187,7 +188,7 @@
 }
 
 const struct evcnt *
-ioasic_intr_evcnt(struct device *dev, void *cookie)
+ioasic_intr_evcnt(device_t dev, void *cookie)
 {
 
 	/* XXX for now, no evcnt parent reported */
@@ -195,7 +196,8 @@
 }
 
 void
-ioasic_intr_establish(struct device *dev, void *cookie, int level, int (*handler)(void *), void *val)
+ioasic_intr_establish(device_t dev, void *cookie, int level,
+    int (*handler)(void *), void *val)
 {
 	(*platform.intr_establish)(dev, cookie, level, handler, val);
 }

Index: src/sys/dev/tc/ioasic_subr.c
diff -u src/sys/dev/tc/ioasic_subr.c:1.12 src/sys/dev/tc/ioasic_subr.c:1.13
--- src/sys/dev/tc/ioasic_subr.c:1.12	Fri Mar 31 17:39:33 2006
+++ src/sys/dev/tc/ioasic_subr.c	Sat Jun  4 01:49:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioasic_subr.c,v 1.12 2006/03/31 17:39:33 thorpej Exp $	*/
+/*	$NetBSD: ioasic_subr.c,v 1.13 2011/06/04 01:49:44 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.12 2006/03/31 17:39:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.13 2011/06/04 01:49:44 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -72,7 +72,7 @@
 
                 /* Tell the autoconfig machinery we've found the hardware. */
 		locs[IOASICCF_OFFSET] = ioasic_devs[i].iad_offset;
-		config_found_sm_loc(&sc->sc_dv, "ioasic", locs, &idev,
+		config_found_sm_loc(sc->sc_dev, "ioasic", locs, &idev,
 				    ioasicprint, config_stdsubmatch);
         }
 }

Index: src/sys/dev/tc/ioasicvar.h
diff -u src/sys/dev/tc/ioasicvar.h:1.21 src/sys/dev/tc/ioasicvar.h:1.22
--- src/sys/dev/tc/ioasicvar.h:1.21	Sun Feb 20 08:03:22 2011
+++ src/sys/dev/tc/ioasicvar.h	Sat Jun  4 01:49:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioasicvar.h,v 1.21 2011/02/20 08:03:22 matt Exp $	*/
+/*	$NetBSD: ioasicvar.h,v 1.22 2011/06/04 01:49:44 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
@@ -47,7 +47,7 @@
 };
 
 struct ioasic_softc {
-	struct	device sc_dv;
+	device_t sc_dev;
 	bus_space_tag_t sc_bst;
 	bus_space_handle_t sc_bsh;
 	bus_dma_tag_t sc_dmat;

Reply via email to