From 2294df2c80d80721770dd8c60f5dcb1c55efc428 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 14 Dec 2004 16:28:00 +0000 Subject: [PATCH] Move the definition of sccA from zc.c to machdep.c and always initialize it. This way we save a mess of #ifdefs. XXX: This code is disgusting. Drivers should not communicate with the rest of the kernel by means of global variables. --- sys/arch/mac68k/dev/zs.c | 6 +++--- sys/arch/mac68k/mac68k/machdep.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/arch/mac68k/dev/zs.c b/sys/arch/mac68k/dev/zs.c index 3f0627ee26ff..73b635d7e5ef 100644 --- a/sys/arch/mac68k/dev/zs.c +++ b/sys/arch/mac68k/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.44 2003/12/04 13:05:16 keihan Exp $ */ +/* $NetBSD: zs.c,v 1.45 2004/12/14 16:28:00 christos Exp $ */ /* * Copyright (c) 1996-1998 Bill Studenmund @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.44 2003/12/04 13:05:16 keihan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.45 2004/12/14 16:28:00 christos Exp $"); #include "opt_ddb.h" #include "opt_mac68k.h" @@ -145,7 +145,7 @@ int zs_cons_canabort = 0; /* device to which the console is attached--if serial. */ dev_t mac68k_zsdev; /* Mac stuff */ -volatile unsigned char *sccA = 0; +extern volatile unsigned char *sccA; int zs_cn_check_speed __P((int bps)); diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index 187e4acc7df0..320453e1c199 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.299 2004/08/02 03:44:39 scottr Exp $ */ +/* $NetBSD: machdep.c,v 1.300 2004/12/14 16:28:00 christos Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -107,7 +107,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.299 2004/08/02 03:44:39 scottr Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.300 2004/12/14 16:28:00 christos Exp $"); #include "opt_adb.h" #include "opt_ddb.h" @@ -279,6 +279,12 @@ void nmihand __P((struct frame)); */ cpu_kcore_hdr_t cpu_kcore_hdr; +/* + * XXX: For zs serial driver. We always initialize the base address + * to avoid a bunch of #ifdefs. + */ +volatile unsigned char *sccA = 0; + /* * Early initialization, before main() is called. */ @@ -2267,9 +2273,6 @@ void mac68k_set_io_offsets(base) vaddr_t base; { -#if NZSC > 0 - extern volatile u_char *sccA; -#endif switch (current_mac_model->class) { case MACH_CLASSQ: