Module Name:    src
Committed By:   matt
Date:           Thu Jan 14 00:40:36 UTC 2010

Modified Files:
        src/sys/arch/evbmips/alchemy [matt-nb5-mips64]: obio.c
        src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: autoconf.c cpucore.c
            cpucorevar.h
        src/sys/arch/mips/adm5120 [matt-nb5-mips64]: adm5120_obio.c
        src/sys/arch/mips/adm5120/dev [matt-nb5-mips64]: admgpio.c
        src/sys/arch/mips/adm5120/include [matt-nb5-mips64]:
            adm5120_mainbusvar.h
        src/sys/arch/mips/include [matt-nb5-mips64]: cpu.h
        src/sys/arch/mips/mips [matt-nb5-mips64]: bus_dma.c mips_machdep.c

Log Message:
More fixes for the CFATTAL_DECL_NEW changes and rmixl cpucore/cpu changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.98.1 -r1.1.98.2 src/sys/arch/evbmips/alchemy/obio.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/evbmips/rmixl/autoconf.c \
    src/sys/arch/evbmips/rmixl/cpucorevar.h
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/evbmips/rmixl/cpucore.c
cvs rdiff -u -r1.1.62.1 -r1.1.62.2 src/sys/arch/mips/adm5120/adm5120_obio.c
cvs rdiff -u -r1.1 -r1.1.62.1 src/sys/arch/mips/adm5120/dev/admgpio.c
cvs rdiff -u -r1.1 -r1.1.62.1 \
    src/sys/arch/mips/adm5120/include/adm5120_mainbusvar.h
cvs rdiff -u -r1.90.16.10 -r1.90.16.11 src/sys/arch/mips/include/cpu.h
cvs rdiff -u -r1.22.16.12 -r1.22.16.13 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.205.4.1.2.1.2.22 -r1.205.4.1.2.1.2.23 \
    src/sys/arch/mips/mips/mips_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbmips/alchemy/obio.c
diff -u src/sys/arch/evbmips/alchemy/obio.c:1.1.98.1 src/sys/arch/evbmips/alchemy/obio.c:1.1.98.2
--- src/sys/arch/evbmips/alchemy/obio.c:1.1.98.1	Sun Jan 10 02:48:45 2010
+++ src/sys/arch/evbmips/alchemy/obio.c	Thu Jan 14 00:40:34 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: obio.c,v 1.1.98.1 2010/01/10 02:48:45 matt Exp $ */
+/* $NetBSD: obio.c,v 1.1.98.2 2010/01/14 00:40:34 matt Exp $ */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.1.98.1 2010/01/10 02:48:45 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.1.98.2 2010/01/14 00:40:34 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -52,20 +52,19 @@
 
 #include "locators.h"
 
-static int	obio_match(struct device *, struct cfdata *, void *);
-static void	obio_attach(struct device *, struct device *, void *);
-static int	obio_submatch(struct device *, struct cfdata *,
-			      const int *, void *);
+static int	obio_match(device_t, cfdata_t, void *);
+static void	obio_attach(device_t, device_t, void *);
+static int	obio_submatch(device_t, cfdata_t, const int *, void *);
 static int	obio_print(void *, const char *);
 
-CFATTACH_DECL(obio, sizeof(struct device),
+CFATTACH_DECL_NEW(obio, 0,
     obio_match, obio_attach, NULL, NULL);
 
 /* There can be only one. */
 static int	obio_found = 0;
 
 static int
-obio_match(struct device *parent, struct cfdata *match, void *aux)
+obio_match(device_t parent, cfdata_t match, void *aux)
 {
 
 	if (obio_found)
@@ -75,7 +74,7 @@
 }
 
 static void
-obio_attach(struct device *parent, struct device *self, void *aux)
+obio_attach(device_t parent, device_t self, void *aux)
 {
 	struct obio_attach_args oa;
 	const struct obiodev *od;
@@ -95,7 +94,7 @@
 }
 
 static int
-obio_submatch(struct device *parent, struct cfdata *cf,
+obio_submatch(device_t parent, cfdata_t cf,
 	      const int *ldesc, void *aux)
 {
 	struct obio_attach_args *oa = aux;

Index: src/sys/arch/evbmips/rmixl/autoconf.c
diff -u src/sys/arch/evbmips/rmixl/autoconf.c:1.1.2.1 src/sys/arch/evbmips/rmixl/autoconf.c:1.1.2.2
--- src/sys/arch/evbmips/rmixl/autoconf.c:1.1.2.1	Sun Sep 13 03:27:38 2009
+++ src/sys/arch/evbmips/rmixl/autoconf.c	Thu Jan 14 00:40:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.1.2.2 2010/01/14 00:40:35 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1.2.2 2010/01/14 00:40:35 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -83,7 +83,7 @@
 static void
 findroot(void)
 {
-	struct device *dv;
+	device_t dv;
 
 	if (booted_device)
 		return;
@@ -105,7 +105,7 @@
 
 void
 device_register(dev, aux)
-	struct device *dev;
+	device_t dev;
 	void *aux;
 {
 	if ((booted_device == NULL) && (netboot == 1))
Index: src/sys/arch/evbmips/rmixl/cpucorevar.h
diff -u src/sys/arch/evbmips/rmixl/cpucorevar.h:1.1.2.1 src/sys/arch/evbmips/rmixl/cpucorevar.h:1.1.2.2
--- src/sys/arch/evbmips/rmixl/cpucorevar.h:1.1.2.1	Wed Jan 13 09:40:35 2010
+++ src/sys/arch/evbmips/rmixl/cpucorevar.h	Thu Jan 14 00:40:35 2010
@@ -1,10 +1,17 @@
-/*	$NetBSD: cpucorevar.h,v 1.1.2.1 2010/01/13 09:40:35 cliff Exp $	*/
+/*	$NetBSD: cpucorevar.h,v 1.1.2.2 2010/01/14 00:40:35 matt Exp $	*/
 
 #ifndef _EVBMIPS_RMIXL_CPUCOREVAR_H_
 #define _EVBMIPS_RMIXL_CPUCOREVAR_H_
 
+struct cpucore_softc {
+	device_t	sc_dev;
+	bool		sc_attached;
+	u_int		sc_core;
+};
+
 struct cpucore_attach_args {
 	const char     *ca_name;
+	int		ca_core;
 	int		ca_thread;
 };
 

Index: src/sys/arch/evbmips/rmixl/cpucore.c
diff -u src/sys/arch/evbmips/rmixl/cpucore.c:1.1.2.2 src/sys/arch/evbmips/rmixl/cpucore.c:1.1.2.3
--- src/sys/arch/evbmips/rmixl/cpucore.c:1.1.2.2	Wed Jan 13 09:56:10 2010
+++ src/sys/arch/evbmips/rmixl/cpucore.c	Thu Jan 14 00:40:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpucore.c,v 1.1.2.2 2010/01/13 09:56:10 cliff Exp $	*/
+/*	$NetBSD: cpucore.c,v 1.1.2.3 2010/01/14 00:40:35 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpucore.c,v 1.1.2.2 2010/01/13 09:56:10 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpucore.c,v 1.1.2.3 2010/01/14 00:40:35 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -47,44 +47,43 @@
 #include <evbmips/rmixl/autoconf.h>
 #include <evbmips/rmixl/cpucorevar.h>
 
-typedef struct cpucore_softc {
-	device_t	sc_dev;
-	bool		sc_attached;
-} cpucore_softc_t;
-
-static int	cpucore_match(struct device *, struct cfdata *, void *);
-static void	cpucore_attach(struct device *, struct device *, void *);
+static int	cpucore_match(device_t, cfdata_t, void *);
+static void	cpucore_attach(device_t, device_t, void *);
 static int	cpucore_print(void *, const char *);
 
-CFATTACH_DECL(cpucore, sizeof(struct device),
+CFATTACH_DECL_NEW(cpucore, sizeof(struct cpucore_softc),
     cpucore_match, cpucore_attach, NULL, NULL);
 
 static int
-cpucore_match(struct device *parent, struct cfdata *cf, void *aux)
+cpucore_match(device_t parent, cfdata_t cf, void *aux)
 {
-	struct mainbus_attach_args *aa = aux;
+	struct mainbus_attach_args *ma = aux;
 	int core = cf->cf_loc[MAINBUSCF_CORE];
 
-	if (strncmp(aa->ma_name, cf->cf_name, strlen(cf->cf_name)) == 0)
+	if (strncmp(ma->ma_name, cf->cf_name, strlen(cf->cf_name)) == 0
 #ifndef MULTIPROCESSOR
-	    if (aa->ma_core == 0)
+	    && ma->ma_core == 0
 #endif
-		if ((core == MAINBUSCF_CORE_DEFAULT)
-		||  (core == aa->ma_core))
-			return 1;
+	    && (core == MAINBUSCF_CORE_DEFAULT || core == ma->ma_core))
+		return 1;
 
 	return 0;
 }
 
 static void
-cpucore_attach(struct device *parent, struct device *self, void *aux)
+cpucore_attach(device_t parent, device_t self, void *aux)
 {
-	struct cpucore_attach_args aa;
+	struct cpucore_softc * const sc = device_private(self);
+	struct mainbus_attach_args *ma = aux;
+	struct cpucore_attach_args ca;
 	u_int nthreads;
 
-	aprint_normal("\n%s: %lu.%02luMHz (hz cycles = %lu, "
+	sc->sc_dev = self;
+	sc->sc_core = ma->ma_core;
+
+	aprint_normal("\n");
+	aprint_normal_dev(self, "%lu.%02luMHz (hz cycles = %lu, "
 	    "delay divisor = %lu)\n",
-	    device_xname(self),
 	    curcpu()->ci_cpu_freq / 1000000,
 	    (curcpu()->ci_cpu_freq % 1000000) / 10000,
 	    curcpu()->ci_cycles_per_hz, curcpu()->ci_divisor_delay);
@@ -93,28 +92,28 @@
 	cpu_identify(self);
 
 	nthreads = MIPS_CIDFL_RMI_NTHREADS(mycpu->cpu_cidflags);
-	aprint_normal("%s: %d %s on core\n", device_xname(self), nthreads,
+	aprint_normal_dev(self, "%d %s on core\n", nthreads,
 		nthreads == 1 ? "thread" : "threads");
 
 	/*
-	 * Attach CPU (RMI thread) devices
+	 * Attach CPU (RMI thread contexts) devices
 	 */
 	for (int i=0; i < nthreads; i++) {
-		aa.ca_name = "cpu";
-		aa.ca_thread = i;
-		config_found(self, &aa, cpucore_print);
+		ca.ca_name = "cpu";
+		ca.ca_thread = i;
+		ca.ca_core = sc->sc_core;
+		config_found(self, &ca, cpucore_print);
 	}
 }
 
 static int
 cpucore_print(void *aux, const char *pnp)
 {
-	struct cpucore_attach_args *aa = aux;
+	struct cpucore_attach_args *ca = aux;
 
 	if (pnp != NULL)
 		aprint_normal("%s:", pnp);
-	aprint_normal(" thread %d", aa->ca_thread);
+	aprint_normal(" thread %d", ca->ca_thread);
 
 	return (UNCONF);
 }
-

Index: src/sys/arch/mips/adm5120/adm5120_obio.c
diff -u src/sys/arch/mips/adm5120/adm5120_obio.c:1.1.62.1 src/sys/arch/mips/adm5120/adm5120_obio.c:1.1.62.2
--- src/sys/arch/mips/adm5120/adm5120_obio.c:1.1.62.1	Sun Jan 10 02:48:46 2010
+++ src/sys/arch/mips/adm5120/adm5120_obio.c	Thu Jan 14 00:40:35 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: adm5120_obio.c,v 1.1.62.1 2010/01/10 02:48:46 matt Exp $ */
+/* $NetBSD: adm5120_obio.c,v 1.1.62.2 2010/01/14 00:40:35 matt Exp $ */
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adm5120_obio.c,v 1.1.62.1 2010/01/10 02:48:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm5120_obio.c,v 1.1.62.2 2010/01/14 00:40:35 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,13 +95,12 @@
 #define	OBIO_DPRINTF(__fmt, ...)	do { } while (/*CONSTCOND*/0)
 #endif /* OBIO_DEBUG */
 
-static int	obio_match(struct device *, struct cfdata *, void *);
-static void	obio_attach(struct device *, struct device *, void *);
-static int	obio_submatch(struct device *, struct cfdata *,
-			      const int *, void *);
+static int	obio_match(device_t, cfdata_t, void *);
+static void	obio_attach(device_t, device_t, void *);
+static int	obio_submatch(device_t, cfdata_t, const int *, void *);
 static int	obio_print(void *, const char *);
 
-CFATTACH_DECL(obio, sizeof(struct device), obio_match, obio_attach, NULL, NULL);
+CFATTACH_DECL_NEW(obio, 0, obio_match, obio_attach, NULL, NULL);
 
 /* There can be only one. */
 int	obio_found;
@@ -113,7 +112,7 @@
 	uint32_t	od_gpio_mask;
 };
 
-struct obiodev obiodevs[] = {
+const struct obiodev obiodevs[] = {
 	{"uart",	ADM5120_BASE_UART0,	1, 0x0},
 	{"uart",	ADM5120_BASE_UART1,	2, 0x0},
 	{"admsw",	ADM5120_BASE_SWITCH,	9, 0x0},
@@ -123,13 +122,13 @@
 };
 
 static int
-obio_match(struct device *parent, struct cfdata *match, void *aux)
+obio_match(device_t parent, cfdata_t match, void *aux)
 {
 	return !obio_found;
 }
 
 static void
-obio_attach_args_create(struct obio_attach_args *oa, struct obiodev *od,
+obio_attach_args_create(struct obio_attach_args *oa, const struct obiodev *od,
     void *gpio, bus_dma_tag_t dmat, bus_space_tag_t st)
 {
 	oa->oba_name = od->od_name;
@@ -142,11 +141,11 @@
 }
 
 static void
-obio_attach(struct device *parent, struct device *self, void *aux)
+obio_attach(device_t parent, device_t self, void *aux)
 {
 	struct mainbus_attach_args *ma = (struct mainbus_attach_args *)aux;
 	struct obio_attach_args oa;
-	struct obiodev *od;
+	const struct obiodev *od;
 
 	obio_found = 1;
 	printf("\n");
@@ -166,8 +165,7 @@
 }
 
 static int
-obio_submatch(struct device *parent, struct cfdata *cf,
-	      const int *ldesc, void *aux)
+obio_submatch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 	struct obio_attach_args *oa = aux;
 

Index: src/sys/arch/mips/adm5120/dev/admgpio.c
diff -u src/sys/arch/mips/adm5120/dev/admgpio.c:1.1 src/sys/arch/mips/adm5120/dev/admgpio.c:1.1.62.1
--- src/sys/arch/mips/adm5120/dev/admgpio.c:1.1	Tue Mar 20 08:52:01 2007
+++ src/sys/arch/mips/adm5120/dev/admgpio.c	Thu Jan 14 00:40:35 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: admgpio.c,v 1.1 2007/03/20 08:52:01 dyoung Exp $ */
+/* $NetBSD: admgpio.c,v 1.1.62.1 2010/01/14 00:40:35 matt Exp $ */
 
 /*-
  * Copyright (c) 2007 David Young.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: admgpio.c,v 1.1 2007/03/20 08:52:01 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: admgpio.c,v 1.1.62.1 2010/01/14 00:40:35 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -140,5 +140,5 @@
 	gba.gba_npins = __arraycount(sc->sc_pins);
 
 	/* Attach GPIO framework */
-	return config_found_ia(&sc->sc_dev, "gpiobus", &gba, gpiobus_print);
+	return config_found_ia(sc->sc_dev, "gpiobus", &gba, gpiobus_print);
 }

Index: src/sys/arch/mips/adm5120/include/adm5120_mainbusvar.h
diff -u src/sys/arch/mips/adm5120/include/adm5120_mainbusvar.h:1.1 src/sys/arch/mips/adm5120/include/adm5120_mainbusvar.h:1.1.62.1
--- src/sys/arch/mips/adm5120/include/adm5120_mainbusvar.h:1.1	Tue Mar 20 08:52:03 2007
+++ src/sys/arch/mips/adm5120/include/adm5120_mainbusvar.h	Thu Jan 14 00:40:35 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: adm5120_mainbusvar.h,v 1.1 2007/03/20 08:52:03 dyoung Exp $ */
+/* $NetBSD: adm5120_mainbusvar.h,v 1.1.62.1 2010/01/14 00:40:35 matt Exp $ */
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -50,7 +50,7 @@
 };
 
 struct mainbus_softc {
-	struct device		sc_dev;
+	device_t		sc_dev;
 	bus_space_tag_t		sc_obiot;
 	bus_space_handle_t	sc_gpioh;
 	struct gpio_chipset_tag	sc_gp;

Index: src/sys/arch/mips/include/cpu.h
diff -u src/sys/arch/mips/include/cpu.h:1.90.16.10 src/sys/arch/mips/include/cpu.h:1.90.16.11
--- src/sys/arch/mips/include/cpu.h:1.90.16.10	Wed Jan 13 09:42:16 2010
+++ src/sys/arch/mips/include/cpu.h	Thu Jan 14 00:40:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.90.16.10 2010/01/13 09:42:16 cliff Exp $	*/
+/*	$NetBSD: cpu.h,v 1.90.16.11 2010/01/14 00:40:35 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -50,6 +50,7 @@
 
 #if defined(_KERNEL_OPT)
 #include "opt_lockdebug.h"
+#include "opt_multiprocessor.h"
 #endif
 
 struct pridtab {
@@ -135,6 +136,9 @@
 	int ci_mtx_count;		/* negative count of held mutexes */
 	int ci_mtx_oldspl;		/* saved SPL value */
 	int ci_idepth;			/* hardware interrupt depth */
+	device_t ci_dev;		/* owning device */
+	vaddr_t ci_ebase;		/* VA of exception base */
+	paddr_t ci_ebase_pa;		/* PA of exception base */
 };
 
 #define	CPU_INFO_ITERATOR		int

Index: src/sys/arch/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.22.16.12 src/sys/arch/mips/mips/bus_dma.c:1.22.16.13
--- src/sys/arch/mips/mips/bus_dma.c:1.22.16.12	Tue Jan 12 07:58:09 2010
+++ src/sys/arch/mips/mips/bus_dma.c	Thu Jan 14 00:40:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.22.16.12 2010/01/12 07:58:09 cliff Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.22.16.13 2010/01/14 00:40:35 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.22.16.12 2010/01/12 07:58:09 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.22.16.13 2010/01/14 00:40:35 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -942,13 +942,13 @@
 	 * Compute the location, size, and number of segments actually
 	 * returned by the VM code.
 	 */
-	m = mlist.tqh_first;
+	m = TAILQ_FIRST(&mlist);
 	curseg = 0;
 	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
 	segs[curseg].ds_len = PAGE_SIZE;
-	m = m->pageq.queue.tqe_next;
+	m = TAILQ_NEXT(m, pageq.queue);
 
-	for (; m != NULL; m = m->pageq.queue.tqe_next) {
+	for (; m != NULL; m = TAILQ_NEXT(m, pageq.queue)) {
 		curaddr = VM_PAGE_TO_PHYS(m);
 #ifdef DIAGNOSTIC
 		if (curaddr < low || curaddr >= high) {

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.22 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.23
--- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.22	Wed Jan 13 09:42:38 2010
+++ src/sys/arch/mips/mips/mips_machdep.c	Thu Jan 14 00:40:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.22 2010/01/13 09:42:38 cliff Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.23 2010/01/14 00:40:36 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.22 2010/01/13 09:42:38 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.23 2010/01/14 00:40:36 matt Exp $");
 
 #include "opt_cputype.h"
 #include "opt_compat_netbsd32.h"
@@ -229,6 +229,7 @@
 struct	cpu_info cpu_info_store = {
 	.ci_curlwp = &lwp0,
 	.ci_fpcurlwp = &lwp0,
+	.ci_ebase = MIPS_KSEG0_START,
 };
 
 struct	user *proc0paddr;
@@ -1095,7 +1096,6 @@
 		"write-back",
 		"write-through",
 	};
-	const char *label = device_xname(dev);
 	const char *cpuname, *fpuname;
 	int i;
 
@@ -1118,41 +1118,40 @@
 
 	if (mycpu->cpu_cid != 0) {
 		if (mycpu->cpu_cid <= ncidnames)
-			printf("%s ", cidnames[mycpu->cpu_cid]);
+			aprint_normal("%s ", cidnames[mycpu->cpu_cid]);
 		else {
-			printf("Unknown Company ID - 0x%x", mycpu->cpu_cid);
-			printf("%s: ", label);
+			aprint_normal("Unknown Company ID - 0x%x", mycpu->cpu_cid);
+			aprint_normal_dev(dev, "");
 		}
 	}
 	if (cpuname != NULL)
-		printf("%s (0x%x)", cpuname, cpu_id);
+		aprint_normal("%s (0x%x)", cpuname, cpu_id);
 	else
-		printf("unknown CPU type (0x%x)", cpu_id);
+		aprint_normal("unknown CPU type (0x%x)", cpu_id);
 	if (MIPS_PRID_CID(cpu_id) == MIPS_PRID_CID_PREHISTORIC)
-		printf(" Rev. %d.%d", MIPS_PRID_REV_MAJ(cpu_id),
+		aprint_normal(" Rev. %d.%d", MIPS_PRID_REV_MAJ(cpu_id),
 		    MIPS_PRID_REV_MIN(cpu_id));
 	else
-		printf(" Rev. %d", MIPS_PRID_REV(cpu_id));
+		aprint_normal(" Rev. %d", MIPS_PRID_REV(cpu_id));
 
 	if (fpuname != NULL)
-		printf(" with %s", fpuname);
+		aprint_normal(" with %s", fpuname);
 	else
-		printf(" with unknown FPC type (0x%x)", fpu_id);
+		aprint_normal(" with unknown FPC type (0x%x)", fpu_id);
 	if (fpu_id != 0) {
 		if (MIPS_PRID_CID(cpu_id) == MIPS_PRID_CID_PREHISTORIC)
-			printf(" Rev. %d.%d", MIPS_PRID_REV_MAJ(fpu_id),
+			aprint_normal(" Rev. %d.%d", MIPS_PRID_REV_MAJ(fpu_id),
 			    MIPS_PRID_REV_MIN(fpu_id));
 		else
-			printf(" Rev. %d", MIPS_PRID_REV(fpu_id));
+			aprint_normal(" Rev. %d", MIPS_PRID_REV(fpu_id));
 	}
-	printf("\n");
+	aprint_normal("\n");
 
 	if (MIPS_PRID_CID(cpu_id) == MIPS_PRID_CID_PREHISTORIC &&
 	    MIPS_PRID_RSVD(cpu_id) != 0) {
-		printf("%s: NOTE: top 8 bits of prehistoric PRID not 0!\n",
-		    label);
-		printf("%s: Please mail port-m...@netbsd.org with %s "
-		    "dmesg lines.\n", label, label);
+		aprint_normal_dev(dev, "NOTE: top 8 bits of prehistoric PRID not 0!\n");
+		aprint_normal_dev(dev, "Please mail port-m...@netbsd.org with %s "
+		    "dmesg lines.\n", device_xname(dev));
 	}
 
 	KASSERT(mips_picache_ways < nwaynames);
@@ -1164,15 +1163,15 @@
 #if defined(MIPS1)
 	case CPU_ARCH_MIPS1:
 		if (mips_picache_size)
-			printf("%s: %dKB/%dB %s Instruction cache, "
-			    "%d TLB entries\n", label, mips_picache_size / 1024,
+			aprint_normal_dev(dev, "%dKB/%dB %s Instruction cache, "
+			    "%d TLB entries\n", mips_picache_size / 1024,
 			    mips_picache_line_size, waynames[mips_picache_ways],
 			    mips_num_tlb_entries);
 		else
-			printf("%s: %d TLB entries\n", label,
+			aprint_normal_dev(dev, "%d TLB entries\n", 
 			    mips_num_tlb_entries);
 		if (mips_pdcache_size)
-			printf("%s: %dKB/%dB %s %s Data cache\n", label,
+			aprint_normal_dev(dev, "%dKB/%dB %s %s Data cache\n",
 			    mips_pdcache_size / 1024, mips_pdcache_line_size,
 			    waynames[mips_pdcache_ways],
 			    wtnames[mips_pdcache_write_through]);
@@ -1185,17 +1184,17 @@
 	case CPU_ARCH_MIPS64: {
 		const char *sufx = "KMGTPE";
 		uint32_t pg_mask;
-		printf("%s: %d TLB entries", label, mips_num_tlb_entries);
+		aprint_normal_dev(dev, "%d TLB entries", mips_num_tlb_entries);
 #if !defined(__mips_o32)
 		if (CPUIS64BITS) {
 			int64_t pfn_mask;
 			i = ffs(~(mips3_tlb_vpn_mask >> 31)) + 30;
-			printf(", %d%cB (%d-bit) VAs",
+			aprint_normal(", %d%cB (%d-bit) VAs",
 			    1 << (i % 10), sufx[(i / 10) - 1], i);
 			for (i = 64, pfn_mask = mips3_tlb_pfn_mask << 6;
 			     pfn_mask > 0; i--, pfn_mask <<= 1)
 				;
-			printf(", %d%cB (%d-bit) PAs",
+			aprint_normal(", %d%cB (%d-bit) PAs",
 			      1 << (i % 10), sufx[(i / 10) - 1], i);
 		}
 #endif
@@ -1210,18 +1209,21 @@
 				sufx++;
 			}
 		}
-		printf(", %d%cB max page size\n", i, sufx[0]);
+		aprint_normal(", %d%cB max page size\n", i, sufx[0]);
 		if (mips_picache_size)
-			printf("%s: %dKB/%dB %s L1 Instruction cache\n",
-			    label, mips_picache_size / 1024,
+			aprint_normal_dev(dev,
+			    "%dKB/%dB %s L1 Instruction cache\n",
+			    mips_picache_size / 1024,
 			    mips_picache_line_size, waynames[mips_picache_ways]);
 		if (mips_pdcache_size)
-			printf("%s: %dKB/%dB %s %s L1 Data cache\n", label,
+			aprint_normal_dev(dev,
+			    "%dKB/%dB %s %s L1 Data cache\n",
 			    mips_pdcache_size / 1024, mips_pdcache_line_size,
 			    waynames[mips_pdcache_ways],
 			    wtnames[mips_pdcache_write_through]);
 		if (mips_sdcache_line_size)
-			printf("%s: %dKB/%dB %s %s L2 %s cache\n", label,
+			aprint_normal_dev(dev,
+			    "%dKB/%dB %s %s L2 %s cache\n",
 			    mips_sdcache_size / 1024, mips_sdcache_line_size,
 			    waynames[mips_sdcache_ways],
 			    wtnames[mips_sdcache_write_through],

Reply via email to