summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2011-06-04 01:49:43 +0000
committertsutsui <tsutsui@NetBSD.org>2011-06-04 01:49:43 +0000
commit78d476edbbd2392845381da2d002f5ea7ff300f9 (patch)
tree5ec68d3d7732d4a70ee85e15c6350c6b3a7c78de /sys
parent206daba1fa8d0af70c1e29966876c9d0c44fbbbc (diff)
Split device_t/softc. pmax is tested on GXemul, compile test only for alpha.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/tc/ioasic.c21
-rw-r--r--sys/arch/pmax/tc/ioasic.c24
-rw-r--r--sys/dev/tc/ioasic_subr.c6
-rw-r--r--sys/dev/tc/ioasicvar.h4
4 files changed, 29 insertions, 26 deletions
diff --git a/sys/arch/alpha/tc/ioasic.c b/sys/arch/alpha/tc/ioasic.c
index a1465f02e7b..db32a9c2790 100644
--- a/sys/arch/alpha/tc/ioasic.c
+++ b/sys/arch/alpha/tc/ioasic.c
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.42 2009/03/14 21:04:03 dsl Exp $");
#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 @@ tc_addr_t ioasic_base; /* XXX XXX XXX */
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 @@ ioasicmatch(struct device *parent, struct cfdata *cfdata, void *aux)
}
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 @@ ioasicattach(struct device *parent, struct device *self, void *aux)
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 @@ ioasicattach(struct device *parent, struct device *self, void *aux)
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);
diff --git a/sys/arch/pmax/tc/ioasic.c b/sys/arch/pmax/tc/ioasic.c
index 963068704e1..d32462e6070 100644
--- a/sys/arch/pmax/tc/ioasic.c
+++ b/sys/arch/pmax/tc/ioasic.c
@@ -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_builtin_ndevs = ARRAY_SIZEOF(kn03_ioasic_devs) - 3;
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 @@ tc_addr_t ioasic_base; /* XXX XXX XXX */
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 @@ ioasicmatch(struct device *parent, struct cfdata *cfdata, void *aux)
}
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 @@ ioasicattach(struct device *parent, struct device *self, void *aux)
}
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 @@ ioasic_intr_evcnt(struct device *dev, void *cookie)
}
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);
}
diff --git a/sys/dev/tc/ioasic_subr.c b/sys/dev/tc/ioasic_subr.c
index 196f579c076..c0f64050c7e 100644
--- a/sys/dev/tc/ioasic_subr.c
+++ b/sys/dev/tc/ioasic_subr.c
@@ -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 @@ ioasic_attach_devs(struct ioasic_softc *sc, struct ioasic_dev *ioasic_devs,
/* 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);
}
}
diff --git a/sys/dev/tc/ioasicvar.h b/sys/dev/tc/ioasicvar.h
index da4bbb32b17..ae8a39b2aae 100644
--- a/sys/dev/tc/ioasicvar.h
+++ b/sys/dev/tc/ioasicvar.h
@@ -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 ioasicdev_attach_args {
};
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;