Module Name: src
Committed By: tsutsui
Date: Fri Aug 10 12:48:14 UTC 2012
Modified Files:
src/sys/arch/luna68k/luna68k: machdep.c
Log Message:
Appease gcc -fno-common:
- initialize cn_tab at runtime in pre-main luna68k_init()
Tested on LUNA.
To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/luna68k/luna68k/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/luna68k/luna68k/machdep.c
diff -u src/sys/arch/luna68k/luna68k/machdep.c:1.92 src/sys/arch/luna68k/luna68k/machdep.c:1.93
--- src/sys/arch/luna68k/luna68k/machdep.c:1.92 Sat Jul 28 19:08:24 2012
+++ src/sys/arch/luna68k/luna68k/machdep.c Fri Aug 10 12:48:14 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.92 2012/07/28 19:08:24 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.93 2012/08/10 12:48:14 tsutsui Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.92 2012/07/28 19:08:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.93 2012/08/10 12:48:14 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -154,6 +154,13 @@ luna68k_init(void)
extern paddr_t avail_start, avail_end;
+ /* initialize cn_tab for early console */
+#if 1
+ cn_tab = &syscons;
+#else
+ cn_tab = &romcons;
+#endif
+
/*
* Tell the VM system about available physical memory. The
* luna68k only has one segment.
@@ -772,12 +779,7 @@ module_init_md(void)
}
#endif
-#if 1
-
-struct consdev *cn_tab = &syscons;
-
-#else
-
+#ifdef notyet
/*
* romcons is useful until m68k TC register is initialized.
*/
@@ -793,7 +795,6 @@ struct consdev romcons = {
makedev(7, 0), /* XXX */
CN_DEAD,
};
-struct consdev *cn_tab = &romcons;
#define __ ((int **)0x41000000)
#define GETC() (*(int (*)())__[6])()