Module Name: src
Committed By: tsutsui
Date: Fri Aug 10 14:52:26 UTC 2012
Modified Files:
src/sys/arch/sun2/dev: consinit.c
src/sys/arch/sun2/sun2: locore2.c machdep.c
Log Message:
Move cn_tab initialization from late cpu_startup(9) to
early _bootstrap() in locore2.c.
Tested on TME emulating 2/120.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sun2/dev/consinit.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sun2/sun2/locore2.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/sun2/sun2/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/sun2/dev/consinit.c
diff -u src/sys/arch/sun2/dev/consinit.c:1.8 src/sys/arch/sun2/dev/consinit.c:1.9
--- src/sys/arch/sun2/dev/consinit.c:1.8 Mon Jul 30 17:27:20 2012
+++ src/sys/arch/sun2/dev/consinit.c Fri Aug 10 14:52:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: consinit.c,v 1.8 2012/07/30 17:27:20 christos Exp $ */
+/* $NetBSD: consinit.c,v 1.9 2012/08/10 14:52:26 tsutsui Exp $ */
/*-
* Copyright (c) 2001 Matthew Fredette
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.8 2012/07/30 17:27:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.9 2012/08/10 14:52:26 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -95,16 +95,6 @@ struct consdev consdev_prom = {
NULL,
};
-/*
- * The console table pointer is statically initialized
- * to point to the PROM (output only) table, so that
- * early calls to printf will work. This has been moved
- * to cpu_startup()
- */
-#if 0
-struct consdev *cn_tab = &consdev_prom;
-#endif
-
void
prom_cnprobe(struct consdev *cd)
{
Index: src/sys/arch/sun2/sun2/locore2.c
diff -u src/sys/arch/sun2/sun2/locore2.c:1.25 src/sys/arch/sun2/sun2/locore2.c:1.26
--- src/sys/arch/sun2/sun2/locore2.c:1.25 Sun Jul 17 20:54:48 2011
+++ src/sys/arch/sun2/sun2/locore2.c Fri Aug 10 14:52:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: locore2.c,v 1.25 2011/07/17 20:54:48 joerg Exp $ */
+/* $NetBSD: locore2.c,v 1.26 2012/08/10 14:52:26 tsutsui Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.25 2011/07/17 20:54:48 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.26 2012/08/10 14:52:26 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_modular.h"
@@ -44,6 +44,8 @@ __KERNEL_RCSID(0, "$NetBSD: locore2.c,v
#include <uvm/uvm_extern.h>
+#include <dev/cons.h>
+
#include <machine/cpu.h>
#include <machine/db_machdep.h>
#include <machine/dvma.h>
@@ -255,6 +257,7 @@ _verify_hardware(void)
void
_bootstrap(void)
{
+ extern struct consdev consdev_prom; /* XXX */
vaddr_t va;
/* First, Clear BSS. */
@@ -263,6 +266,12 @@ _bootstrap(void)
/* Initialize the PROM. */
prom_init();
+ /*
+ * Initialize console to point to the PROM (output only) table
+ * for early printf calls.
+ */
+ cn_tab = &consdev_prom;
+
/* Copy the IDPROM from control space. */
idprom_init();
Index: src/sys/arch/sun2/sun2/machdep.c
diff -u src/sys/arch/sun2/sun2/machdep.c:1.75 src/sys/arch/sun2/sun2/machdep.c:1.76
--- src/sys/arch/sun2/sun2/machdep.c:1.75 Mon Jul 30 17:27:20 2012
+++ src/sys/arch/sun2/sun2/machdep.c Fri Aug 10 14:52:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.75 2012/07/30 17:27:20 christos Exp $ */
+/* $NetBSD: machdep.c,v 1.76 2012/08/10 14:52:26 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -149,7 +149,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75 2012/07/30 17:27:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.76 2012/08/10 14:52:26 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -258,7 +258,6 @@ static vaddr_t dumppage;
static void identifycpu(void);
static void initcpu(void);
-extern struct consdev *cn_tab, consdev_prom;
/*
* cpu_startup: allocate memory for variable-sized tables,
@@ -275,7 +274,6 @@ cpu_startup(void)
vaddr_t minaddr, maxaddr;
char pbuf[9];
- cn_tab = &consdev_prom;
/*
* Initialize message buffer (for kernel printf).
* This is put in physical pages four through seven