Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sun3 Appease gcc -fno-common:



details:   https://anonhg.NetBSD.org/src/rev/5d85bc332a42
branches:  trunk
changeset: 780883:5d85bc332a42
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Aug 10 14:33:35 2012 +0000

description:
Appease gcc -fno-common:
 - initialize cn_tab in locore2.c:_bootstrap() for early printf calls
Tested on sun3 (3/160 on TME) and sun3x (real 3/80).

XXX: sun3 with >16MB RAM gets "panic: ubc_init: failed to map ubc_object"

diffstat:

 sys/arch/sun3/dev/zs.c        |  11 ++---------
 sys/arch/sun3/sun3/locore2.c  |  13 +++++++++++--
 sys/arch/sun3/sun3x/locore2.c |  13 +++++++++++--
 3 files changed, 24 insertions(+), 13 deletions(-)

diffs (128 lines):

diff -r b3c14d9fd939 -r 5d85bc332a42 sys/arch/sun3/dev/zs.c
--- a/sys/arch/sun3/dev/zs.c    Fri Aug 10 14:23:05 2012 +0000
+++ b/sys/arch/sun3/dev/zs.c    Fri Aug 10 14:33:35 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zs.c,v 1.87 2012/07/29 00:07:53 matt Exp $     */
+/*     $NetBSD: zs.c,v 1.88 2012/08/10 14:33:35 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.87 2012/07/29 00:07:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.88 2012/08/10 14:33:35 tsutsui Exp $");
 
 #include "opt_kgdb.h"
 
@@ -674,13 +674,6 @@
        nullcnpollc,
 };
 
-/*
- * 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 
 nullcnprobe(struct consdev *cn)
 {
diff -r b3c14d9fd939 -r 5d85bc332a42 sys/arch/sun3/sun3/locore2.c
--- a/sys/arch/sun3/sun3/locore2.c      Fri Aug 10 14:23:05 2012 +0000
+++ b/sys/arch/sun3/sun3/locore2.c      Fri Aug 10 14:33:35 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore2.c,v 1.99 2010/10/15 15:55:53 tsutsui Exp $     */
+/*     $NetBSD: locore2.c,v 1.100 2012/08/10 14:33:35 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.99 2010/10/15 15:55:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.100 2012/08/10 14:33:35 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>
@@ -304,6 +306,7 @@
 void 
 _bootstrap(void)
 {
+       extern struct consdev consdev_prom;     /* XXX */
 
        /* First, Clear BSS. */
        memset(edata, 0, end - edata);
@@ -311,6 +314,12 @@
        /* Set v_handler, get boothowto. */
        sunmon_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 b3c14d9fd939 -r 5d85bc332a42 sys/arch/sun3/sun3x/locore2.c
--- a/sys/arch/sun3/sun3x/locore2.c     Fri Aug 10 14:23:05 2012 +0000
+++ b/sys/arch/sun3/sun3x/locore2.c     Fri Aug 10 14:33:35 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore2.c,v 1.38 2009/11/30 16:09:14 he Exp $  */
+/*     $NetBSD: locore2.c,v 1.39 2012/08/10 14:33:35 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.38 2009/11/30 16:09:14 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.39 2012/08/10 14:33:35 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -43,6 +43,8 @@
 
 #include <uvm/uvm_extern.h>
 
+#include <dev/cons.h>
+
 #include <machine/cpu.h>
 #include <machine/db_machdep.h>
 #include <machine/dvma.h>
@@ -192,6 +194,7 @@
 void 
 _bootstrap(void)
 {
+       extern struct consdev consdev_prom;     /* XXX */
 
        /* First, Clear BSS. */
        memset(edata, 0, end - edata);
@@ -199,6 +202,12 @@
        /* Set v_handler, get boothowto. */
        sunmon_init();
 
+       /*
+        * Initialize console to point to the PROM (output only) table
+        * for early printf calls.
+        */
+       cn_tab = &consdev_prom;
+
        /* Handle kernel mapping, pmap_bootstrap(), etc. */
        _vm_init();
 



Home | Main Index | Thread Index | Old Index