Eliminate cs_heldchar. It is not necessary in my version of the driver.

This commit is contained in:
mycroft 1998-03-30 02:41:21 +00:00
parent 90abe03d9c
commit d4da63c6c3
3 changed files with 7 additions and 43 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.58 1998/03/29 22:10:33 pk Exp $ */
/* $NetBSD: zs.c,v 1.59 1998/03/30 02:41:21 mycroft Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -106,14 +106,6 @@ int zs_major = 12;
# error "no suitable software interrupt bit"
#endif
/*
* The next three variables provide a shortcut to the channel state
* structure used by zscnputc().
*/
int zs_console_unit = -1;
int zs_console_channel = -1;
struct zs_chanstate *zs_conschanstate;
#define ZS_DELAY() (CPU_ISSUN4C ? (0) : delay(2))
/* The layout of this is hardware-dependent (padding, order). */
@ -334,10 +326,6 @@ zs_attach(zsc, pri)
zsc_args.hwflags = zs_hwflags[zs_unit][channel];
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
if (zs_unit == zs_console_unit &&
channel == zs_console_channel) {
zs_conschanstate = cs;
}
cs->cs_channel = channel;
cs->cs_private = NULL;
@ -758,34 +746,16 @@ zs_putc(arg, c)
register int s, rr0;
s = splhigh();
/* Wait for transmitter to become ready. */
do {
rr0 = zc->zc_csr;
ZS_DELAY();
} while ((rr0 & ZSRR0_TX_READY) == 0);
/*
* If the transmitter was busy doing regular tty I/O (ZSWR1_TIE on),
* defer our output until the transmit interrupt runs. We still
* sync with TX_READY so we can get by with a single-char "queue".
*/
if (zs_conschanstate && (zs_conschanstate->cs_preg[1] & ZSWR1_TIE)) {
/*
* If a previous held character has not yet gone out, we can
* send it now; zsxint() will field the interrupt for our
* char, but doesn't care. We're running at sufficiently
* high spl for this to work.
*/
if (zs_conschanstate->cs_heldchar != 0)
zc->zc_data = zs_conschanstate->cs_heldchar;
zs_conschanstate->cs_heldchar = c;
ZS_DELAY();
splx(s);
return;
}
zc->zc_data = c;
ZS_DELAY();
splx(s);
}
@ -1064,8 +1034,6 @@ setup_console:
cn = &consdev_tty;
cn->cn_dev = makedev(zs_major, zstty_unit);
cn->cn_pri = CN_REMOTE;
zs_console_unit = zs_unit;
zs_console_channel = channel;
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: z8530sc.h,v 1.9 1997/11/12 22:17:07 pk Exp $ */
/* $NetBSD: z8530sc.h,v 1.10 1998/03/30 02:41:22 mycroft Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@ -109,7 +109,7 @@ struct zs_chanstate {
char cs_softreq; /* need soft interrupt call */
char cs_spare1; /* (for skippy :) */
char cs_heldchar; /* pending polled output (console I/O)*/
char cs_spare2; /* (for skippy :) */
/* MD code might define a larger variant of this. */
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: z8530tty.c,v 1.47 1998/03/22 00:55:37 mycroft Exp $ */
/* $NetBSD: z8530tty.c,v 1.48 1998/03/30 02:41:22 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998
@ -1166,11 +1166,7 @@ zstty_txint(cs)
}
/* Output the next character in the buffer, if any. */
if (cs->cs_heldchar != 0) {
/* An "out-of-band" character is waiting to be output */
zs_write_data(cs, cs->cs_heldchar);
cs->cs_heldchar = 0;
} else if (zst->zst_tbc > 0) {
if (zst->zst_tbc > 0) {
zs_write_data(cs, *zst->zst_tba);
zst->zst_tbc--;
zst->zst_tba++;