Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64 Set up cn_tab in bootstrap() instead of ini...



details:   https://anonhg.NetBSD.org/src/rev/e4f8536d580b
branches:  trunk
changeset: 780620:e4f8536d580b
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jul 31 13:35:48 2012 +0000

description:
Set up cn_tab in bootstrap() instead of initializing it statically.
Fixes -Wno-common fallout, idea from tsutsui.

diffstat:

 sys/arch/sparc64/dev/consinit.c     |  11 ++---------
 sys/arch/sparc64/sparc64/autoconf.c |   6 ++++--
 2 files changed, 6 insertions(+), 11 deletions(-)

diffs (66 lines):

diff -r 05ba38c48612 -r e4f8536d580b sys/arch/sparc64/dev/consinit.c
--- a/sys/arch/sparc64/dev/consinit.c   Tue Jul 31 12:11:50 2012 +0000
+++ b/sys/arch/sparc64/dev/consinit.c   Tue Jul 31 13:35:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: consinit.c,v 1.25 2009/03/18 10:22:36 cegger Exp $     */
+/*     $NetBSD: consinit.c,v 1.26 2012/07/31 13:35:48 martin Exp $     */
 
 /*-
  * Copyright (c) 1999 Eduardo E. Horvath
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.25 2009/03/18 10:22:36 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.26 2012/07/31 13:35:48 martin Exp $");
 
 #include "opt_ddb.h"
 #include "pcons.h"
@@ -81,13 +81,6 @@
        .cn_pollc = prom_cnpollc,
 };
 
-/*
- * The console table pointer is statically initialized
- * to point to the PROM (output only) table, so that
- * early calls to printf will work.
- */
-struct consdev *cn_tab = &consdev_prom;
-
 void
 prom_cnprobe(struct consdev *cd)
 {
diff -r 05ba38c48612 -r e4f8536d580b sys/arch/sparc64/sparc64/autoconf.c
--- a/sys/arch/sparc64/sparc64/autoconf.c       Tue Jul 31 12:11:50 2012 +0000
+++ b/sys/arch/sparc64/sparc64/autoconf.c       Tue Jul 31 13:35:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.188 2012/07/29 18:05:46 mlelstv Exp $ */
+/*     $NetBSD: autoconf.c,v 1.189 2012/07/31 13:35:48 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.188 2012/07/29 18:05:46 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.189 2012/07/31 13:35:48 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -280,6 +280,7 @@
        extern void* get_romtba(void);
        extern void  OF_val2sym32(void *);
        extern void OF_sym2val32(void *);
+       extern struct consdev consdev_prom;
 
        /* Save OpenFrimware entry point */
        romp   = ofw;
@@ -290,6 +291,7 @@
        console_node = OF_instance_to_package(promops.po_stdout);
 
        /* Initialize the PROM console so printf will not panic */
+       cn_tab = &consdev_prom;
        (*cn_tab->cn_init)(cn_tab);
 
        DPRINTF(ACDB_BOOTARGS,



Home | Main Index | Thread Index | Old Index