summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2011-06-14 15:34:21 +0000
committermatt <matt@NetBSD.org>2011-06-14 15:34:21 +0000
commit2a5aa7e458daeef2b7f2728cd453b8a35ee67d6d (patch)
tree4aaad268e0e8bd75b2f623a916247c506bd1625f
parent6fdc88b2f00c899e0f1bc4a41181dad2b6476adf (diff)
Major cleanup of alpha device drivers.
Switch to CFATTACH_DECL_NEW. struct device * -> device_t struct cfdata * -> cfdata_t Use of device_xname. No direct access to struct device members. Use aprint* (not complete).
-rw-r--r--sys/arch/alpha/a12/a12dc.c20
-rw-r--r--sys/arch/alpha/a12/if_xb.c22
-rw-r--r--sys/arch/alpha/a12/if_xb.h4
-rw-r--r--sys/arch/alpha/alpha/api_up1000.c22
-rw-r--r--sys/arch/alpha/alpha/autoconf.c6
-rw-r--r--sys/arch/alpha/alpha/avalon_a12.c20
-rw-r--r--sys/arch/alpha/alpha/cpu.c122
-rw-r--r--sys/arch/alpha/alpha/dec_1000a.c22
-rw-r--r--sys/arch/alpha/alpha/dec_2000_300.c18
-rw-r--r--sys/arch/alpha/alpha/dec_2100_a50.c20
-rw-r--r--sys/arch/alpha/alpha/dec_2100_a500.c22
-rw-r--r--sys/arch/alpha/alpha/dec_3000_300.c24
-rw-r--r--sys/arch/alpha/alpha/dec_3000_500.c24
-rw-r--r--sys/arch/alpha/alpha/dec_550.c22
-rw-r--r--sys/arch/alpha/alpha/dec_6600.c28
-rw-r--r--sys/arch/alpha/alpha/dec_alphabook1.c20
-rw-r--r--sys/arch/alpha/alpha/dec_axppci_33.c20
-rw-r--r--sys/arch/alpha/alpha/dec_eb164.c22
-rw-r--r--sys/arch/alpha/alpha/dec_eb64plus.c20
-rw-r--r--sys/arch/alpha/alpha/dec_eb66.c20
-rw-r--r--sys/arch/alpha/alpha/dec_kn20aa.c20
-rw-r--r--sys/arch/alpha/alpha/dec_kn300.c24
-rw-r--r--sys/arch/alpha/alpha/dec_kn8ae.c22
-rw-r--r--sys/arch/alpha/alpha/disksubr.c6
-rw-r--r--sys/arch/alpha/alpha/ipifuncs.c14
-rw-r--r--sys/arch/alpha/include/cpuvar.h4
-rw-r--r--sys/arch/alpha/jensenio/com_jensenio.c6
-rw-r--r--sys/arch/alpha/pci/a12c.c25
-rw-r--r--sys/arch/alpha/pci/a12c_pci.c8
-rw-r--r--sys/arch/alpha/pci/a12cvar.h4
-rw-r--r--sys/arch/alpha/pci/apecs.c12
-rw-r--r--sys/arch/alpha/pci/apecs_pci.c11
-rw-r--r--sys/arch/alpha/pci/cia.c30
-rw-r--r--sys/arch/alpha/pci/cia_pci.c11
-rw-r--r--sys/arch/alpha/pci/ciavar.h4
-rw-r--r--sys/arch/alpha/pci/dwlpx.c73
-rw-r--r--sys/arch/alpha/pci/dwlpx_dma.c6
-rw-r--r--sys/arch/alpha/pci/dwlpx_pci.c10
-rw-r--r--sys/arch/alpha/pci/dwlpxvar.h4
-rw-r--r--sys/arch/alpha/pci/irongate.c20
-rw-r--r--sys/arch/alpha/pci/irongate_pci.c8
-rw-r--r--sys/arch/alpha/pci/irongatevar.h4
-rw-r--r--sys/arch/alpha/pci/lca.c19
-rw-r--r--sys/arch/alpha/pci/lca_pci.c11
-rw-r--r--sys/arch/alpha/pci/lcavar.h4
-rw-r--r--sys/arch/alpha/pci/mcpcia.c23
-rw-r--r--sys/arch/alpha/pci/mcpcia_pci.c8
-rw-r--r--sys/arch/alpha/pci/mcpciavar.h4
-rw-r--r--sys/arch/alpha/pci/pci_550.c10
-rw-r--r--sys/arch/alpha/pci/pci_6600.c10
-rw-r--r--sys/arch/alpha/pci/pci_eb164.c6
-rw-r--r--sys/arch/alpha/pci/pci_up1000.c6
-rw-r--r--sys/arch/alpha/pci/sio.c45
-rw-r--r--sys/arch/alpha/pci/tsp_pci.c8
-rw-r--r--sys/arch/alpha/pci/ttwoga.c14
-rw-r--r--sys/arch/alpha/pci/ttwoga_pci.c8
-rw-r--r--sys/arch/alpha/sableio/sableio.c21
-rw-r--r--sys/arch/alpha/tlsb/gbus.c32
-rw-r--r--sys/arch/alpha/tlsb/kftxx.c37
-rw-r--r--sys/arch/alpha/tlsb/tlsb.c10
-rw-r--r--sys/arch/alpha/tlsb/tlsbmem.c24
61 files changed, 568 insertions, 556 deletions
diff --git a/sys/arch/alpha/a12/a12dc.c b/sys/arch/alpha/a12/a12dc.c
index 7fce7583e16..541676eafb0 100644
--- a/sys/arch/alpha/a12/a12dc.c
+++ b/sys/arch/alpha/a12/a12dc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: a12dc.c,v 1.25 2011/04/24 16:26:52 rmind Exp $ */
+/* $NetBSD: a12dc.c,v 1.26 2011/06/14 15:34:21 matt Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -64,7 +64,7 @@
#ifndef BSIDE
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.25 2011/04/24 16:26:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.26 2011/06/14 15:34:21 matt Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -93,14 +93,10 @@ __KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.25 2011/04/24 16:26:52 rmind Exp $");
#define MAX_MODULES 1
-int a12dcmatch(struct device *, struct cfdata *, void *);
-void a12dcattach(struct device *, struct device *, void *);
+int a12dcmatch(device_t, cfdata_t, void *);
+void a12dcattach(device_t, device_t, void *);
-struct a12dc_softc {
- struct device sc_dev;
-} a12dc_softc;
-
-CFATTACH_DECL(a12dc, sizeof(struct a12dc_softc),
+CFATTACH_DECL_NEW(a12dc, 0,
a12dcmatch, a12dcattach, NULL, NULL);
extern struct cfdriver a12dc_cd;
@@ -140,7 +136,7 @@ static void a12_worry(int worry_number);
static void A12InitBackDriver(int);
int
-a12dcmatch(struct device *parent, struct cfdata *match, void *aux)
+a12dcmatch(device_t parent, cfdata_t match, void *aux)
{
struct pcibus_attach_args *pba = aux;
@@ -149,7 +145,7 @@ a12dcmatch(struct device *parent, struct cfdata *match, void *aux)
}
void
-a12dcattach(struct device *parent, struct device *self, void *aux)
+a12dcattach(device_t parent, device_t self, void *aux)
{
struct tty *tp;
struct a12dc_config *ccp;
@@ -157,7 +153,7 @@ a12dcattach(struct device *parent, struct device *self, void *aux)
/* note that we've attached the chipset; can't have 2 A12Cs. */
a12dcfound = 1;
- printf(": driver %s\n", "$Revision: 1.25 $");
+ aprintf_normal(": driver %s\n", "$Revision: 1.26 $");
tp = a12dc_tty[0] = tty_alloc();
tp->t_oproc = a12dcstart;
diff --git a/sys/arch/alpha/a12/if_xb.c b/sys/arch/alpha/a12/if_xb.c
index e7ea6a6f8a5..cdded5d463b 100644
--- a/sys/arch/alpha/a12/if_xb.c
+++ b/sys/arch/alpha/a12/if_xb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xb.c,v 1.26 2010/04/05 07:19:28 joerg Exp $ */
+/* $NetBSD: if_xb.c,v 1.27 2011/06/14 15:34:21 matt Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -74,7 +74,7 @@
#include "opt_avalon_a12.h" /* Config options headers */
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: if_xb.c,v 1.26 2010/04/05 07:19:28 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xb.c,v 1.27 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -133,14 +133,10 @@ static int xb_put_blk(struct mbuf *);
static int xb_put(struct mbuf *);
static long xb_fifo_empty(void);
-int xbmatch(struct device *, struct cfdata *, void *);
-void xbattach(struct device *, struct device *, void *);
+int xbmatch(device_t, cfdata_t, void *);
+void xbattach(device_t, device_t, void *);
-struct xb_softc {
- struct device d;
-} xb_softc;
-
-CFATTACH_DECL(xb, sizeof(struct xb_softc),
+CFATTACH_DECL_NEW(xb, 0,
xbmatch, xbattach, NULL, NULL);
extern struct cfdriver xb_cd;
@@ -210,7 +206,7 @@ static void a12_xbar_setup(void);
int xbfound;
int
-xbmatch(struct device *parent, struct cfdata *match, void *aux)
+xbmatch(device_t parent, cfdata_t match, void *aux)
{
return cputype == ST_AVALON_A12
@@ -218,15 +214,15 @@ xbmatch(struct device *parent, struct cfdata *match, void *aux)
}
void
-xbattach(struct device *parent, struct device *self, void *aux)
+xbattach(device_t parent, device_t self, void *aux)
{
struct xb_config *ccp;
- strcpy(xbi.if_xname, self->dv_xname);
+ strcpy(xbi.if_xname, device_xname(self));
xbfound = 1;
ccp = &xb_configuration;
xb_init_config(ccp, 1);
- printf(": driver %s mtu %lu\n", "$Revision: 1.26 $", xbi.if_mtu);
+ printf(": driver %s mtu %lu\n", "$Revision: 1.27 $", xbi.if_mtu);
}
static void
diff --git a/sys/arch/alpha/a12/if_xb.h b/sys/arch/alpha/a12/if_xb.h
index 4ebc010e0e5..117639af30e 100644
--- a/sys/arch/alpha/a12/if_xb.h
+++ b/sys/arch/alpha/a12/if_xb.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xb.h,v 1.2 2009/03/14 14:45:52 dsl Exp $ */
+/* $NetBSD: if_xb.h,v 1.3 2011/06/14 15:34:21 matt Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -65,7 +65,7 @@ struct a12c_config {
};
struct a12c_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct a12c_config *sc_ccp;
};
diff --git a/sys/arch/alpha/alpha/api_up1000.c b/sys/arch/alpha/alpha/api_up1000.c
index 5e17ae3aea1..9f01c8760f0 100644
--- a/sys/arch/alpha/alpha/api_up1000.c
+++ b/sys/arch/alpha/alpha/api_up1000.c
@@ -1,4 +1,4 @@
-/* $NetBSD: api_up1000.c,v 1.26 2009/03/18 07:42:36 cegger Exp $ */
+/* $NetBSD: api_up1000.c,v 1.27 2011/06/14 15:34:21 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: api_up1000.c,v 1.26 2009/03/18 07:42:36 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: api_up1000.c,v 1.27 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -78,7 +78,7 @@ static int comcnrate = CONSPEED;
void api_up1000_init(void);
static void api_up1000_cons_init(void);
-static void api_up1000_device_register(struct device *, void *);
+static void api_up1000_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -170,12 +170,12 @@ api_up1000_cons_init(void)
}
static void
-api_up1000_device_register(struct device *dev, void *aux)
+api_up1000_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -199,7 +199,7 @@ api_up1000_device_register(struct device *dev, void *aux)
return;
pcidev = dev;
- DPRINTF(("\npcidev = %s\n", dev->dv_xname));
+ DPRINTF(("\npcidev = %s\n", device_xname(dev)));
return;
}
}
@@ -219,11 +219,11 @@ api_up1000_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
DPRINTF(("\nbooted_device = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
found = 1;
} else {
ctrlrdev = dev;
- DPRINTF(("\nctrlrdev = %s\n", dev->dv_xname));
+ DPRINTF(("\nctrlrdev = %s\n", device_xname(dev)));
}
return;
}
@@ -250,7 +250,7 @@ api_up1000_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DPRINTF(("\nbooted_device = %s\n", dev->dv_xname));
+ DPRINTF(("\nbooted_device = %s\n", device_xname(dev)));
found = 1;
}
@@ -275,7 +275,7 @@ api_up1000_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DPRINTF(("booted_device = %s\n", dev->dv_xname));
+ DPRINTF(("booted_device = %s\n", device_xname(dev)));
found = 1;
}
}
diff --git a/sys/arch/alpha/alpha/autoconf.c b/sys/arch/alpha/alpha/autoconf.c
index 8a159047232..412f9e44ae9 100644
--- a/sys/arch/alpha/alpha/autoconf.c
+++ b/sys/arch/alpha/alpha/autoconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.47 2009/03/18 07:42:36 cegger Exp $ */
+/* $NetBSD: autoconf.c,v 1.48 2011/06/14 15:34:21 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.47 2009/03/18 07:42:36 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.48 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -188,7 +188,7 @@ atoi(char *s)
}
void
-device_register(struct device *dev, void *aux)
+device_register(device_t dev, void *aux)
{
if (bootdev_data == NULL) {
/*
diff --git a/sys/arch/alpha/alpha/avalon_a12.c b/sys/arch/alpha/alpha/avalon_a12.c
index 90a8f46f61d..1f4221596d8 100644
--- a/sys/arch/alpha/alpha/avalon_a12.c
+++ b/sys/arch/alpha/alpha/avalon_a12.c
@@ -1,4 +1,4 @@
-/* $NetBSD: avalon_a12.c,v 1.15 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: avalon_a12.c,v 1.16 2011/06/14 15:34:21 matt Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -64,7 +64,7 @@
#include "opt_avalon_a12.h" /* Config options headers */
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.15 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.16 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -100,7 +100,7 @@ __KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.15 2009/03/14 15:35:59 dsl Exp $");
void avalon_a12_init(void);
static void avalon_a12_cons_init(void);
-static void avalon_a12_device_register(struct device *, void *);
+static void avalon_a12_device_register(device_t, void *);
static int a12env(int);
void
@@ -145,12 +145,12 @@ avalon_a12_cons_init()
}
void
-avalon_a12_device_register(struct device *dev, void *aux)
+avalon_a12_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, *ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -176,7 +176,7 @@ avalon_a12_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -197,13 +197,13 @@ avalon_a12_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -232,7 +232,7 @@ avalon_a12_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/cpu.c b/sys/arch/alpha/alpha/cpu.c
index 0fbbc5942f5..e8cd36dd95c 100644
--- a/sys/arch/alpha/alpha/cpu.c
+++ b/sys/arch/alpha/alpha/cpu.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.91 2011/06/07 00:48:30 matt Exp $ */
+/* $NetBSD: cpu.c,v 1.92 2011/06/14 15:34:21 matt Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.91 2011/06/07 00:48:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.92 2011/06/14 15:34:21 matt Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -67,7 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.91 2011/06/07 00:48:30 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/proc.h>
#include <sys/atomic.h>
#include <sys/cpu.h>
@@ -111,27 +111,27 @@ void cpu_boot_secondary(struct cpu_info *);
u_long cpu_implver, cpu_amask;
/* Definition of the driver for autoconfig. */
-static int cpumatch(struct device *, struct cfdata *, void *);
-static void cpuattach(struct device *, struct device *, void *);
+static int cpumatch(device_t, cfdata_t, void *);
+static void cpuattach(device_t, device_t, void *);
-CFATTACH_DECL(cpu, sizeof(struct cpu_softc),
+CFATTACH_DECL_NEW(cpu, sizeof(struct cpu_softc),
cpumatch, cpuattach, NULL, NULL);
static void cpu_announce_extensions(struct cpu_info *);
extern struct cfdriver cpu_cd;
-static const char *lcaminor[] = {
+static const char * const lcaminor[] = {
"",
"21066", "21066",
"21068", "21068",
"21066A", "21068A", 0
};
-struct cputable_struct {
+const struct cputable_struct {
int cpu_major_code;
const char *cpu_major_name;
- const char **cpu_minor_names;
+ const char * const *cpu_minor_names;
} cpunametable[] = {
{ PCS_PROC_EV3, "EV3", NULL },
{ PCS_PROC_EV4, "21064", NULL },
@@ -176,7 +176,7 @@ struct cputable_struct {
*/
static int
-cpumatch(struct device *parent, struct cfdata *cfdata, void *aux)
+cpumatch(device_t parent, cfdata_t cfdata, void *aux)
{
struct mainbus_attach_args *ma = aux;
@@ -191,81 +191,89 @@ cpumatch(struct device *parent, struct cfdata *cfdata, void *aux)
}
static void
-cpuattach(struct device *parent, struct device *self, void *aux)
+cpuattach(device_t parent, device_t self, void *aux)
{
- struct cpu_softc *sc = (void *) self;
+ struct cpu_softc * const sc = device_private(self);
struct mainbus_attach_args *ma = aux;
int i;
- const char **s;
+ const char * const *s;
struct pcs *p;
-#ifdef DEBUG
- int needcomma;
-#endif
u_int32_t major, minor;
struct cpu_info *ci;
+ sc->sc_dev = self;
+
p = LOCATE_PCS(hwrpb, ma->ma_slot);
major = PCS_CPU_MAJORTYPE(p);
minor = PCS_CPU_MINORTYPE(p);
- printf(": ID %d%s, ", ma->ma_slot,
+ aprint_normal(": ID %d%s, ", ma->ma_slot,
ma->ma_slot == hwrpb->rpb_primary_cpu_id ? " (primary)" : "");
- for(i = 0; i < sizeof cpunametable / sizeof cpunametable[0]; ++i) {
+ for(i = 0; i < __arraycount(cpunametable); ++i) {
if (cpunametable[i].cpu_major_code == major) {
- printf("%s-%d", cpunametable[i].cpu_major_name, minor);
+ aprint_normal("%s-%d",
+ cpunametable[i].cpu_major_name, minor);
s = cpunametable[i].cpu_minor_names;
for(i = 0; s && s[i]; ++i) {
if (i == minor && strlen(s[i]) != 0) {
- printf(" (%s)\n", s[i]);
+ aprint_normal(" (%s)\n", s[i]);
goto recognized;
}
}
goto recognized;
}
}
- printf("UNKNOWN CPU TYPE (%d:%d)", major, minor);
+ aprint_error("UNKNOWN CPU TYPE (%d:%d)", major, minor);
recognized:
- printf("\n");
+ aprint_naive("\n");
+ aprint_normal("\n");
#ifdef DEBUG
if (p->pcs_proc_var != 0) {
- printf("%s: ", sc->sc_dev.dv_xname);
+ bool needcomma = false;
+ const char *vaxfp = "";
+ const char *ieeefp = "";
+ const char *pe = "";
- needcomma = 0;
if (p->pcs_proc_var & PCS_VAR_VAXFP) {
- printf("VAX FP support");
- needcomma = 1;
+ fpstr = "VAX FP support";
+ needcomma = true;
}
if (p->pcs_proc_var & PCS_VAR_IEEEFP) {
- printf("%sIEEE FP support", needcomma ? ", " : "");
- needcomma = 1;
+ ieeefp = ", IEEE FP support";
+ if (!needcomma)
+ ieeefp += 2;
+ needcomma = true;
}
if (p->pcs_proc_var & PCS_VAR_PE) {
- printf("%sPrimary Eligible", needcomma ? ", " : "");
- needcomma = 1;
+ pe = ", Primary Eligible");
+ if (!needcomma)
+ pe += 2;
+ needcomma = true;
}
+ aprint_debug_dev(sc->sc_dev, "%s%s%s", vaxfp, ieeefp, pe);
if (p->pcs_proc_var & PCS_VAR_RESERVED)
- printf("%sreserved bits: 0x%lx", needcomma ? ", " : "",
+ aprint_debug("%sreserved bits: %#lx",
+ needcomma ? ", " : "",
p->pcs_proc_var & PCS_VAR_RESERVED);
- printf("\n");
+ aprint_debug("\n");
}
#endif
if (ma->ma_slot > ALPHA_WHAMI_MAXID) {
if (ma->ma_slot == hwrpb->rpb_primary_cpu_id)
panic("cpu_attach: primary CPU ID too large");
- printf("%s: procssor ID too large, ignoring\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(sc->sc_dev,
+ "processor ID too large, ignoring\n");
return;
}
if (ma->ma_slot == hwrpb->rpb_primary_cpu_id)
ci = &cpu_info_primary;
else {
- ci = malloc(sizeof(*ci), M_DEVBUF, M_WAITOK);
- memset(ci, 0, sizeof(*ci));
+ ci = kmem_zalloc(sizeof(*ci), KM_SLEEP);
}
#if defined(MULTIPROCESSOR)
cpu_info[ma->ma_slot] = ci;
@@ -288,8 +296,8 @@ recognized:
if ((p->pcs_flags & PCS_PA) == 0) {
if (ma->ma_slot == hwrpb->rpb_primary_cpu_id)
panic("cpu_attach: primary not available?!");
- printf("%s: processor not available for use\n",
- sc->sc_dev.dv_xname);
+ aprint_normal_dev(sc->sc_dev,
+ "processor not available for use\n");
return;
}
@@ -297,7 +305,7 @@ recognized:
if ((p->pcs_flags & PCS_PV) == 0) {
if (ma->ma_slot == hwrpb->rpb_primary_cpu_id)
panic("cpu_attach: primary has invalid PALcode?!");
- printf("%s: PALcode not valid\n", sc->sc_dev.dv_xname);
+ aprint_error_dev(sc->sc_dev, "PALcode not valid\n");
return;
}
#endif /* MULTIPROCESSOR */
@@ -319,8 +327,8 @@ recognized:
error = mi_cpu_attach(ci);
if (error != 0) {
- aprint_error("%s: mi_cpu_attach failed with %d\n",
- sc->sc_dev.dv_xname, error);
+ aprint_error_dev(sc->sc_dev,
+ "mi_cpu_attach failed with %d\n", error);
return;
}
@@ -337,15 +345,15 @@ recognized:
ci->ci_next = cpu_info_list->ci_next;
cpu_info_list->ci_next = ci;
#else /* ! MULTIPROCESSOR */
- printf("%s: processor off-line; multiprocessor support "
- "not present in kernel\n", sc->sc_dev.dv_xname);
+ aprint_normal_dev(sc->sc_dev, "processor off-line; "
+ "multiprocessor support not present in kernel\n");
#endif /* MULTIPROCESSOR */
}
evcnt_attach_dynamic(&sc->sc_evcnt_clock, EVCNT_TYPE_INTR,
- NULL, sc->sc_dev.dv_xname, "clock");
+ NULL, device_xname(sc->sc_dev), "clock");
evcnt_attach_dynamic(&sc->sc_evcnt_device, EVCNT_TYPE_INTR,
- NULL, sc->sc_dev.dv_xname, "device");
+ NULL, device_xname(sc->sc_dev), "device");
#if defined(MULTIPROCESSOR)
alpha_ipi_init(ci);
#endif
@@ -366,8 +374,8 @@ cpu_announce_extensions(struct cpu_info *ci)
cpu_amask = amask;
} else {
if (implver < cpu_implver)
- printf("%s: WARNING: IMPLVER %lu < %lu\n",
- ci->ci_softc->sc_dev.dv_xname,
+ aprint_error_dev(ci->ci_softc->sc_dev,
+ "WARNING: IMPLVER %lu < %lu\n",
implver, cpu_implver);
/*
@@ -380,8 +388,8 @@ cpu_announce_extensions(struct cpu_info *ci)
if (amask) {
snprintb(bits, sizeof(bits),
ALPHA_AMASK_BITS, cpu_amask);
- printf("%s: Architecture extensions: %s\n",
- ci->ci_softc->sc_dev.dv_xname, bits);
+ aprint_normal_dev(ci->ci_softc->sc_dev,
+ "Architecture extensions: %s\n", bits);
}
}
@@ -457,8 +465,8 @@ cpu_boot_secondary(struct cpu_info *ci)
/* Send a "START" command to the secondary CPU's console. */
if (cpu_iccb_send(ci->ci_cpuid, "START\r\n")) {
- printf("%s: unable to issue `START' command\n",
- ci->ci_softc->sc_dev.dv_xname);
+ aprint_error_dev(ci->ci_softc->sc_dev,
+ "unable to issue `START' command\n");
return;
}
@@ -470,8 +478,8 @@ cpu_boot_secondary(struct cpu_info *ci)
delay(1000);
}
if (timeout == 0)
- printf("%s: processor failed to boot\n",
- ci->ci_softc->sc_dev.dv_xname);
+ aprint_error_dev(ci->ci_softc->sc_dev,
+ "processor failed to boot\n");
/*
* ...and now wait for verification that it's running kernel
@@ -484,8 +492,8 @@ cpu_boot_secondary(struct cpu_info *ci)
delay(1000);
}
if (timeout == 0)
- printf("%s: processor failed to hatch\n",
- ci->ci_softc->sc_dev.dv_xname);
+ aprint_error_dev(ci->ci_softc->sc_dev,
+ "processor failed to hatch\n");
}
void
@@ -520,7 +528,7 @@ cpu_halt(void)
u_long cpu_id = cpu_number();
struct pcs *pcsp = LOCATE_PCS(hwrpb, cpu_id);
- printf("%s: shutting down...\n", ci->ci_softc->sc_dev.dv_xname);
+ aprint_normal_dev(ci->ci_softc->sc_dev, "shutting down...\n");
pcsp->pcs_flags &= ~(PCS_RC | PCS_HALT_REQ);
pcsp->pcs_flags |= PCS_HALT_STAY_HALTED;
@@ -664,7 +672,7 @@ cpu_debug_dump(void)
for (CPU_INFO_FOREACH(cii, ci)) {
db_printf("%p %s %lu %lx %lx %p\n",
ci,
- ci->ci_softc->sc_dev.dv_xname,
+ device_xname(ci->ci_softc->sc_dev),
ci->ci_cpuid,
ci->ci_flags,
ci->ci_ipis,
diff --git a/sys/arch/alpha/alpha/dec_1000a.c b/sys/arch/alpha/alpha/dec_1000a.c
index 502a2548817..6ec4927f3b2 100644
--- a/sys/arch/alpha/alpha/dec_1000a.c
+++ b/sys/arch/alpha/alpha/dec_1000a.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_1000a.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $ */
+/* $NetBSD: dec_1000a.c,v 1.30 2011/06/14 15:34:21 matt Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_1000a.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_1000a.c,v 1.30 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -110,7 +110,7 @@ static int comcnrate = CONSPEED;
void _dec_1000a_init(void);
static void dec_1000a_cons_init(void);
-static void dec_1000a_device_register(struct device *, void *);
+static void dec_1000a_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -247,12 +247,12 @@ dec_1000a_cons_init()
}
static void
-dec_1000a_device_register(struct device *dev, void *aux)
+dec_1000a_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -279,7 +279,7 @@ dec_1000a_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -300,13 +300,13 @@ dec_1000a_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -335,7 +335,7 @@ dec_1000a_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
@@ -356,7 +356,7 @@ dec_1000a_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_2000_300.c b/sys/arch/alpha/alpha/dec_2000_300.c
index a81a2aeac51..a6270b34283 100644
--- a/sys/arch/alpha/alpha/dec_2000_300.c
+++ b/sys/arch/alpha/alpha/dec_2000_300.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_2000_300.c,v 1.16 2008/04/28 20:23:10 martin Exp $ */
+/* $NetBSD: dec_2000_300.c,v 1.17 2011/06/14 15:34:21 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_2000_300.c,v 1.16 2008/04/28 20:23:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_2000_300.c,v 1.17 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -91,7 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: dec_2000_300.c,v 1.16 2008/04/28 20:23:10 martin Exp
void dec_2000_300_init(void);
static void dec_2000_300_cons_init(void);
-static void dec_2000_300_device_register(struct device *, void *);
+static void dec_2000_300_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -196,12 +196,12 @@ dec_2000_300_cons_init(void)
}
static void
-dec_2000_300_device_register(struct device *dev, void *aux)
+dec_2000_300_device_register(device_t dev, void *aux)
{
static int found, initted, scsiboot, netboot;
- static struct device *eisadev, *isadev, *scsidev;
+ static device_t eisadev, isadev, scsidev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -232,7 +232,7 @@ dec_2000_300_device_register(struct device *dev, void *aux)
scsidev = dev;
#if 0
- printf("\nscsidev = %s\n", scsidev->dv_xname);
+ printf("\nscsidev = %s\n", device_xname(scsidev));
#endif
return;
}
@@ -269,7 +269,7 @@ dec_2000_300_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", booted_device->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(booted_device));
#endif
found = 1;
return;
@@ -289,7 +289,7 @@ dec_2000_300_device_register(struct device *dev, void *aux)
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", booted_device->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(booted_device));
#endif
found = 1;
return;
diff --git a/sys/arch/alpha/alpha/dec_2100_a50.c b/sys/arch/alpha/alpha/dec_2100_a50.c
index 23ace43b24a..50882a9668d 100644
--- a/sys/arch/alpha/alpha/dec_2100_a50.c
+++ b/sys/arch/alpha/alpha/dec_2100_a50.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_2100_a50.c,v 1.63 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_2100_a50.c,v 1.64 2011/06/14 15:34:21 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_2100_a50.c,v 1.63 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_2100_a50.c,v 1.64 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,7 +76,7 @@ static int comcnrate = CONSPEED;
void dec_2100_a50_init(void);
static void dec_2100_a50_cons_init(void);
-static void dec_2100_a50_device_register(struct device *, void *);
+static void dec_2100_a50_device_register(device_t, void *);
static void dec_2100_a50_mcheck_handler
(unsigned long, struct trapframe *, unsigned long, unsigned long);
@@ -194,12 +194,12 @@ dec_2100_a50_cons_init()
}
static void
-dec_2100_a50_device_register(struct device *dev, void *aux)
+dec_2100_a50_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -225,7 +225,7 @@ dec_2100_a50_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -246,13 +246,13 @@ dec_2100_a50_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -281,7 +281,7 @@ dec_2100_a50_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_2100_a500.c b/sys/arch/alpha/alpha/dec_2100_a500.c
index 151dc52de34..b29a6d0f70e 100644
--- a/sys/arch/alpha/alpha/dec_2100_a500.c
+++ b/sys/arch/alpha/alpha/dec_2100_a500.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_2100_a500.c,v 1.19 2009/09/14 02:46:29 mhitch Exp $ */
+/* $NetBSD: dec_2100_a500.c,v 1.20 2011/06/14 15:34:21 matt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_2100_a500.c,v 1.19 2009/09/14 02:46:29 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_2100_a500.c,v 1.20 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -104,7 +104,7 @@ static int comcnrate = CONSPEED;
void _dec_2100_a500_init(void);
static void dec_2100_a500_cons_init(void);
-static void dec_2100_a500_device_register(struct device *, void *);
+static void dec_2100_a500_device_register(device_t, void *);
static void dec_2100_a500_machine_check(unsigned long, struct trapframe *,
unsigned long, unsigned long);
@@ -235,12 +235,12 @@ dec_2100_a500_cons_init(void)
}
static void
-dec_2100_a500_device_register(struct device *dev, void *aux)
+dec_2100_a500_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -267,7 +267,7 @@ dec_2100_a500_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -288,13 +288,13 @@ dec_2100_a500_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -323,7 +323,7 @@ dec_2100_a500_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
@@ -344,7 +344,7 @@ dec_2100_a500_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_3000_300.c b/sys/arch/alpha/alpha/dec_3000_300.c
index f419aa3b931..c683eab7675 100644
--- a/sys/arch/alpha/alpha/dec_3000_300.c
+++ b/sys/arch/alpha/alpha/dec_3000_300.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3000_300.c,v 1.45 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_3000_300.c,v 1.46 2011/06/14 15:34:21 matt Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.45 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.46 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.45 2009/03/14 15:35:59 dsl Exp $"
void dec_3000_300_init(void);
static void dec_3000_300_cons_init(void);
-static void dec_3000_300_device_register(struct device *, void *);
+static void dec_3000_300_device_register(device_t, void *);
const struct alpha_variation_table dec_3000_300_variations[] = {
{ SV_ST_PELICAN, "DEC 3000/300 (\"Pelican\")" },
@@ -143,13 +143,13 @@ dec_3000_300_cons_init()
}
static void
-dec_3000_300_device_register(struct device *dev, void *aux)
+dec_3000_300_device_register(device_t dev, void *aux)
{
static int found, initted, scsiboot, netboot;
- static struct device *scsidev;
- static struct device *tcdsdev;
+ static device_t scsidev;
+ static device_t tcdsdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -178,14 +178,14 @@ dec_3000_300_device_register(struct device *dev, void *aux)
tcdsdev = dev;
#if 0
- printf("\ntcdsdev = %s\n", dev->dv_xname);
+ printf("\ntcdsdev = %s\n", device_xname(dev));
#endif
}
if (scsiboot && tcdsdev &&
device_is_a(dev, "asc")) {
struct tcdsdev_attach_args *ta = aux;
- if (parent != (struct device *)tcdsdev)
+ if (parent != (device_t)tcdsdev)
return;
if (ta->tcdsda_chip != b->channel)
@@ -193,7 +193,7 @@ dec_3000_300_device_register(struct device *dev, void *aux)
scsidev = dev;
#if 0
- printf("\nscsidev = %s\n", dev->dv_xname);
+ printf("\nscsidev = %s\n", device_xname(dev));
#endif
}
@@ -228,7 +228,7 @@ dec_3000_300_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", booted_device->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(booted_device));
#endif
found = 1;
}
@@ -243,7 +243,7 @@ dec_3000_300_device_register(struct device *dev, void *aux)
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", booted_device->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(booted_device));
#endif
found = 1;
return;
diff --git a/sys/arch/alpha/alpha/dec_3000_500.c b/sys/arch/alpha/alpha/dec_3000_500.c
index bcc09f65618..3f265650651 100644
--- a/sys/arch/alpha/alpha/dec_3000_500.c
+++ b/sys/arch/alpha/alpha/dec_3000_500.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3000_500.c,v 1.44 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_3000_500.c,v 1.45 2011/06/14 15:34:21 matt Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.44 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.45 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.44 2009/03/14 15:35:59 dsl Exp $"
void dec_3000_500_init(void);
static void dec_3000_500_cons_init(void);
-static void dec_3000_500_device_register(struct device *, void *);
+static void dec_3000_500_device_register(device_t, void *);
static const char dec_3000_500_sp[] = "DEC 3000/400 (\"Sandpiper\")";
static const char dec_3000_500_sf[] = "DEC 3000/500 (\"Flamingo\")";
@@ -163,13 +163,13 @@ dec_3000_500_cons_init()
}
static void
-dec_3000_500_device_register(struct device *dev, void *aux)
+dec_3000_500_device_register(device_t dev, void *aux)
{
static int found, initted, scsiboot, netboot;
- static struct device *scsidev;
- static struct device *tcdsdev;
+ static device_t scsidev;
+ static device_t tcdsdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -198,14 +198,14 @@ dec_3000_500_device_register(struct device *dev, void *aux)
tcdsdev = dev;
#if 0
- printf("\ntcdsdev = %s\n", dev->dv_xname);
+ printf("\ntcdsdev = %s\n", device_xname(dev));
#endif
}
if (scsiboot && tcdsdev &&
device_is_a(dev, "asc")) {
struct tcdsdev_attach_args *ta = aux;
- if (parent != (struct device *)tcdsdev)
+ if (parent != (device_t)tcdsdev)
return;
if (ta->tcdsda_chip != b->channel)
@@ -213,7 +213,7 @@ dec_3000_500_device_register(struct device *dev, void *aux)
scsidev = dev;
#if 0
- printf("\nscsidev = %s\n", dev->dv_xname);
+ printf("\nscsidev = %s\n", device_xname(dev));
#endif
}
@@ -248,7 +248,7 @@ dec_3000_500_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", booted_device->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(booted_device));
#endif
found = 1;
}
@@ -263,7 +263,7 @@ dec_3000_500_device_register(struct device *dev, void *aux)
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", booted_device->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(booted_device));
#endif
found = 1;
return;
diff --git a/sys/arch/alpha/alpha/dec_550.c b/sys/arch/alpha/alpha/dec_550.c
index 39d8db292cb..46cfe7951ee 100644
--- a/sys/arch/alpha/alpha/dec_550.c
+++ b/sys/arch/alpha/alpha/dec_550.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_550.c,v 1.32 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_550.c,v 1.33 2011/06/14 15:34:21 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_550.c,v 1.32 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_550.c,v 1.33 2011/06/14 15:34:21 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -82,7 +82,7 @@ static int comcnrate = CONSPEED;
void dec_550_init(void);
static void dec_550_cons_init(void);
-static void dec_550_device_register(struct device *, void *);
+static void dec_550_device_register(device_t, void *);
static void dec_550_powerdown(void);
#ifdef KGDB
@@ -181,12 +181,12 @@ dec_550_cons_init()
}
static void
-dec_550_device_register(struct device *dev, void *aux)
+dec_550_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -211,7 +211,7 @@ dec_550_device_register(struct device *dev, void *aux)
return;
pcidev = dev;
- DR_VERBOSE(printf("\npcidev = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\npcidev = %s\n", device_xname(dev)));
return;
}
}
@@ -231,12 +231,12 @@ dec_550_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
DR_VERBOSE(printf("\nbooted_device = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
found = 1;
} else {
ctrlrdev = dev;
DR_VERBOSE(printf("\nctrlrdev = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
}
return;
}
@@ -263,7 +263,7 @@ dec_550_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("\nbooted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\nbooted_device = %s\n", device_xname(dev)));
found = 1;
}
@@ -288,7 +288,7 @@ dec_550_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("booted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("booted_device = %s\n", device_xname(dev)));
found = 1;
}
}
diff --git a/sys/arch/alpha/alpha/dec_6600.c b/sys/arch/alpha/alpha/dec_6600.c
index 5198adf84e1..091a487f7bc 100644
--- a/sys/arch/alpha/alpha/dec_6600.c
+++ b/sys/arch/alpha/alpha/dec_6600.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_6600.c,v 1.30 2010/10/07 19:55:02 hans Exp $ */
+/* $NetBSD: dec_6600.c,v 1.31 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_6600.c,v 1.30 2010/10/07 19:55:02 hans Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_6600.c,v 1.31 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -84,7 +84,7 @@ static int comcnrate __attribute__((unused)) = CONSPEED;
void dec_6600_init(void);
static void dec_6600_cons_init(void);
-static void dec_6600_device_register(struct device *, void *);
+static void dec_6600_device_register(device_t, void *);
static void dec_6600_mcheck(unsigned long, struct ev6_logout_area *);
static void dec_6600_mcheck_sys(unsigned int, struct ev6_logout_area *);
static void dec_6600_mcheck_handler(unsigned long, struct trapframe *,
@@ -194,12 +194,12 @@ dec_6600_cons_init()
}
static void
-dec_6600_device_register(struct device *dev, void *aux)
+dec_6600_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *primarydev, *pcidev, *ctrlrdev;
+ static device_t primarydev, pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -226,7 +226,7 @@ dec_6600_device_register(struct device *dev, void *aux)
return;
primarydev = dev;
DR_VERBOSE(printf("\nprimarydev = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
return;
}
}
@@ -252,7 +252,7 @@ dec_6600_device_register(struct device *dev, void *aux)
return;
pcidev = dev;
- DR_VERBOSE(printf("\npcidev = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\npcidev = %s\n", device_xname(dev)));
return;
}
}
@@ -272,12 +272,12 @@ dec_6600_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
DR_VERBOSE(printf("\nbooted_device = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
found = 1;
} else {
ctrlrdev = dev;
DR_VERBOSE(printf("\nctrlrdev = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
}
return;
}
@@ -304,7 +304,7 @@ dec_6600_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("\nbooted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\nbooted_device = %s\n", device_xname(dev)));
found = 1;
}
@@ -323,7 +323,7 @@ dec_6600_device_register(struct device *dev, void *aux)
return;
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("\nbooted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\nbooted_device = %s\n", device_xname(dev)));
found = 1;
}
@@ -342,7 +342,7 @@ dec_6600_device_register(struct device *dev, void *aux)
return;
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("\nbooted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\nbooted_device = %s\n", device_xname(dev)));
found = 1;
}
@@ -367,7 +367,7 @@ dec_6600_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("booted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("booted_device = %s\n", device_xname(dev)));
found = 1;
}
}
diff --git a/sys/arch/alpha/alpha/dec_alphabook1.c b/sys/arch/alpha/alpha/dec_alphabook1.c
index 636b437a454..7217e9585d2 100644
--- a/sys/arch/alpha/alpha/dec_alphabook1.c
+++ b/sys/arch/alpha/alpha/dec_alphabook1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_alphabook1.c,v 1.23 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_alphabook1.c,v 1.24 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_alphabook1.c,v 1.23 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_alphabook1.c,v 1.24 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,7 +74,7 @@ static int comcnrate = CONSPEED;
void dec_alphabook1_init(void);
static void dec_alphabook1_cons_init(void);
-static void dec_alphabook1_device_register(struct device *, void *);
+static void dec_alphabook1_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -174,12 +174,12 @@ dec_alphabook1_cons_init()
}
static void
-dec_alphabook1_device_register(struct device *dev, void *aux)
+dec_alphabook1_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -205,7 +205,7 @@ dec_alphabook1_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -226,13 +226,13 @@ dec_alphabook1_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -261,7 +261,7 @@ dec_alphabook1_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_axppci_33.c b/sys/arch/alpha/alpha/dec_axppci_33.c
index 7562258329d..951d54fce4b 100644
--- a/sys/arch/alpha/alpha/dec_axppci_33.c
+++ b/sys/arch/alpha/alpha/dec_axppci_33.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_axppci_33.c,v 1.64 2009/03/18 10:22:22 cegger Exp $ */
+/* $NetBSD: dec_axppci_33.c,v 1.65 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_axppci_33.c,v 1.64 2009/03/18 10:22:22 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_axppci_33.c,v 1.65 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,7 +76,7 @@ static int comcnrate = CONSPEED;
void dec_axppci_33_init(void);
static void dec_axppci_33_cons_init(void);
-static void dec_axppci_33_device_register(struct device *, void *);
+static void dec_axppci_33_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -228,12 +228,12 @@ dec_axppci_33_cons_init()
}
static void
-dec_axppci_33_device_register(struct device *dev, void *aux)
+dec_axppci_33_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -259,7 +259,7 @@ dec_axppci_33_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -280,13 +280,13 @@ dec_axppci_33_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -315,7 +315,7 @@ dec_axppci_33_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_eb164.c b/sys/arch/alpha/alpha/dec_eb164.c
index 09aff558742..c3c9304037c 100644
--- a/sys/arch/alpha/alpha/dec_eb164.c
+++ b/sys/arch/alpha/alpha/dec_eb164.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_eb164.c,v 1.58 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_eb164.c,v 1.59 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_eb164.c,v 1.58 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_eb164.c,v 1.59 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -79,7 +79,7 @@ static int comcnrate = CONSPEED;
void dec_eb164_init(void);
static void dec_eb164_cons_init(void);
-static void dec_eb164_device_register(struct device *, void *);
+static void dec_eb164_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -176,12 +176,12 @@ dec_eb164_cons_init()
}
static void
-dec_eb164_device_register(struct device *dev, void *aux)
+dec_eb164_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -206,7 +206,7 @@ dec_eb164_device_register(struct device *dev, void *aux)
return;
pcidev = dev;
- DR_VERBOSE(printf("\npcidev = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\npcidev = %s\n", device_xname(dev)));
return;
}
}
@@ -226,12 +226,12 @@ dec_eb164_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
DR_VERBOSE(printf("\nbooted_device = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
found = 1;
} else {
ctrlrdev = dev;
DR_VERBOSE(printf("\nctrlrdev = %s\n",
- dev->dv_xname));
+ device_xname(dev)));
}
return;
}
@@ -258,7 +258,7 @@ dec_eb164_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("\nbooted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("\nbooted_device = %s\n", device_xname(dev)));
found = 1;
}
@@ -283,7 +283,7 @@ dec_eb164_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
- DR_VERBOSE(printf("booted_device = %s\n", dev->dv_xname));
+ DR_VERBOSE(printf("booted_device = %s\n", device_xname(dev)));
found = 1;
}
}
diff --git a/sys/arch/alpha/alpha/dec_eb64plus.c b/sys/arch/alpha/alpha/dec_eb64plus.c
index c7936cafed9..6ecddaa2242 100644
--- a/sys/arch/alpha/alpha/dec_eb64plus.c
+++ b/sys/arch/alpha/alpha/dec_eb64plus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_eb64plus.c,v 1.38 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_eb64plus.c,v 1.39 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_eb64plus.c,v 1.38 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_eb64plus.c,v 1.39 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,7 +76,7 @@ static int comcnrate = CONSPEED;
void dec_eb64plus_init(void);
static void dec_eb64plus_cons_init(void);
-static void dec_eb64plus_device_register(struct device *, void *);
+static void dec_eb64plus_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -184,12 +184,12 @@ dec_eb64plus_cons_init()
}
static void
-dec_eb64plus_device_register(struct device *dev, void *aux)
+dec_eb64plus_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -215,7 +215,7 @@ dec_eb64plus_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -236,13 +236,13 @@ dec_eb64plus_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -271,7 +271,7 @@ dec_eb64plus_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_eb66.c b/sys/arch/alpha/alpha/dec_eb66.c
index 3554fb8270a..f0c272415e9 100644
--- a/sys/arch/alpha/alpha/dec_eb66.c
+++ b/sys/arch/alpha/alpha/dec_eb66.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_eb66.c,v 1.24 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_eb66.c,v 1.25 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_eb66.c,v 1.24 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_eb66.c,v 1.25 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,7 +76,7 @@ static int comcnrate = CONSPEED;
void dec_eb66_init(void);
static void dec_eb66_cons_init(void);
-static void dec_eb66_device_register(struct device *, void *);
+static void dec_eb66_device_register(device_t, void *);
#ifdef KGDB
#include <machine/db_machdep.h>
@@ -181,12 +181,12 @@ dec_eb66_cons_init()
}
static void
-dec_eb66_device_register(struct device *dev, void *aux)
+dec_eb66_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -212,7 +212,7 @@ dec_eb66_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -233,13 +233,13 @@ dec_eb66_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -268,7 +268,7 @@ dec_eb66_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_kn20aa.c b/sys/arch/alpha/alpha/dec_kn20aa.c
index 9cd8d8e0507..8bf955ec4d8 100644
--- a/sys/arch/alpha/alpha/dec_kn20aa.c
+++ b/sys/arch/alpha/alpha/dec_kn20aa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_kn20aa.c,v 1.61 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_kn20aa.c,v 1.62 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_kn20aa.c,v 1.61 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_kn20aa.c,v 1.62 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,7 +76,7 @@ static int comcnrate = CONSPEED;
void dec_kn20aa_init(void);
static void dec_kn20aa_cons_init(void);
-static void dec_kn20aa_device_register(struct device *, void *);
+static void dec_kn20aa_device_register(device_t, void *);
static void dec_kn20aa_mcheck_handler
(unsigned long, struct trapframe *, unsigned long, unsigned long);
@@ -183,12 +183,12 @@ dec_kn20aa_cons_init()
}
static void
-dec_kn20aa_device_register(struct device *dev, void *aux)
+dec_kn20aa_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *pcidev, *ctrlrdev;
+ static device_t pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -214,7 +214,7 @@ dec_kn20aa_device_register(struct device *dev, void *aux)
pcidev = dev;
#if 0
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -235,13 +235,13 @@ dec_kn20aa_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if 0
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -270,7 +270,7 @@ dec_kn20aa_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_kn300.c b/sys/arch/alpha/alpha/dec_kn300.c
index b2c7298adf1..c75e65951cc 100644
--- a/sys/arch/alpha/alpha/dec_kn300.c
+++ b/sys/arch/alpha/alpha/dec_kn300.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_kn300.c,v 1.37 2009/09/14 02:46:29 mhitch Exp $ */
+/* $NetBSD: dec_kn300.c,v 1.38 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1998 by Matthew Jacob
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.37 2009/09/14 02:46:29 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.38 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -85,7 +85,7 @@ static int comcnrate = CONSPEED;
void dec_kn300_init(void);
void dec_kn300_cons_init(void);
-static void dec_kn300_device_register(struct device *, void *);
+static void dec_kn300_device_register(device_t, void *);
static void dec_kn300_mcheck_handler
(unsigned long, struct trapframe *, unsigned long, unsigned long);
@@ -221,12 +221,12 @@ dec_kn300_cons_init()
/* #define BDEBUG 1 */
static void
-dec_kn300_device_register(struct device *dev, void *aux)
+dec_kn300_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *primarydev, *pcidev, *ctrlrdev;
+ static device_t primarydev, pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -261,7 +261,7 @@ dec_kn300_device_register(struct device *dev, void *aux)
return;
primarydev = dev;
#ifdef BDEBUG
- printf("\nprimarydev = %s\n", dev->dv_xname);
+ printf("\nprimarydev = %s\n", device_xname(dev));
#endif
return;
}
@@ -289,7 +289,7 @@ dec_kn300_device_register(struct device *dev, void *aux)
pcidev = dev;
#ifdef BDEBUG
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -310,13 +310,13 @@ dec_kn300_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#ifdef BDEBUG
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#ifdef BDEBUG
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -345,7 +345,7 @@ dec_kn300_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#ifdef BDEBUG
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
@@ -366,7 +366,7 @@ dec_kn300_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if 0
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/dec_kn8ae.c b/sys/arch/alpha/alpha/dec_kn8ae.c
index 96a083fa931..a7fa3c94833 100644
--- a/sys/arch/alpha/alpha/dec_kn8ae.c
+++ b/sys/arch/alpha/alpha/dec_kn8ae.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_kn8ae.c,v 1.39 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_kn8ae.c,v 1.40 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_kn8ae.c,v 1.39 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_kn8ae.c,v 1.40 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -68,7 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: dec_kn8ae.c,v 1.39 2009/03/14 15:35:59 dsl Exp $");
void dec_kn8ae_init(void);
void dec_kn8ae_cons_init(void);
-static void dec_kn8ae_device_register(struct device *, void *);
+static void dec_kn8ae_device_register(device_t, void *);
static void dec_kn8ae_mcheck_handler
(unsigned long, struct trapframe *, unsigned long, unsigned long);
@@ -115,12 +115,12 @@ dec_kn8ae_cons_init()
/* #define BDEBUG 1 */
static void
-dec_kn8ae_device_register(struct device *dev, void *aux)
+dec_kn8ae_device_register(device_t dev, void *aux)
{
static int found, initted, diskboot, netboot;
- static struct device *primarydev, *pcidev, *ctrlrdev;
+ static device_t primarydev, pcidev, ctrlrdev;
struct bootdev_data *b = bootdev_data;
- struct device *parent = device_parent(dev);
+ device_t parent = device_parent(dev);
if (found)
return;
@@ -154,7 +154,7 @@ dec_kn8ae_device_register(struct device *dev, void *aux)
return;
primarydev = dev;
#ifdef BDEBUG
- printf("\nprimarydev = %s\n", dev->dv_xname);
+ printf("\nprimarydev = %s\n", device_xname(dev));
#endif
return;
}
@@ -182,7 +182,7 @@ dec_kn8ae_device_register(struct device *dev, void *aux)
pcidev = dev;
#if BDEBUG
- printf("\npcidev = %s\n", dev->dv_xname);
+ printf("\npcidev = %s\n", device_xname(dev));
#endif
return;
}
@@ -203,13 +203,13 @@ dec_kn8ae_device_register(struct device *dev, void *aux)
if (netboot) {
booted_device = dev;
#ifdef BDEBUG
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
} else {
ctrlrdev = dev;
#if BDEBUG
- printf("\nctrlrdev = %s\n", dev->dv_xname);
+ printf("\nctrlrdev = %s\n", device_xname(dev));
#endif
}
return;
@@ -238,7 +238,7 @@ dec_kn8ae_device_register(struct device *dev, void *aux)
/* we've found it! */
booted_device = dev;
#if BDEBUG
- printf("\nbooted_device = %s\n", dev->dv_xname);
+ printf("\nbooted_device = %s\n", device_xname(dev));
#endif
found = 1;
}
diff --git a/sys/arch/alpha/alpha/disksubr.c b/sys/arch/alpha/alpha/disksubr.c
index c602989c9d8..3a3f756d31e 100644
--- a/sys/arch/alpha/alpha/disksubr.c
+++ b/sys/arch/alpha/alpha/disksubr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.39 2009/03/16 23:11:09 dsl Exp $ */
+/* $NetBSD: disksubr.c,v 1.40 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.39 2009/03/16 23:11:09 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.40 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -42,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.39 2009/03/16 23:11:09 dsl Exp $");
#include <machine/cpu.h>
#include <machine/autoconf.h>
-extern struct device *bootdv;
+extern device_t bootdv;
/*
* Attempt to read a disk label from a device
diff --git a/sys/arch/alpha/alpha/ipifuncs.c b/sys/arch/alpha/alpha/ipifuncs.c
index 9b5860ee395..b9e4ce08a23 100644
--- a/sys/arch/alpha/alpha/ipifuncs.c
+++ b/sys/arch/alpha/alpha/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ipifuncs.c,v 1.46 2011/06/07 00:48:30 matt Exp $ */
+/* $NetBSD: ipifuncs.c,v 1.47 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.46 2011/06/07 00:48:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.47 2011/06/14 15:34:22 matt Exp $");
/*
* Interprocessor interrupt handlers.
@@ -98,16 +98,16 @@ const char * const ipinames[ALPHA_NIPIS] = {
void
alpha_ipi_init(struct cpu_info *ci)
{
- struct cpu_softc *sc = ci->ci_softc;
+ struct cpu_softc * const sc = ci->ci_softc;
+ const char * const xname = device_xname(sc->sc_dev);
int i;
evcnt_attach_dynamic(&sc->sc_evcnt_ipi, EVCNT_TYPE_INTR,
- NULL, sc->sc_dev.dv_xname, "ipi");
+ NULL, xname, "ipi");
for (i = 0; i < ALPHA_NIPIS; i++) {
evcnt_attach_dynamic(&sc->sc_evcnt_which_ipi[i],
- EVCNT_TYPE_INTR, NULL, sc->sc_dev.dv_xname,
- ipinames[i]);
+ EVCNT_TYPE_INTR, NULL, xname, ipinames[i]);
}
}
@@ -117,7 +117,7 @@ alpha_ipi_init(struct cpu_info *ci)
void
alpha_ipi_process(struct cpu_info *ci, struct trapframe *framep)
{
- struct cpu_softc *sc = ci->ci_softc;
+ struct cpu_softc * const sc = ci->ci_softc;
u_long pending_ipis, bit;
#ifdef DIAGNOSTIC
diff --git a/sys/arch/alpha/include/cpuvar.h b/sys/arch/alpha/include/cpuvar.h
index b1af0a23a0d..002e6b3319d 100644
--- a/sys/arch/alpha/include/cpuvar.h
+++ b/sys/arch/alpha/include/cpuvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuvar.h,v 1.4 2008/04/28 20:23:11 martin Exp $ */
+/* $NetBSD: cpuvar.h,v 1.5 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include "opt_multiprocessor.h"
struct cpu_softc {
- struct device sc_dev; /* base device */
+ device_t sc_dev; /* base device */
struct evcnt sc_evcnt_clock; /* clock interrupts */
struct evcnt sc_evcnt_device; /* device interrupts */
#if defined(MULTIPROCESSOR)
diff --git a/sys/arch/alpha/jensenio/com_jensenio.c b/sys/arch/alpha/jensenio/com_jensenio.c
index 461cc81f9ec..3e7dba446e5 100644
--- a/sys/arch/alpha/jensenio/com_jensenio.c
+++ b/sys/arch/alpha/jensenio/com_jensenio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com_jensenio.c,v 1.11 2009/11/21 05:35:41 rmind Exp $ */
+/* $NetBSD: com_jensenio.c,v 1.12 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: com_jensenio.c,v 1.11 2009/11/21 05:35:41 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_jensenio.c,v 1.12 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -108,7 +108,7 @@ com_jensenio_attach(device_t parent, device_t self, void *aux)
com_attach_subr(sc);
- scb_set(ja->ja_irq[0], com_jensenio_intr, sc, IPL_VM);
+ scb_set(ja->ja_irq[0], com_jensenio_intr, jsc, IPL_VM);
aprint_normal_dev(self, "interrupting at vector 0x%x\n",
ja->ja_irq[0]);
diff --git a/sys/arch/alpha/pci/a12c.c b/sys/arch/alpha/pci/a12c.c
index afb7bb71532..9294ecb70f1 100644
--- a/sys/arch/alpha/pci/a12c.c
+++ b/sys/arch/alpha/pci/a12c.c
@@ -1,4 +1,4 @@
-/* $NetBSD: a12c.c,v 1.23 2011/05/17 17:34:47 dyoung Exp $ */
+/* $NetBSD: a12c.c,v 1.24 2011/06/14 15:34:22 matt Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -38,7 +38,7 @@
#include "opt_avalon_a12.h" /* Config options headers */
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: a12c.c,v 1.23 2011/05/17 17:34:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a12c.c,v 1.24 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -62,19 +62,19 @@ __KERNEL_RCSID(0, "$NetBSD: a12c.c,v 1.23 2011/05/17 17:34:47 dyoung Exp $");
#define A12C() /* Generate ctags(1) key */
-int a12cmatch(struct device *, struct cfdata *, void *);
-void a12cattach(struct device *, struct device *, void *);
+int a12cmatch(device_t, cfdata_t, void *);
+void a12cattach(device_t, device_t, void *);
-CFATTACH_DECL(a12c, sizeof(struct a12c_softc),
+CFATTACH_DECL_NEW(a12c, sizeof(struct a12c_softc),
a12cmatch, a12cattach, NULL, NULL);
extern struct cfdriver a12c_cd;
static const struct clocktime zeroct;
-static void noclock_init(struct device *);
-static void noclock_get(struct device *, time_t, struct clocktime *);
-static void noclock_set(struct device *, struct clocktime *);
+static void noclock_init(device_t);
+static void noclock_get(device_t, time_t, struct clocktime *);
+static void noclock_set(device_t, struct clocktime *);
static const struct clockfns noclock_fns = {
noclock_init, noclock_get, noclock_set
@@ -86,7 +86,7 @@ int a12cfound;
struct a12c_config a12c_configuration;
int
-a12cmatch(struct device *parent, struct cfdata *match, void *aux)
+a12cmatch(device_t parent, cfdata_t match, void *aux)
{
struct mainbus_attach_args *ma = aux;
@@ -114,14 +114,15 @@ a12c_init(struct a12c_config *ccp, int mallocsafe)
}
void
-a12cattach(struct device *parent, struct device *self, void *aux)
+a12cattach(device_t parent, device_t self, void *aux)
{
- struct a12c_softc *sc = (struct a12c_softc *)self;
+ struct a12c_softc *sc = device_private(self);
struct a12c_config *ccp;
struct pcibus_attach_args pba;
/* note that we've attached the chipset; can't have 2 A12Cs. */
a12cfound = 1;
+ sc->sc_dev = self;
/*
* set up the chipset's info; done once at console init time
@@ -132,7 +133,7 @@ a12cattach(struct device *parent, struct device *self, void *aux)
a12c_init(ccp, 1);
/* XXX print chipset information */
- printf(": driver %s over logic %x\n", "$Revision: 1.23 $",
+ aprint_normal(": driver %s over logic %x\n", "$Revision: 1.24 $",
A12_ALL_EXTRACT(REGVAL(A12_VERS)));
pci_a12_pickintr(ccp);
diff --git a/sys/arch/alpha/pci/a12c_pci.c b/sys/arch/alpha/pci/a12c_pci.c
index 7afbe4f8b92..a9eed487976 100644
--- a/sys/arch/alpha/pci/a12c_pci.c
+++ b/sys/arch/alpha/pci/a12c_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: a12c_pci.c,v 1.7 2010/12/15 01:27:18 matt Exp $ */
+/* $NetBSD: a12c_pci.c,v 1.8 2011/06/14 15:34:22 matt Exp $ */
/* [Notice revision 2.0]
* Copyright (c) 1997 Avalon Computer Systems, Inc.
@@ -38,7 +38,7 @@
#include "opt_avalon_a12.h" /* Config options headers */
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: a12c_pci.c,v 1.7 2010/12/15 01:27:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a12c_pci.c,v 1.8 2011/06/14 15:34:22 matt Exp $");
__KERNEL_COPYRIGHT(0,
"Copyright (c) 1997 Christopher G. Demetriou. All rights reserved.");
@@ -56,7 +56,7 @@ __KERNEL_COPYRIGHT(0,
#define A12C_PCI() /* Generate ctags(1) key */
-void a12c_attach_hook(struct device *, struct device *,
+void a12c_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int a12c_bus_maxdevs(void *, int);
pcitag_t a12c_make_tag(void *, int, int, int);
@@ -79,7 +79,7 @@ a12c_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-a12c_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba)
+a12c_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/pci/a12cvar.h b/sys/arch/alpha/pci/a12cvar.h
index 662bedb8447..1ec4f3f38dd 100644
--- a/sys/arch/alpha/pci/a12cvar.h
+++ b/sys/arch/alpha/pci/a12cvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: a12cvar.h,v 1.5 2009/03/14 14:45:53 dsl Exp $ */
+/* $NetBSD: a12cvar.h,v 1.6 2011/06/14 15:34:22 matt Exp $ */
/* [Notice revision 2.0]
* Copyright (c) 1997 Avalon Computer Systems, Inc.
@@ -65,7 +65,7 @@ struct a12c_config {
};
struct a12c_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct a12c_config *sc_ccp;
};
diff --git a/sys/arch/alpha/pci/apecs.c b/sys/arch/alpha/pci/apecs.c
index e8edd224be0..b1d0b2c58be 100644
--- a/sys/arch/alpha/pci/apecs.c
+++ b/sys/arch/alpha/pci/apecs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: apecs.c,v 1.52 2011/05/17 17:34:47 dyoung Exp $ */
+/* $NetBSD: apecs.c,v 1.53 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: apecs.c,v 1.52 2011/05/17 17:34:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apecs.c,v 1.53 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -178,11 +178,11 @@ apecsattach(device_t parent, device_t self, void *aux)
apecs_dma_init(acp);
- printf(": DECchip %s Core Logic chipset\n",
+ aprint_normal(": DECchip %s Core Logic chipset\n",
acp->ac_memwidth == 128 ? "21072" : "21071");
- printf("%s: DC21071-CA pass %d, %d-bit memory bus\n",
- self->dv_xname, acp->ac_comanche_pass2 ? 2 : 1, acp->ac_memwidth);
- printf("%s: DC21071-DA pass %d\n", self->dv_xname,
+ aprint_normal_dev(self, "DC21071-CA pass %d, %d-bit memory bus\n",
+ acp->ac_comanche_pass2 ? 2 : 1, acp->ac_memwidth);
+ aprint_normal_dev(self, "DC21071-DA pass %d\n",
acp->ac_epic_pass2 ? 2 : 1);
/* XXX print bcache size */
diff --git a/sys/arch/alpha/pci/apecs_pci.c b/sys/arch/alpha/pci/apecs_pci.c
index a68f0a4c12c..be4fbed6d4b 100644
--- a/sys/arch/alpha/pci/apecs_pci.c
+++ b/sys/arch/alpha/pci/apecs_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: apecs_pci.c,v 1.23 2010/12/15 01:27:18 matt Exp $ */
+/* $NetBSD: apecs_pci.c,v 1.24 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: apecs_pci.c,v 1.23 2010/12/15 01:27:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apecs_pci.c,v 1.24 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -41,12 +41,11 @@ __KERNEL_RCSID(0, "$NetBSD: apecs_pci.c,v 1.23 2010/12/15 01:27:18 matt Exp $");
#include <alpha/pci/apecsreg.h>
#include <alpha/pci/apecsvar.h>
-void apecs_attach_hook(struct device *, struct device *,
+void apecs_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int apecs_bus_maxdevs(void *, int);
pcitag_t apecs_make_tag(void *, int, int, int);
-void apecs_decompose_tag(void *, pcitag_t, int *, int *,
- int *);
+void apecs_decompose_tag(void *, pcitag_t, int *, int *, int *);
pcireg_t apecs_conf_read(void *, pcitag_t, int);
void apecs_conf_write(void *, pcitag_t, int, pcireg_t);
@@ -64,7 +63,7 @@ apecs_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-apecs_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba)
+apecs_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/pci/cia.c b/sys/arch/alpha/pci/cia.c
index af3643a1876..b7d8862892a 100644
--- a/sys/arch/alpha/pci/cia.c
+++ b/sys/arch/alpha/pci/cia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cia.c,v 1.71 2011/05/17 17:34:47 dyoung Exp $ */
+/* $NetBSD: cia.c,v 1.72 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.71 2011/05/17 17:34:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.72 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -102,16 +102,15 @@ __KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.71 2011/05/17 17:34:47 dyoung Exp $");
#include <alpha/pci/pci_1000.h>
#endif
-int ciamatch(struct device *, struct cfdata *, void *);
-void ciaattach(struct device *, struct device *, void *);
+int ciamatch(device_t, cfdata_t, void *);
+void ciaattach(device_t, device_t, void *);
-CFATTACH_DECL(cia, sizeof(struct cia_softc),
+CFATTACH_DECL_NEW(cia, sizeof(struct cia_softc),
ciamatch, ciaattach, NULL, NULL);
extern struct cfdriver cia_cd;
-int cia_bus_get_window(int, int,
- struct alpha_bus_space_translation *);
+int cia_bus_get_window(int, int, struct alpha_bus_space_translation *);
/* There can be only one. */
int ciafound;
@@ -149,7 +148,7 @@ int cia_bus_use_bwx = CIA_BUS_USE_BWX;
int cia_pyxis_force_bwx = CIA_PYXIS_FORCE_BWX;
int
-ciamatch(struct device *parent, struct cfdata *match, void *aux)
+ciamatch(device_t parent, cfdata_t match, void *aux)
{
struct mainbus_attach_args *ma = aux;
@@ -262,9 +261,9 @@ cia_init(struct cia_config *ccp, int mallocsafe)
}
void
-ciaattach(struct device *parent, struct device *self, void *aux)
+ciaattach(device_t parent, device_t self, void *aux)
{
- struct cia_softc *sc = (struct cia_softc *)self;
+ struct cia_softc *sc = device_private(self);
struct cia_config *ccp;
struct pcibus_attach_args pba;
char bits[64];
@@ -273,6 +272,7 @@ ciaattach(struct device *parent, struct device *self, void *aux)
/* note that we've attached the chipset; can't have 2 CIAs. */
ciafound = 1;
+ sc->sc_dev = self;
/*
* set up the chipset's info; done once at console init time
@@ -290,11 +290,11 @@ ciaattach(struct device *parent, struct device *self, void *aux)
pass = ccp->cc_rev + 1;
}
- printf(": DECchip 2117x Core Logic Chipset (%s), pass %d\n",
+ aprint_normal(": DECchip 2117x Core Logic Chipset (%s), pass %d\n",
name, pass);
if (ccp->cc_cnfg) {
snprintb(bits, sizeof(bits), CIA_CSR_CNFG_BITS, ccp->cc_cnfg);
- printf("%s: extended capabilities: %s\n", self->dv_xname, bits);
+ aprint_normal_dev(self, "extended capabilities: %s\n", bits);
}
switch (ccp->cc_flags & (CCF_PCI_USE_BWX|CCF_BUS_USE_BWX)) {
@@ -312,7 +312,7 @@ ciaattach(struct device *parent, struct device *self, void *aux)
break;
}
if (name != NULL)
- printf("%s: using BWX for %s access\n", self->dv_xname, name);
+ aprint_normal_dev(self, "using BWX for %s access\n", name);
#ifdef DEC_550
if (cputype == ST_DEC_550 &&
@@ -340,8 +340,8 @@ ciaattach(struct device *parent, struct device *self, void *aux)
u_int32_t ctrl;
/* XXX no bets... */
- printf("%s: WARNING: Pyxis pass 1 DMA bug; no bets...\n",
- self->dv_xname);
+ aprint_error_dev(self,
+ "WARNING: Pyxis pass 1 DMA bug; no bets...\n");
ccp->cc_flags |= CCF_PYXISBUG;
diff --git a/sys/arch/alpha/pci/cia_pci.c b/sys/arch/alpha/pci/cia_pci.c
index 9ddeabf7108..5c82f775ec9 100644
--- a/sys/arch/alpha/pci/cia_pci.c
+++ b/sys/arch/alpha/pci/cia_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cia_pci.c,v 1.30 2010/12/15 01:27:18 matt Exp $ */
+/* $NetBSD: cia_pci.c,v 1.31 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cia_pci.c,v 1.30 2010/12/15 01:27:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cia_pci.c,v 1.31 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -41,12 +41,11 @@ __KERNEL_RCSID(0, "$NetBSD: cia_pci.c,v 1.30 2010/12/15 01:27:18 matt Exp $");
#include <alpha/pci/ciareg.h>
#include <alpha/pci/ciavar.h>
-void cia_attach_hook(struct device *, struct device *,
+void cia_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int cia_bus_maxdevs(void *, int);
pcitag_t cia_make_tag(void *, int, int, int);
-void cia_decompose_tag(void *, pcitag_t, int *, int *,
- int *);
+void cia_decompose_tag(void *, pcitag_t, int *, int *, int *);
pcireg_t cia_conf_read(void *, pcitag_t, int);
void cia_conf_write(void *, pcitag_t, int, pcireg_t);
@@ -64,7 +63,7 @@ cia_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-cia_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba)
+cia_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/pci/ciavar.h b/sys/arch/alpha/pci/ciavar.h
index 9652b33baf3..1d78d266359 100644
--- a/sys/arch/alpha/pci/ciavar.h
+++ b/sys/arch/alpha/pci/ciavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ciavar.h,v 1.18 2009/03/14 14:45:53 dsl Exp $ */
+/* $NetBSD: ciavar.h,v 1.19 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -66,7 +66,7 @@ struct cia_config {
};
struct cia_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct cia_config *sc_ccp;
};
diff --git a/sys/arch/alpha/pci/dwlpx.c b/sys/arch/alpha/pci/dwlpx.c
index 4624ea9c082..c699bbd5fdb 100644
--- a/sys/arch/alpha/pci/dwlpx.c
+++ b/sys/arch/alpha/pci/dwlpx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dwlpx.c,v 1.36 2011/05/17 17:34:47 dyoung Exp $ */
+/* $NetBSD: dwlpx.c,v 1.37 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.36 2011/05/17 17:34:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.37 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -62,9 +62,10 @@ __KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.36 2011/05/17 17:34:47 dyoung Exp $");
(1LL << 39))
-static int dwlpxmatch(struct device *, struct cfdata *, void *);
-static void dwlpxattach(struct device *, struct device *, void *);
-CFATTACH_DECL(dwlpx, sizeof(struct dwlpx_softc),
+static int dwlpxmatch(device_t, cfdata_t, void *);
+static void dwlpxattach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(dwlpx, sizeof(struct dwlpx_softc),
dwlpxmatch, dwlpxattach, NULL, NULL);
extern struct cfdriver dwlpx_cd;
@@ -72,7 +73,7 @@ extern struct cfdriver dwlpx_cd;
void dwlpx_errintr(void *, u_long vec);
static int
-dwlpxmatch(struct device *parent, struct cfdata *cf, void *aux)
+dwlpxmatch(device_t parent, cfdata_t cf, void *aux)
{
struct kft_dev_attach_args *ka = aux;
unsigned long ls;
@@ -102,15 +103,16 @@ dwlpxmatch(struct device *parent, struct cfdata *cf, void *aux)
}
static void
-dwlpxattach(struct device *parent, struct device *self, void *aux)
+dwlpxattach(device_t parent, device_t self, void *aux)
{
static int once = 0;
- struct dwlpx_softc *sc = (struct dwlpx_softc *)self;
+ struct dwlpx_softc *sc = device_private(self);
struct dwlpx_config *ccp = &sc->dwlpx_cc;
struct kft_dev_attach_args *ka = aux;
struct pcibus_attach_args pba;
u_int32_t pcia_present;
+ sc->dwlpx_dev = self;
sc->dwlpx_node = ka->ka_node;
sc->dwlpx_dtype = ka->ka_dtype;
sc->dwlpx_hosenum = ka->ka_hosenum;
@@ -119,7 +121,7 @@ dwlpxattach(struct device *parent, struct device *self, void *aux)
dwlpx_dma_init(ccp);
pcia_present = REGVAL(PCIA_PRESENT + ccp->cc_sysbase);
- printf(": PCIA rev. %d, STD I/O %spresent, %dK S/G entries\n",
+ aprint_normal(": PCIA rev. %d, STD I/O %spresent, %dK S/G entries\n",
(pcia_present >> PCIA_PRESENT_REVSHIFT) & PCIA_PRESENT_REVMASK,
(pcia_present & PCIA_PRESENT_STDIO) == 0 ? "not " : "",
sc->dwlpx_sgmapsz == DWLPX_SG128K ? 128 : 32);
@@ -147,8 +149,9 @@ dwlpxattach(struct device *parent, struct device *self, void *aux)
str = "7.5";
break;
}
- printf("%s: hpc %d slot %d: %s watt module\n",
- sc->dwlpx_dev.dv_xname, hpc, slot, str);
+ aprint_normal_dev(sc->dwlpx_dev,
+ "hpc %d slot %d: %s watt module\n",
+ hpc, slot, str);
}
}
}
@@ -251,9 +254,9 @@ dwlpx_init(struct dwlpx_softc *sc)
vec = scb_alloc(dwlpx_errintr, sc);
if (vec == SCB_ALLOC_FAILED)
panic("%s: unable to allocate error vector",
- sc->dwlpx_dev.dv_xname);
- printf("%s: error interrupt at vector 0x%lx\n",
- sc->dwlpx_dev.dv_xname, vec);
+ device_xname(sc->dwlpx_dev));
+ aprint_normal_dev(sc->dwlpx_dev, "error interrupt at vector 0x%lx\n",
+ vec);
for (i = 0; i < NHPC; i++) {
REGVAL(PCIA_IMASK(i) + ccp->cc_sysbase) = DWLPX_IMASK_DFLT;
REGVAL(PCIA_ERRVEC(i) + ccp->cc_sysbase) = vec;
@@ -315,52 +318,52 @@ dwlpx_errintr(void *arg, unsigned long vec)
hpcs[i].err = REGVAL(PCIA_ERR(i) + ccp->cc_sysbase);
hpcs[i].addr = REGVAL(PCIA_FADR(i) + ccp->cc_sysbase);
}
- printf("%s: node %d hose %d error interrupt\n",
- sc->dwlpx_dev.dv_xname, sc->dwlpx_node, sc->dwlpx_hosenum);
+ aprint_error_dev(sc->dwlpx_dev, "node %d hose %d error interrupt\n",
+ sc->dwlpx_node, sc->dwlpx_hosenum);
for (i = 0; i < sc->dwlpx_nhpc; i++) {
if ((hpcs[i].err & PCIA_ERR_ERROR) == 0)
continue;
- printf("\tHPC %d: ERR=0x%08x; DMA %s Memory, "
+ aprint_error("\tHPC %d: ERR=0x%08x; DMA %s Memory, "
"Failing Address 0x%x\n",
i, hpcs[i].err, hpcs[i].addr & 0x1? "write to" :
"read from", hpcs[i].addr & ~3);
if (hpcs[i].err & PCIA_ERR_SERR_L)
- printf("\t PCI device asserted SERR_L\n");
+ aprint_error("\t PCI device asserted SERR_L\n");
if (hpcs[i].err & PCIA_ERR_ILAT)
- printf("\t Incremental Latency Exceeded\n");
+ aprint_error("\t Incremental Latency Exceeded\n");
if (hpcs[i].err & PCIA_ERR_SGPRTY)
- printf("\t CPU access of SG RAM Parity Error\n");
+ aprint_error("\t CPU access of SG RAM Parity Error\n");
if (hpcs[i].err & PCIA_ERR_ILLCSR)
- printf("\t Illegal CSR Address Error\n");
+ aprint_error("\t Illegal CSR Address Error\n");
if (hpcs[i].err & PCIA_ERR_PCINXM)
- printf("\t Nonexistent PCI Address Error\n");
+ aprint_error("\t Nonexistent PCI Address Error\n");
if (hpcs[i].err & PCIA_ERR_DSCERR)
- printf("\t PCI Target Disconnect Error\n");
+ aprint_error("\t PCI Target Disconnect Error\n");
if (hpcs[i].err & PCIA_ERR_ABRT)
- printf("\t PCI Target Abort Error\n");
+ aprint_error("\t PCI Target Abort Error\n");
if (hpcs[i].err & PCIA_ERR_WPRTY)
- printf("\t PCI Write Parity Error\n");
+ aprint_error("\t PCI Write Parity Error\n");
if (hpcs[i].err & PCIA_ERR_DPERR)
- printf("\t PCI Data Parity Error\n");
+ aprint_error("\t PCI Data Parity Error\n");
if (hpcs[i].err & PCIA_ERR_APERR)
- printf("\t PCI Address Parity Error\n");
+ aprint_error("\t PCI Address Parity Error\n");
if (hpcs[i].err & PCIA_ERR_DFLT)
- printf("\t SG Map RAM Invalid Entry Error\n");
+ aprint_error("\t SG Map RAM Invalid Entry Error\n");
if (hpcs[i].err & PCIA_ERR_DPRTY)
- printf("\t DMA access of SG RAM Parity Error\n");
+ aprint_error("\t DMA access of SG RAM Parity Error\n");
if (hpcs[i].err & PCIA_ERR_DRPERR)
- printf("\t DMA Read Return Parity Error\n");
+ aprint_error("\t DMA Read Return Parity Error\n");
if (hpcs[i].err & PCIA_ERR_MABRT)
- printf("\t PCI Master Abort Error\n");
+ aprint_error("\t PCI Master Abort Error\n");
if (hpcs[i].err & PCIA_ERR_CPRTY)
- printf("\t CSR Parity Error\n");
+ aprint_error("\t CSR Parity Error\n");
if (hpcs[i].err & PCIA_ERR_COVR)
- printf("\t CSR Overrun Error\n");
+ aprint_error("\t CSR Overrun Error\n");
if (hpcs[i].err & PCIA_ERR_MBPERR)
- printf("\t Mailbox Parity Error\n");
+ aprint_error("\t Mailbox Parity Error\n");
if (hpcs[i].err & PCIA_ERR_MBILI)
- printf("\t Mailbox Illegal Length Error\n");
+ aprint_error("\t Mailbox Illegal Length Error\n");
REGVAL(PCIA_ERR(i) + ccp->cc_sysbase) = hpcs[i].err;
}
}
diff --git a/sys/arch/alpha/pci/dwlpx_dma.c b/sys/arch/alpha/pci/dwlpx_dma.c
index 879696b98d5..03a9bf21685 100644
--- a/sys/arch/alpha/pci/dwlpx_dma.c
+++ b/sys/arch/alpha/pci/dwlpx_dma.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dwlpx_dma.c,v 1.20 2010/12/15 01:27:18 matt Exp $ */
+/* $NetBSD: dwlpx_dma.c,v 1.21 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dwlpx_dma.c,v 1.20 2010/12/15 01:27:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwlpx_dma.c,v 1.21 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -212,7 +212,7 @@ dwlpx_dma_init(struct dwlpx_config *ccp)
exname = malloc(16, M_DEVBUF, M_NOWAIT);
if (exname == NULL)
panic("dwlpx_dma_init");
- sprintf(exname, "%s_sgmap_a", ccp->cc_sc->dwlpx_dev.dv_xname);
+ sprintf(exname, "%s_sgmap_a", device_xname(ccp->cc_sc->dwlpx_dev));
alpha_sgmap_init(t, &ccp->cc_sgmap, exname, DWLPx_SG_MAPPED_BASE,
0, DWLPx_SG_MAPPED_SIZE(lim), sizeof(u_int32_t),
(void *)page_table, 0);
diff --git a/sys/arch/alpha/pci/dwlpx_pci.c b/sys/arch/alpha/pci/dwlpx_pci.c
index f302d11da42..9a41d2104c0 100644
--- a/sys/arch/alpha/pci/dwlpx_pci.c
+++ b/sys/arch/alpha/pci/dwlpx_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dwlpx_pci.c,v 1.16 2010/12/15 01:27:18 matt Exp $ */
+/* $NetBSD: dwlpx_pci.c,v 1.17 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dwlpx_pci.c,v 1.16 2010/12/15 01:27:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwlpx_pci.c,v 1.17 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -47,7 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: dwlpx_pci.c,v 1.16 2010/12/15 01:27:18 matt Exp $");
#define KV(_addr) ((void *)ALPHA_PHYS_TO_K0SEG((_addr)))
-void dwlpx_attach_hook(struct device *, struct device *,
+void dwlpx_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int dwlpx_bus_maxdevs(void *, int);
pcitag_t dwlpx_make_tag(void *, int, int, int);
@@ -69,11 +69,11 @@ dwlpx_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-dwlpx_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba)
+dwlpx_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
{
#if 0
struct dwlpx_config *ccp = pba->pba_pc->pc_conf_v;
- printf("dwlpx_attach_hook for %s\n", ccp->cc_sc->dwlpx_dev.dv_xname);
+ printf("dwlpx_attach_hook for %s\n", device_xname(ccp->cc_sc->dwlpx_dev));
#endif
}
diff --git a/sys/arch/alpha/pci/dwlpxvar.h b/sys/arch/alpha/pci/dwlpxvar.h
index 9bb9840cece..5af87d0f680 100644
--- a/sys/arch/alpha/pci/dwlpxvar.h
+++ b/sys/arch/alpha/pci/dwlpxvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dwlpxvar.h,v 1.9 2009/03/14 14:45:53 dsl Exp $ */
+/* $NetBSD: dwlpxvar.h,v 1.10 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -59,7 +59,7 @@ struct dwlpx_config {
};
struct dwlpx_softc {
- struct device dwlpx_dev;
+ device_t dwlpx_dev;
struct dwlpx_config dwlpx_cc; /* config info */
u_int16_t dwlpx_dtype; /* Node Type */
u_int8_t dwlpx_node; /* TurboLaser Node */
diff --git a/sys/arch/alpha/pci/irongate.c b/sys/arch/alpha/pci/irongate.c
index 1557529f07e..32d67bdcbd9 100644
--- a/sys/arch/alpha/pci/irongate.c
+++ b/sys/arch/alpha/pci/irongate.c
@@ -1,4 +1,4 @@
-/* $NetBSD: irongate.c,v 1.15 2011/05/17 17:34:47 dyoung Exp $ */
+/* $NetBSD: irongate.c,v 1.16 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irongate.c,v 1.15 2011/05/17 17:34:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irongate.c,v 1.16 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,10 +57,10 @@ __KERNEL_RCSID(0, "$NetBSD: irongate.c,v 1.15 2011/05/17 17:34:47 dyoung Exp $")
#include <alpha/pci/pci_up1000.h>
#endif
-int irongate_match(struct device *, struct cfdata *, void *);
-void irongate_attach(struct device *, struct device *, void *);
+int irongate_match(device_t, cfdata_t, void *);
+void irongate_attach(device_t, device_t, void *);
-CFATTACH_DECL(irongate, sizeof(struct irongate_softc),
+CFATTACH_DECL_NEW(irongate, sizeof(struct irongate_softc),
irongate_match, irongate_attach, NULL, NULL);
extern struct cfdriver irongate_cd;
@@ -69,8 +69,7 @@ extern struct cfdriver irongate_cd;
struct irongate_config irongate_configuration;
int irongate_found;
-int irongate_bus_get_window(int, int,
- struct alpha_bus_space_translation *);
+int irongate_bus_get_window(int, int, struct alpha_bus_space_translation *);
/*
* Set up the chipset's function pointers.
@@ -112,7 +111,7 @@ irongate_init(struct irongate_config *icp, int mallocsafe)
}
int
-irongate_match(struct device *parent, struct cfdata *match, void *aux)
+irongate_match(device_t parent, cfdata_t match, void *aux)
{
struct mainbus_attach_args *ma = aux;
@@ -127,9 +126,9 @@ irongate_match(struct device *parent, struct cfdata *match, void *aux)
}
void
-irongate_attach(struct device *parent, struct device *self, void *aux)
+irongate_attach(device_t parent, device_t self, void *aux)
{
- struct irongate_softc *sc = (void *) self;
+ struct irongate_softc *sc = device_private(self);
struct irongate_config *icp;
struct pcibus_attach_args pba;
struct agpbus_attach_args apa;
@@ -137,6 +136,7 @@ irongate_attach(struct device *parent, struct device *self, void *aux)
/* Note that we've attached the chipset; can't have 2 Irongates. */
irongate_found = 1;
+ sc->sc_dev = self;
/*
* Set up the chipset's info; done once at console init time
diff --git a/sys/arch/alpha/pci/irongate_pci.c b/sys/arch/alpha/pci/irongate_pci.c
index a17c8d390d9..a2bf23bc616 100644
--- a/sys/arch/alpha/pci/irongate_pci.c
+++ b/sys/arch/alpha/pci/irongate_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: irongate_pci.c,v 1.7 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: irongate_pci.c,v 1.8 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: irongate_pci.c,v 1.7 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irongate_pci.c,v 1.8 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: irongate_pci.c,v 1.7 2010/12/15 01:27:19 matt Exp $"
#include <alpha/pci/irongatereg.h>
#include <alpha/pci/irongatevar.h>
-void irongate_attach_hook(struct device *, struct device *,
+void irongate_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int irongate_bus_maxdevs(void *, int);
pcitag_t irongate_make_tag(void *, int, int, int);
@@ -80,7 +80,7 @@ irongate_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-irongate_attach_hook(struct device *parent, struct device *self,
+irongate_attach_hook(device_t parent, device_t self,
struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/pci/irongatevar.h b/sys/arch/alpha/pci/irongatevar.h
index 537f2f7b6fb..74f092103b5 100644
--- a/sys/arch/alpha/pci/irongatevar.h
+++ b/sys/arch/alpha/pci/irongatevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: irongatevar.h,v 1.4 2008/04/28 20:23:11 martin Exp $ */
+/* $NetBSD: irongatevar.h,v 1.5 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@ struct irongate_config {
};
struct irongate_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct irongate_config *sc_icp;
};
diff --git a/sys/arch/alpha/pci/lca.c b/sys/arch/alpha/pci/lca.c
index 02e96b15b75..e7ebb17dd5c 100644
--- a/sys/arch/alpha/pci/lca.c
+++ b/sys/arch/alpha/pci/lca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lca.c,v 1.49 2011/05/17 17:34:47 dyoung Exp $ */
+/* $NetBSD: lca.c,v 1.50 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.49 2011/05/17 17:34:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.50 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -91,10 +91,10 @@ __KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.49 2011/05/17 17:34:47 dyoung Exp $");
#include <alpha/pci/pci_eb66.h>
#endif
-int lcamatch(struct device *, struct cfdata *, void *);
-void lcaattach(struct device *, struct device *, void *);
+int lcamatch(device_t, cfdata_t, void *);
+void lcaattach(device_t, device_t, void *);
-CFATTACH_DECL(lca, sizeof(struct lca_softc),
+CFATTACH_DECL_NEW(lca, sizeof(struct lca_softc),
lcamatch, lcaattach, NULL, NULL);
extern struct cfdriver lca_cd;
@@ -107,7 +107,7 @@ int lcafound;
struct lca_config lca_configuration;
int
-lcamatch(struct device *parent, struct cfdata *match, void *aux)
+lcamatch(device_t parent, cfdata_t match, void *aux)
{
struct mainbus_attach_args *ma = aux;
@@ -182,15 +182,16 @@ lca_init(struct lca_config *lcp, int mallocsafe)
}
void
-lcaattach(struct device *parent, struct device *self, void *aux)
+lcaattach(device_t parent, device_t self, void *aux)
{
- struct lca_softc *sc = (struct lca_softc *)self;
+ struct lca_softc *sc = device_private(self);
struct lca_config *lcp;
struct pcibus_attach_args pba;
/* note that we've attached the chipset; can't have 2 LCAs. */
/* Um, not sure about this. XXX JH */
lcafound = 1;
+ sc->sc_dev = self;
/*
* set up the chipset's info; done once at console init time
@@ -201,7 +202,7 @@ lcaattach(struct device *parent, struct device *self, void *aux)
lca_init(lcp, 1);
/* XXX print chipset information */
- printf("\n");
+ aprint_normal("\n");
lca_dma_init(lcp);
diff --git a/sys/arch/alpha/pci/lca_pci.c b/sys/arch/alpha/pci/lca_pci.c
index f25631dde67..88338954552 100644
--- a/sys/arch/alpha/pci/lca_pci.c
+++ b/sys/arch/alpha/pci/lca_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lca_pci.c,v 1.19 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: lca_pci.c,v 1.20 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: lca_pci.c,v 1.19 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lca_pci.c,v 1.20 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -41,12 +41,11 @@ __KERNEL_RCSID(0, "$NetBSD: lca_pci.c,v 1.19 2010/12/15 01:27:19 matt Exp $");
#include <alpha/pci/lcareg.h>
#include <alpha/pci/lcavar.h>
-void lca_attach_hook(struct device *, struct device *,
+void lca_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int lca_bus_maxdevs(void *, int);
pcitag_t lca_make_tag(void *, int, int, int);
-void lca_decompose_tag(void *, pcitag_t, int *, int *,
- int *);
+void lca_decompose_tag(void *, pcitag_t, int *, int *, int *);
pcireg_t lca_conf_read(void *, pcitag_t, int);
void lca_conf_write(void *, pcitag_t, int, pcireg_t);
@@ -64,7 +63,7 @@ lca_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-lca_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba)
+lca_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/pci/lcavar.h b/sys/arch/alpha/pci/lcavar.h
index 90f51fa6406..29a062eae8c 100644
--- a/sys/arch/alpha/pci/lcavar.h
+++ b/sys/arch/alpha/pci/lcavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lcavar.h,v 1.9 2009/03/14 14:45:53 dsl Exp $ */
+/* $NetBSD: lcavar.h,v 1.10 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -55,7 +55,7 @@ struct lca_config {
};
struct lca_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct lca_config *sc_lcp;
};
diff --git a/sys/arch/alpha/pci/mcpcia.c b/sys/arch/alpha/pci/mcpcia.c
index 25cf8f7927e..574df90a2ff 100644
--- a/sys/arch/alpha/pci/mcpcia.c
+++ b/sys/arch/alpha/pci/mcpcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mcpcia.c,v 1.27 2011/05/17 17:34:47 dyoung Exp $ */
+/* $NetBSD: mcpcia.c,v 1.28 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.27 2011/05/17 17:34:47 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.28 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -96,9 +96,10 @@ __KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.27 2011/05/17 17:34:47 dyoung Exp $");
(MCBUS_IOSPACE) | MCPCIA_PCI_BRIDGE | _MCPCIA_PCI_REV)), \
sizeof(u_int32_t))
-static int mcpciamatch(struct device *, struct cfdata *, void *);
-static void mcpciaattach(struct device *, struct device *, void *);
-CFATTACH_DECL(mcpcia, sizeof(struct mcpcia_softc),
+static int mcpciamatch(device_t, cfdata_t, void *);
+static void mcpciaattach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(mcpcia, sizeof(struct mcpcia_softc),
mcpciamatch, mcpciaattach, NULL, NULL);
void mcpcia_init0(struct mcpcia_config *, int);
@@ -114,7 +115,7 @@ int mcpcia_bus_get_window(int, int,
struct alpha_bus_space_translation *abst);
static int
-mcpciamatch(struct device *parent, struct cfdata *cf, void *aux)
+mcpciamatch(device_t parent, cfdata_t cf, void *aux)
{
struct mcbus_dev_attach_args *ma = aux;
if (ma->ma_type == MCBUS_TYPE_PCI)
@@ -123,11 +124,11 @@ mcpciamatch(struct device *parent, struct cfdata *cf, void *aux)
}
static void
-mcpciaattach(struct device *parent, struct device *self, void *aux)
+mcpciaattach(device_t parent, device_t self, void *aux)
{
static int first = 1;
struct mcbus_dev_attach_args *ma = aux;
- struct mcpcia_softc *mcp = (struct mcpcia_softc *)self;
+ struct mcpcia_softc *mcp = device_private(self);
struct mcpcia_config *ccp;
struct pcibus_attach_args pba;
u_int32_t ctl;
@@ -156,6 +157,7 @@ mcpciaattach(struct device *parent, struct device *self, void *aux)
ccp->cc_gid = ma->ma_gid;
}
+ mcp->mcpcia_dev = self;
mcp->mcpcia_cc = ccp;
ccp->cc_sc = mcp;
@@ -163,8 +165,9 @@ mcpciaattach(struct device *parent, struct device *self, void *aux)
mcpcia_init0(ccp, 1);
ctl = REGVAL(MCPCIA_PCI_REV(ccp));
- printf("%s: Horse Revision %d, %s Handed Saddle Revision %d,"
- " CAP Revision %d\n", mcp->mcpcia_dev.dv_xname, HORSE_REV(ctl),
+ aprint_normal_dev(self,
+ "Horse Revision %d, %s Handed Saddle Revision %d,"
+ " CAP Revision %d\n", HORSE_REV(ctl),
(SADDLE_TYPE(ctl) & 1)? "Right": "Left", SADDLE_REV(ctl),
CAP_REV(ctl));
diff --git a/sys/arch/alpha/pci/mcpcia_pci.c b/sys/arch/alpha/pci/mcpcia_pci.c
index 286efe62525..4714caea384 100644
--- a/sys/arch/alpha/pci/mcpcia_pci.c
+++ b/sys/arch/alpha/pci/mcpcia_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mcpcia_pci.c,v 1.9 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: mcpcia_pci.c,v 1.10 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1998 by Matthew Jacob
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.9 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.10 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -46,7 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.9 2010/12/15 01:27:19 matt Exp $");
#define KV(_addr) ((void *)ALPHA_PHYS_TO_K0SEG((_addr)))
-static void mcpcia_attach_hook(struct device *, struct device *,
+static void mcpcia_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
static int
mcpcia_bus_maxdevs(void *, int);
@@ -72,7 +72,7 @@ mcpcia_pci_init(pci_chipset_tag_t pc, void *v)
}
static void
-mcpcia_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba)
+mcpcia_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/pci/mcpciavar.h b/sys/arch/alpha/pci/mcpciavar.h
index aae36ce083b..aac91e0a0c7 100644
--- a/sys/arch/alpha/pci/mcpciavar.h
+++ b/sys/arch/alpha/pci/mcpciavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mcpciavar.h,v 1.5 2009/03/14 14:45:53 dsl Exp $ */
+/* $NetBSD: mcpciavar.h,v 1.6 2011/06/14 15:34:22 matt Exp $ */
/*
* Copyright (c) 1998 by Matthew Jacob
@@ -64,7 +64,7 @@ struct mcpcia_config {
};
struct mcpcia_softc {
- struct device mcpcia_dev;
+ device_t mcpcia_dev;
struct mcpcia_config *mcpcia_cc; /* config info */
};
diff --git a/sys/arch/alpha/pci/pci_550.c b/sys/arch/alpha/pci/pci_550.c
index 103ce2a9b8d..907ef8add96 100644
--- a/sys/arch/alpha/pci/pci_550.c
+++ b/sys/arch/alpha/pci/pci_550.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_550.c,v 1.34 2011/04/04 20:37:44 dyoung Exp $ */
+/* $NetBSD: pci_550.c,v 1.35 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_550.c,v 1.34 2011/04/04 20:37:44 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_550.c,v 1.35 2011/06/14 15:34:22 matt Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -96,7 +96,7 @@ void *dec_550_intr_establish(void *, pci_intr_handle_t,
int, int (*func)(void *), void *);
void dec_550_intr_disestablish(void *, void *);
-void *dec_550_pciide_compat_intr_establish(void *, struct device *,
+void *dec_550_pciide_compat_intr_establish(void *, device_t,
const struct pci_attach_args *, int, int (*)(void *), void *);
#define DEC_550_PCI_IRQ_BEGIN 8
@@ -350,7 +350,7 @@ dec_550_intr_disestablish(void *ccv, void *cookie)
}
void *
-dec_550_pciide_compat_intr_establish(void *v, struct device *dev,
+dec_550_pciide_compat_intr_establish(void *v, device_t dev,
const struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
{
pci_chipset_tag_t pc = pa->pa_pc;
@@ -371,7 +371,7 @@ dec_550_pciide_compat_intr_establish(void *v, struct device *dev,
func, arg);
if (cookie == NULL)
return (NULL);
- printf("%s: %s channel interrupting at %s\n", dev->dv_xname,
+ aprint_normal_dev(dev, "%s channel interrupting at %s\n",
PCIIDE_CHANNEL_NAME(chan), sio_intr_string(NULL /*XXX*/, irq));
#endif
return (cookie);
diff --git a/sys/arch/alpha/pci/pci_6600.c b/sys/arch/alpha/pci/pci_6600.c
index d635b9e5ae5..a702d8e40e2 100644
--- a/sys/arch/alpha/pci/pci_6600.c
+++ b/sys/arch/alpha/pci/pci_6600.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_6600.c,v 1.21 2011/04/04 20:37:44 dyoung Exp $ */
+/* $NetBSD: pci_6600.c,v 1.22 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1999 by Ross Harvey. All rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_6600.c,v 1.21 2011/04/04 20:37:44 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_6600.c,v 1.22 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -84,7 +84,7 @@ void *dec_6600_intr_establish(
const char *dec_6600_intr_string(void *, pci_intr_handle_t);
const struct evcnt *dec_6600_intr_evcnt(void *, pci_intr_handle_t);
int dec_6600_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
-void *dec_6600_pciide_compat_intr_establish(void *, struct device *,
+void *dec_6600_pciide_compat_intr_establish(void *, device_t,
const struct pci_attach_args *, int, int (*)(void *), void *);
struct alpha_shared_intr *dec_6600_pci_intr;
@@ -307,7 +307,7 @@ dec_6600_intr_disable(int irq)
}
void *
-dec_6600_pciide_compat_intr_establish(void *v, struct device *dev,
+dec_6600_pciide_compat_intr_establish(void *v, device_t dev,
const struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
{
pci_chipset_tag_t pc = pa->pa_pc;
@@ -329,7 +329,7 @@ dec_6600_pciide_compat_intr_establish(void *v, struct device *dev,
func, arg);
if (cookie == NULL)
return (NULL);
- printf("%s: %s channel interrupting at %s\n", dev->dv_xname,
+ aprint_normal_dev(dev, "%s channel interrupting at %s\n",
PCIIDE_CHANNEL_NAME(chan), sio_intr_string(NULL /*XXX*/, irq));
#endif
return (cookie);
diff --git a/sys/arch/alpha/pci/pci_eb164.c b/sys/arch/alpha/pci/pci_eb164.c
index e73a7af87fe..fcabc2e1a58 100644
--- a/sys/arch/alpha/pci/pci_eb164.c
+++ b/sys/arch/alpha/pci/pci_eb164.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_eb164.c,v 1.42 2011/04/04 20:37:44 dyoung Exp $ */
+/* $NetBSD: pci_eb164.c,v 1.43 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_eb164.c,v 1.42 2011/04/04 20:37:44 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_eb164.c,v 1.43 2011/06/14 15:34:22 matt Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -326,7 +326,7 @@ dec_eb164_pciide_compat_intr_establish(void *v, device_t dev,
func, arg);
if (cookie == NULL)
return (NULL);
- printf("%s: %s channel interrupting at %s\n", dev->dv_xname,
+ aprint_normal_dev(dev, "%s channel interrupting at %s\n",
PCIIDE_CHANNEL_NAME(chan), sio_intr_string(NULL /*XXX*/, irq));
#endif
return (cookie);
diff --git a/sys/arch/alpha/pci/pci_up1000.c b/sys/arch/alpha/pci/pci_up1000.c
index 5ba1acc8d07..9739aa2777a 100644
--- a/sys/arch/alpha/pci/pci_up1000.c
+++ b/sys/arch/alpha/pci/pci_up1000.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_up1000.c,v 1.12 2011/04/04 20:37:45 dyoung Exp $ */
+/* $NetBSD: pci_up1000.c,v 1.13 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pci_up1000.c,v 1.12 2011/04/04 20:37:45 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_up1000.c,v 1.13 2011/06/14 15:34:22 matt Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -203,7 +203,7 @@ api_up1000_pciide_compat_intr_establish(void *icv, device_t dev,
func, arg);
if (cookie == NULL)
return (NULL);
- printf("%s: %s channel interrupting at %s\n", dev->dv_xname,
+ aprint_normal_dev(dev, "%s channel interrupting at %s\n",
PCIIDE_CHANNEL_NAME(chan), sio_intr_string(NULL /*XXX*/, irq));
#endif
return (cookie);
diff --git a/sys/arch/alpha/pci/sio.c b/sys/arch/alpha/pci/sio.c
index f423e4d3af5..aa2d1beb39f 100644
--- a/sys/arch/alpha/pci/sio.c
+++ b/sys/arch/alpha/pci/sio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sio.c,v 1.49 2010/01/12 20:24:45 mhitch Exp $ */
+/* $NetBSD: sio.c,v 1.50 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: sio.c,v 1.49 2010/01/12 20:24:45 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sio.c,v 1.50 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,7 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: sio.c,v 1.49 2010/01/12 20:24:45 mhitch Exp $");
#endif
struct sio_softc {
- struct device sc_dv;
+ device_t sc_dev;
pci_chipset_tag_t sc_pc;
@@ -105,16 +105,16 @@ struct sio_softc {
isa_chipset_tag_t sc_ic;
};
-int siomatch(struct device *, struct cfdata *, void *);
-void sioattach(struct device *, struct device *, void *);
+int siomatch(device_t, cfdata_t, void *);
+void sioattach(device_t, device_t, void *);
-CFATTACH_DECL(sio, sizeof(struct sio_softc),
+CFATTACH_DECL_NEW(sio, sizeof(struct sio_softc),
siomatch, sioattach, NULL, NULL);
#if NPCEB > 0
-int pcebmatch(struct device *, struct cfdata *, void *);
+int pcebmatch(device_t, cfdata_t, void *);
-CFATTACH_DECL(pceb, sizeof(struct sio_softc),
+CFATTACH_DECL_NEW(pceb, sizeof(struct sio_softc),
pcebmatch, sioattach, NULL, NULL);
#endif
@@ -123,20 +123,20 @@ union sio_attach_args {
struct eisabus_attach_args sa_eba;
};
-void sio_isa_attach_hook(struct device *, struct device *,
+void sio_isa_attach_hook(device_t, device_t,
struct isabus_attach_args *);
void sio_isa_detach_hook(isa_chipset_tag_t, device_t);
#if NPCEB > 0
-void sio_eisa_attach_hook(struct device *, struct device *,
+void sio_eisa_attach_hook(device_t, device_t,
struct eisabus_attach_args *);
int sio_eisa_maxslots(void *);
int sio_eisa_intr_map(void *, u_int, eisa_intr_handle_t *);
#endif
-void sio_bridge_callback(struct device *);
+void sio_bridge_callback(device_t);
int
-siomatch(struct device *parent, struct cfdata *match, void *aux)
+siomatch(device_t parent, cfdata_t match, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -163,7 +163,7 @@ siomatch(struct device *parent, struct cfdata *match, void *aux)
#if NPCEB > 0
int
-pcebmatch(struct device *parent, struct cfdata *match, void *aux)
+pcebmatch(device_t parent, cfdata_t match, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -176,16 +176,17 @@ pcebmatch(struct device *parent, struct cfdata *match, void *aux)
#endif
void
-sioattach(struct device *parent, struct device *self, void *aux)
+sioattach(device_t parent, device_t self, void *aux)
{
- struct sio_softc *sc = (struct sio_softc *)self;
+ struct sio_softc *sc = device_private(self);
struct pci_attach_args *pa = aux;
char devinfo[256];
pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
- printf(": %s (rev. 0x%02x)\n", devinfo,
+ aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
PCI_REVISION(pa->pa_class));
+ sc->sc_dev = self;
sc->sc_pc = pa->pa_pc;
sc->sc_iot = pa->pa_iot;
sc->sc_memt = pa->pa_memt;
@@ -201,9 +202,9 @@ sioattach(struct device *parent, struct device *self, void *aux)
}
void
-sio_bridge_callback(struct device *self)
+sio_bridge_callback(device_t self)
{
- struct sio_softc *sc = (struct sio_softc *)self;
+ struct sio_softc *sc = device_private(self);
union sio_attach_args sa;
#if NPCEB > 0
struct alpha_eisa_chipset ec;
@@ -237,7 +238,7 @@ sio_bridge_callback(struct device *self)
sa.sa_eba.eba_dmat =
alphabus_dma_get_tag(sc->sc_parent_dmat, ALPHA_BUS_EISA);
sa.sa_eba.eba_ec = &ec;
- config_found_ia(&sc->sc_dv, "eisabus", &sa.sa_eba,
+ config_found_ia(sc->sc_dev, "eisabus", &sa.sa_eba,
eisabusprint);
}
#endif /* NPCEB */
@@ -283,11 +284,11 @@ sio_bridge_callback(struct device *self)
sa.sa_iba.iba_dmat =
alphabus_dma_get_tag(sc->sc_parent_dmat, ALPHA_BUS_ISA);
sa.sa_iba.iba_ic = sc->sc_ic;
- config_found_ia(&sc->sc_dv, "isabus", &sa.sa_iba, isabusprint);
+ config_found_ia(sc->sc_dev, "isabus", &sa.sa_iba, isabusprint);
}
void
-sio_isa_attach_hook(struct device *parent, struct device *self, struct isabus_attach_args *iba)
+sio_isa_attach_hook(device_t parent, device_t self, struct isabus_attach_args *iba)
{
/* Nothing to do. */
@@ -303,7 +304,7 @@ sio_isa_detach_hook(isa_chipset_tag_t ic, device_t self)
#if NPCEB > 0
void
-sio_eisa_attach_hook(struct device *parent, struct device *self, struct eisabus_attach_args *eba)
+sio_eisa_attach_hook(device_t parent, device_t self, struct eisabus_attach_args *eba)
{
#if NEISA > 0
diff --git a/sys/arch/alpha/pci/tsp_pci.c b/sys/arch/alpha/pci/tsp_pci.c
index 48edc19869d..0dbc53c8c6a 100644
--- a/sys/arch/alpha/pci/tsp_pci.c
+++ b/sys/arch/alpha/pci/tsp_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tsp_pci.c,v 1.8 2010/12/15 01:27:19 matt Exp $ */
+/* $NetBSD: tsp_pci.c,v 1.9 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1999 by Ross Harvey. All rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tsp_pci.c,v 1.8 2010/12/15 01:27:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsp_pci.c,v 1.9 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -51,7 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: tsp_pci.c,v 1.8 2010/12/15 01:27:19 matt Exp $");
#define tsp_pci() { Generate ctags(1) key. }
-void tsp_attach_hook(struct device *, struct device *,
+void tsp_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int tsp_bus_maxdevs(void *, int);
pcitag_t tsp_make_tag(void *, int, int, int);
@@ -73,7 +73,7 @@ tsp_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-tsp_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba)
+tsp_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/pci/ttwoga.c b/sys/arch/alpha/pci/ttwoga.c
index 8207e9ab31b..889d1173032 100644
--- a/sys/arch/alpha/pci/ttwoga.c
+++ b/sys/arch/alpha/pci/ttwoga.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ttwoga.c,v 1.13 2011/06/06 17:30:32 matt Exp $ */
+/* $NetBSD: ttwoga.c,v 1.14 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: ttwoga.c,v 1.13 2011/06/06 17:30:32 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttwoga.c,v 1.14 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -230,14 +230,12 @@ ttwopciattach(device_t parent, device_t self, void *aux)
ttwoga_dma_init(tcp);
- if (tcp->tc_rev < TRN_T3)
- printf(": T2 Gate Array rev. %d\n", tcp->tc_rev);
- else
- printf(": T3 or T4 Gate Array rev. %d\n", tcp->tc_rev);
+ aprint_normal(": %s Gate Array rev. %d\n",
+ (tcp->tc_rev < TRN_T3) ? "T2" : "T3 or T4",
+ tcp->tc_rev);
if (tcp->tc_rev < 1)
- printf("%s: WARNING: T2 NOT PASS2... NO BETS...\n",
- self->dv_xname);
+ aprint_normal_dev(self, "WARNING: T2 NOT PASS2... NO BETS...\n");
switch (cputype) {
#if defined(DEC_2100_A500) || defined(DEC_2100A_A500)
diff --git a/sys/arch/alpha/pci/ttwoga_pci.c b/sys/arch/alpha/pci/ttwoga_pci.c
index b66c9158677..c96bb52f63a 100644
--- a/sys/arch/alpha/pci/ttwoga_pci.c
+++ b/sys/arch/alpha/pci/ttwoga_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ttwoga_pci.c,v 1.5 2011/05/24 20:26:35 rmind Exp $ */
+/* $NetBSD: ttwoga_pci.c,v 1.6 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: ttwoga_pci.c,v 1.5 2011/05/24 20:26:35 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttwoga_pci.c,v 1.6 2011/06/14 15:34:22 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: ttwoga_pci.c,v 1.5 2011/05/24 20:26:35 rmind Exp $")
#include <alpha/pci/ttwogareg.h>
#include <alpha/pci/ttwogavar.h>
-void ttwoga_attach_hook(struct device *, struct device *,
+void ttwoga_attach_hook(device_t, device_t,
struct pcibus_attach_args *);
int ttwoga_bus_maxdevs(void *, int);
pcitag_t ttwoga_make_tag(void *, int, int, int);
@@ -96,7 +96,7 @@ ttwoga_pci_init(pci_chipset_tag_t pc, void *v)
}
void
-ttwoga_attach_hook(struct device *parent, struct device *self,
+ttwoga_attach_hook(device_t parent, device_t self,
struct pcibus_attach_args *pba)
{
}
diff --git a/sys/arch/alpha/sableio/sableio.c b/sys/arch/alpha/sableio/sableio.c
index 95c828b5ba6..4b3e5f6c94e 100644
--- a/sys/arch/alpha/sableio/sableio.c
+++ b/sys/arch/alpha/sableio/sableio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sableio.c,v 1.12 2008/04/28 20:23:12 martin Exp $ */
+/* $NetBSD: sableio.c,v 1.13 2011/06/14 15:34:22 matt Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: sableio.c,v 1.12 2008/04/28 20:23:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sableio.c,v 1.13 2011/06/14 15:34:22 matt Exp $");
#include "isadma.h"
@@ -87,7 +87,7 @@ const struct sableio_dev {
};
struct sableio_softc {
- struct device sc_dev; /* base device */
+ device_t sc_dev; /* base device */
/*
* We have to deal with ISA DMA, so that means we have to
@@ -97,10 +97,10 @@ struct sableio_softc {
struct alpha_isa_chipset sc_isa_chipset;
};
-int sableio_match(struct device *, struct cfdata *, void *);
-void sableio_attach(struct device *, struct device *, void *);
+int sableio_match(device_t, cfdata_t, void *);
+void sableio_attach(device_t, device_t, void *);
-CFATTACH_DECL(sableio, sizeof(struct sableio_softc),
+CFATTACH_DECL_NEW(sableio, sizeof(struct sableio_softc),
sableio_match, sableio_attach, NULL, NULL);
int sableio_print(void *, const char *);
@@ -108,7 +108,7 @@ int sableio_print(void *, const char *);
struct sableio_softc *sableio_attached;
int
-sableio_match(struct device *parent, struct cfdata *cf, void *aux)
+sableio_match(device_t parent, cfdata_t cf, void *aux)
{
struct pcibus_attach_args *pba = aux;
@@ -132,18 +132,19 @@ sableio_match(struct device *parent, struct cfdata *cf, void *aux)
}
void
-sableio_attach(struct device *parent, struct device *self, void *aux)
+sableio_attach(device_t parent, device_t self, void *aux)
{
- struct sableio_softc *sc = (void *) self;
+ struct sableio_softc *sc = device_private(self);
struct pcibus_attach_args *pba = aux;
struct sableio_attach_args sa;
bus_dma_tag_t dmat;
int i;
int locs[SABLEIOCF_NLOCS];
- printf(": Sable STDIO module\n");
+ aprint_normal(": Sable STDIO module\n");
sableio_attached = sc;
+ sc->sc_dev = self;
dmat = alphabus_dma_get_tag(pba->pba_dmat, ALPHA_BUS_ISA);
diff --git a/sys/arch/alpha/tlsb/gbus.c b/sys/arch/alpha/tlsb/gbus.c
index c7cd2359b5b..5acd4ed225d 100644
--- a/sys/arch/alpha/tlsb/gbus.c
+++ b/sys/arch/alpha/tlsb/gbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gbus.c,v 1.21 2009/03/14 15:36:00 dsl Exp $ */
+/* $NetBSD: gbus.c,v 1.22 2011/06/14 15:34:23 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -37,7 +37,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: gbus.c,v 1.21 2009/03/14 15:36:00 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gbus.c,v 1.22 2011/06/14 15:34:23 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,19 +57,19 @@ __KERNEL_RCSID(0, "$NetBSD: gbus.c,v 1.21 2009/03/14 15:36:00 dsl Exp $");
#define KV(_addr) ((void *)ALPHA_PHYS_TO_K0SEG((_addr)))
struct gbus_softc {
- struct device sc_dev;
+ device_t sc_dev;
int sc_tlsbnode; /* node on the TurboLaser */
};
-static int gbusmatch(struct device *, struct cfdata *, void *);
-static void gbusattach(struct device *, struct device *, void *);
+static int gbusmatch(device_t, cfdata_t, void *);
+static void gbusattach(device_t, device_t, void *);
-CFATTACH_DECL(gbus, sizeof(struct gbus_softc),
+CFATTACH_DECL_NEW(gbus, sizeof(struct gbus_softc),
gbusmatch, gbusattach, NULL, NULL);
static int gbusprint(void *, const char *);
-struct gbus_attach_args gbus_children[] = {
+const struct gbus_attach_args gbus_children[] = {
{ "zsc", GBUS_DUART0_OFFSET },
{ "zsc", GBUS_DUART1_OFFSET },
{ "mcclock", GBUS_CLOCK_OFFSET },
@@ -88,7 +88,7 @@ gbusprint(void *aux, const char *pnp)
}
static int
-gbusmatch(struct device *parent, struct cfdata *cf, void *aux)
+gbusmatch(device_t parent, cfdata_t cf, void *aux)
{
struct tlsb_dev_attach_args *ta = aux;
@@ -108,21 +108,23 @@ gbusmatch(struct device *parent, struct cfdata *cf, void *aux)
}
static void
-gbusattach(struct device *parent, struct device *self, void *aux)
+gbusattach(device_t parent, device_t self, void *aux)
{
- struct gbus_softc *sc = (struct gbus_softc *)self;
+ struct gbus_softc *sc = device_private(self);
struct tlsb_dev_attach_args *ta = aux;
- struct gbus_attach_args *ga;
+ const struct gbus_attach_args *ga;
int locs[GBUSCF_NLOCS];
- printf("\n");
+ aprint_normal("\n");
+ sc->sc_dev = self;
sc->sc_tlsbnode = ta->ta_node;
/* Attach the children. */
for (ga = gbus_children; ga->ga_name != NULL; ga++) {
- locs[GBUSCF_OFFSET] = ga->ga_offset;
- (void) config_found_sm_loc(self, "gbus", locs, ga,
- gbusprint, config_stdsubmatch);
+ struct gbus_attach_args gaa = *ga;
+ locs[GBUSCF_OFFSET] = gaa.ga_offset;
+ (void) config_found_sm_loc(self, "gbus", locs, &gaa,
+ gbusprint, config_stdsubmatch);
}
}
diff --git a/sys/arch/alpha/tlsb/kftxx.c b/sys/arch/alpha/tlsb/kftxx.c
index 41a2784b1c8..4fb18bfaa04 100644
--- a/sys/arch/alpha/tlsb/kftxx.c
+++ b/sys/arch/alpha/tlsb/kftxx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kftxx.c,v 1.15 2009/03/14 15:36:00 dsl Exp $ */
+/* $NetBSD: kftxx.c,v 1.16 2011/06/14 15:34:23 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -39,7 +39,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: kftxx.c,v 1.15 2009/03/14 15:36:00 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kftxx.c,v 1.16 2011/06/14 15:34:23 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,16 +57,17 @@ __KERNEL_RCSID(0, "$NetBSD: kftxx.c,v 1.15 2009/03/14 15:36:00 dsl Exp $");
#include <alpha/pci/dwlpxvar.h>
struct kft_softc {
- struct device sc_dev;
+ device_t sc_dev;
int sc_node; /* TLSB node */
- u_int16_t sc_dtype; /* device type */
+ uint16_t sc_dtype; /* device type */
};
#define KV(_addr) ((void *)ALPHA_PHYS_TO_K0SEG((_addr)))
-static int kftmatch(struct device *, struct cfdata *, void *);
-static void kftattach(struct device *, struct device *, void *);
-CFATTACH_DECL(kft, sizeof(struct kft_softc),
+static int kftmatch(device_t, cfdata_t, void *);
+static void kftattach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(kft, sizeof(struct kft_softc),
kftmatch, kftattach, NULL, NULL);
static int kftprint(void *, const char *);
@@ -82,7 +83,7 @@ kftprint(void *aux, const char *pnp)
}
static int
-kftmatch(struct device *parent, struct cfdata *cf, void *aux)
+kftmatch(device_t parent, cfdata_t cf, void *aux)
{
struct tlsb_dev_attach_args *ta = aux;
if (TLDEV_ISIOPORT(ta->ta_dtype))
@@ -91,35 +92,37 @@ kftmatch(struct device *parent, struct cfdata *cf, void *aux)
}
static void
-kftattach(struct device *parent, struct device *self, void *aux)
+kftattach(device_t parent, device_t self, void *aux)
{
struct tlsb_dev_attach_args *ta = aux;
- struct kft_softc *sc = (struct kft_softc *)self;
+ struct kft_softc *sc = device_private(self);
struct kft_dev_attach_args ka;
int hoseno;
+ sc->sc_dev = self;
sc->sc_node = ta->ta_node;
sc->sc_dtype = ta->ta_dtype;
- printf("\n");
+ aprint_normal("\n");
for (hoseno = 0; hoseno < MAXHOSE; hoseno++) {
- u_int32_t value =
+ uint32_t value =
TLSB_GET_NODEREG(sc->sc_node, KFT_IDPNSEX(hoseno));
if (value & 0x0E000000) {
- printf("%s: Hose %d IDPNSE has %x\n", self->dv_xname,
+ aprint_error_dev(self, "Hose %d IDPNSE has %x\n",
hoseno, value);
continue;
}
if ((value & 0x1) != 0x0) {
- printf("%s: Hose %d has a Bad Cable (0x%x)\n",
- self->dv_xname, hoseno, value);
+ aprint_error_dev(self,
+ "Hose %d has a Bad Cable (0x%x)\n", hoseno, value);
continue;
}
if ((value & 0x6) != 0x6) {
if (value)
- printf("%s: Hose %d is missing PWROK (0x%x)\n",
- self->dv_xname, hoseno, value);
+ aprint_error_dev(self,
+ "Hose %d is missing PWROK (0x%x)\n",
+ hoseno, value);
continue;
}
ka.ka_name = "dwlpx";
diff --git a/sys/arch/alpha/tlsb/tlsb.c b/sys/arch/alpha/tlsb/tlsb.c
index 5af62ac955e..9787d29388d 100644
--- a/sys/arch/alpha/tlsb/tlsb.c
+++ b/sys/arch/alpha/tlsb/tlsb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tlsb.c,v 1.35 2011/06/06 17:30:33 matt Exp $ */
+/* $NetBSD: tlsb.c,v 1.36 2011/06/14 15:34:23 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
* NASA AMES Research Center.
@@ -39,7 +39,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: tlsb.c,v 1.35 2011/06/06 17:30:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tlsb.c,v 1.36 2011/06/14 15:34:23 matt Exp $");
#include "opt_multiprocessor.h"
@@ -171,7 +171,7 @@ tlsbattach(device_t parent, device_t self, void *aux)
* Deal with hooking CPU instances to TurboLaser nodes.
*/
if (TLDEV_ISCPU(tldev)) {
- printf("%s node %d: %s\n", self->dv_xname,
+ aprint_normal("%s node %d: %s\n", device_xname(self),
node, tlsb_node_type_str(tldev));
}
/*
@@ -206,8 +206,8 @@ tlsbattach(device_t parent, device_t self, void *aux)
* XXX per-CPU interrupt queue?
*/
printf("%s node %d: routing interrupts to %s\n",
- self->dv_xname, node,
- cpu_info[hwrpb->rpb_primary_cpu_id]->ci_softc->sc_dev.dv_xname);
+ device_xname(self), node,
+ device_xname(cpu_info[hwrpb->rpb_primary_cpu_id]->ci_softc->sc_dev));
TLSB_PUT_NODEREG(node, TLCPUMASK,
(1UL << hwrpb->rpb_primary_cpu_id));
#else
diff --git a/sys/arch/alpha/tlsb/tlsbmem.c b/sys/arch/alpha/tlsb/tlsbmem.c
index 1f75ba5768c..541089dabde 100644
--- a/sys/arch/alpha/tlsb/tlsbmem.c
+++ b/sys/arch/alpha/tlsb/tlsbmem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tlsbmem.c,v 1.10 2009/03/14 15:36:00 dsl Exp $ */
+/* $NetBSD: tlsbmem.c,v 1.11 2011/06/14 15:34:23 matt Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@@ -37,7 +37,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: tlsbmem.c,v 1.10 2009/03/14 15:36:00 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tlsbmem.c,v 1.11 2011/06/14 15:34:23 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -52,18 +52,19 @@ __KERNEL_RCSID(0, "$NetBSD: tlsbmem.c,v 1.10 2009/03/14 15:36:00 dsl Exp $");
#include <alpha/tlsb/tlsbvar.h>
struct tlsbmem_softc {
- struct device sc_dv;
+ device_t sc_dev;
int sc_node; /* TLSB node */
- u_int16_t sc_dtype; /* device type */
+ uint16_t sc_dtype; /* device type */
};
-static int tlsbmemmatch(struct device *, struct cfdata *, void *);
-static void tlsbmemattach(struct device *, struct device *, void *);
-CFATTACH_DECL(tlsbmem, sizeof (struct tlsbmem_softc),
+static int tlsbmemmatch(device_t, cfdata_t, void *);
+static void tlsbmemattach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(tlsbmem, sizeof (struct tlsbmem_softc),
tlsbmemmatch, tlsbmemattach, NULL, NULL);
static int
-tlsbmemmatch(struct device *parent, struct cfdata *cf, void *aux)
+tlsbmemmatch(device_t parent, cfdata_t cf, void *aux)
{
struct tlsb_dev_attach_args *ta = aux;
if (TLDEV_ISMEM(ta->ta_dtype))
@@ -72,13 +73,14 @@ tlsbmemmatch(struct device *parent, struct cfdata *cf, void *aux)
}
static void
-tlsbmemattach(struct device *parent, struct device *self, void *aux)
+tlsbmemattach(device_t parent, device_t self, void *aux)
{
struct tlsb_dev_attach_args *ta = aux;
- struct tlsbmem_softc *sc = (struct tlsbmem_softc *)self;
+ struct tlsbmem_softc *sc = device_private(self);
+ sc->sc_dev = self;
sc->sc_node = ta->ta_node;
sc->sc_dtype = ta->ta_dtype;
- printf("\n");
+ aprint_normal("\n");
}