Module Name: src Committed By: tsutsui Date: Fri Aug 10 14:33:35 UTC 2012
Modified Files: src/sys/arch/sun3/dev: zs.c src/sys/arch/sun3/sun3: locore2.c src/sys/arch/sun3/sun3x: locore2.c Log Message: 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" To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/sun3/dev/zs.c cvs rdiff -u -r1.99 -r1.100 src/sys/arch/sun3/sun3/locore2.c cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sun3/sun3x/locore2.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/sun3/dev/zs.c diff -u src/sys/arch/sun3/dev/zs.c:1.87 src/sys/arch/sun3/dev/zs.c:1.88 --- src/sys/arch/sun3/dev/zs.c:1.87 Sun Jul 29 00:07:53 2012 +++ src/sys/arch/sun3/dev/zs.c Fri Aug 10 14:33:35 2012 @@ -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 @@ struct consdev consdev_prom = { 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) { Index: src/sys/arch/sun3/sun3/locore2.c diff -u src/sys/arch/sun3/sun3/locore2.c:1.99 src/sys/arch/sun3/sun3/locore2.c:1.100 --- src/sys/arch/sun3/sun3/locore2.c:1.99 Fri Oct 15 15:55:53 2010 +++ src/sys/arch/sun3/sun3/locore2.c Fri Aug 10 14:33:35 2012 @@ -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 @@ __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> @@ -304,6 +306,7 @@ _verify_hardware(void) void _bootstrap(void) { + extern struct consdev consdev_prom; /* XXX */ /* First, Clear BSS. */ memset(edata, 0, end - edata); @@ -311,6 +314,12 @@ _bootstrap(void) /* 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(); Index: src/sys/arch/sun3/sun3x/locore2.c diff -u src/sys/arch/sun3/sun3x/locore2.c:1.38 src/sys/arch/sun3/sun3x/locore2.c:1.39 --- src/sys/arch/sun3/sun3x/locore2.c:1.38 Mon Nov 30 16:09:14 2009 +++ src/sys/arch/sun3/sun3x/locore2.c Fri Aug 10 14:33:35 2012 @@ -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 @@ __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> @@ -192,6 +194,7 @@ _vm_init(void) void _bootstrap(void) { + extern struct consdev consdev_prom; /* XXX */ /* First, Clear BSS. */ memset(edata, 0, end - edata); @@ -199,6 +202,12 @@ _bootstrap(void) /* 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();