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.
This commit is contained in:
christos 2004-12-14 16:28:00 +00:00
parent 0127e87a6e
commit 2294df2c80
2 changed files with 11 additions and 8 deletions

View File

@ -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 <sys/cdefs.h>
__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));

View File

@ -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 <sys/cdefs.h>
__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: