Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sun2 Move cn_tab initialization from late cpu_start...



details:   https://anonhg.NetBSD.org/src/rev/b38edc53830b
branches:  trunk
changeset: 780884:b38edc53830b
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Aug 10 14:52:26 2012 +0000

description:
Move cn_tab initialization from late cpu_startup(9) to
early _bootstrap() in locore2.c.
Tested on TME emulating 2/120.

diffstat:

 sys/arch/sun2/dev/consinit.c |  14 ++------------
 sys/arch/sun2/sun2/locore2.c |  13 +++++++++++--
 sys/arch/sun2/sun2/machdep.c |   6 ++----
 3 files changed, 15 insertions(+), 18 deletions(-)

diffs (117 lines):

diff -r 5d85bc332a42 -r b38edc53830b sys/arch/sun2/dev/consinit.c
--- a/sys/arch/sun2/dev/consinit.c      Fri Aug 10 14:33:35 2012 +0000
+++ b/sys/arch/sun2/dev/consinit.c      Fri Aug 10 14:52:26 2012 +0000
@@ -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 @@
        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)
 {
diff -r 5d85bc332a42 -r b38edc53830b sys/arch/sun2/sun2/locore2.c
--- a/sys/arch/sun2/sun2/locore2.c      Fri Aug 10 14:33:35 2012 +0000
+++ b/sys/arch/sun2/sun2/locore2.c      Fri Aug 10 14:52:26 2012 +0000
@@ -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 @@
 
 #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 @@
 void 
 _bootstrap(void)
 {
+       extern struct consdev consdev_prom;     /* XXX */
        vaddr_t va;
 
        /* First, Clear BSS. */
@@ -263,6 +266,12 @@
        /* 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();
 
diff -r 5d85bc332a42 -r b38edc53830b sys/arch/sun2/sun2/machdep.c
--- a/sys/arch/sun2/sun2/machdep.c      Fri Aug 10 14:33:35 2012 +0000
+++ b/sys/arch/sun2/sun2/machdep.c      Fri Aug 10 14:52:26 2012 +0000
@@ -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 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 @@
        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



Home | Main Index | Thread Index | Old Index