From 98fbf78b776af38a4b050a83774ecd57d1cfee39 Mon Sep 17 00:00:00 2001 From: briggs Date: Sun, 13 Oct 1996 15:29:10 +0000 Subject: * Fix from Bill Studenmund for transmission lockups. Changes from NetBSD: - Add a ZS_CONSOLE_ABORT option to enable a serial console break to force a drop to the system debugger. WARNING: this used to be the default behavior! Modify custom kernel configs accordingly. - Check for ZS_HWFLAG_CONABRT in zs_abort(), and don't abort if it's not set. - ttystop function returns void. --- sys/arch/mac68k/dev/z8530sc.h | 4 ++-- sys/arch/mac68k/dev/z8530tty.c | 23 +++++++++++------------ sys/arch/mac68k/dev/zs.c | 16 +++++++++++----- 3 files changed, 24 insertions(+), 19 deletions(-) (limited to 'sys') diff --git a/sys/arch/mac68k/dev/z8530sc.h b/sys/arch/mac68k/dev/z8530sc.h index 4aff44f723b..8e94386398b 100644 --- a/sys/arch/mac68k/dev/z8530sc.h +++ b/sys/arch/mac68k/dev/z8530sc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530sc.h,v 1.2 1996/09/02 15:50:35 briggs Exp $ */ +/* $OpenBSD: z8530sc.h,v 1.3 1996/10/13 15:29:07 briggs Exp $ */ /* $NetBSD: z8530sc.h,v 1.1 1996/05/18 18:54:30 briggs Exp $ */ /* @@ -117,7 +117,7 @@ struct zs_chanstate { u_char cs_heldchange; /* change pending (creg != preg) */ u_char cs_rr0; /* last rr0 processed */ - u_char cs_rr0_new; /* rr0 saved in status interrupt. */ + u_char cs_rr0_changes; /* rr0 changes noted in status int. */ char cs_softreq; /* need soft interrupt call */ char cs_chip; /* type of chip */ diff --git a/sys/arch/mac68k/dev/z8530tty.c b/sys/arch/mac68k/dev/z8530tty.c index 2ebf29f0465..3b09e9432e0 100644 --- a/sys/arch/mac68k/dev/z8530tty.c +++ b/sys/arch/mac68k/dev/z8530tty.c @@ -1,5 +1,5 @@ -/* $OpenBSD: z8530tty.c,v 1.3 1996/09/02 15:50:35 briggs Exp $ */ -/* $NetBSD: z8530tty.c,v 1.3 1996/06/01 00:13:41 scottr Exp $ */ +/* $OpenBSD: z8530tty.c,v 1.4 1996/10/13 15:29:08 briggs Exp $ */ +/* $NetBSD: z8530tty.c,v 1.7 1996/10/13 03:21:30 christos Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -615,13 +615,14 @@ zsstart(tp) selwakeup(&tp->t_wsel); } + (void) splzs(); + nch = ndqb(&tp->t_outq, 0); /* XXX */ if (nch) { register char *p = tp->t_outq.c_cf; /* mark busy, enable tx done interrupts, & send first byte */ tp->t_state |= TS_BUSY; - (void) splzs(); cs->cs_preg[1] |= ZSWR1_TIE; cs->cs_creg[1] = cs->cs_preg[1]; @@ -634,7 +635,6 @@ zsstart(tp) * Nothing to send, turn off transmit done interrupts. * This is useful if something is doing polled output. */ - (void) splzs(); cs->cs_preg[1] &= ~ZSWR1_TIE; cs->cs_creg[1] = cs->cs_preg[1]; zs_write_reg(cs, 1, cs->cs_creg[1]); @@ -646,7 +646,7 @@ out: /* * Stop output, e.g., for ^S or output flush. */ -int +void zsstop(tp, flag) struct tty *tp; int flag; @@ -669,7 +669,6 @@ zsstop(tp, flag) tp->t_state |= TS_FLUSH; } splx(s); - return (0); } #ifndef ZS_TOLERANCE @@ -1238,8 +1237,7 @@ zstty_stint(cs) * Check here for console break, so that we can abort * even when interrupts are locking up the machine. */ - if ((rr0 & ZSRR0_BREAK) && - (zst->zst_hwflags & ZS_HWFLAG_CONABRT)) + if ((rr0 & ZSRR0_BREAK)) { zs_abort(zst); return; @@ -1258,7 +1256,8 @@ zstty_stint(cs) zst->zst_tx_stopped = 1; } - cs->cs_rr0_new = rr0; + cs->cs_rr0_changes |= cs->cs_rr0 ^ rr0; + cs->cs_rr0 = rr0; zst->zst_st_check = 1; /* Ask for softint() call. */ @@ -1380,9 +1379,9 @@ zstty_softint(cs) if (zst->zst_st_check) { zst->zst_st_check = 0; - rr0 = cs->cs_rr0_new; - delta = rr0 ^ cs->cs_rr0; - cs->cs_rr0 = rr0; + rr0 = cs->cs_rr0; + delta = cs->cs_rr0_changes; + cs->cs_rr0_changes = 0; if ((delta & ZSRR0_DCD) && ~(zst->zst_hwflags & ZS_HWFLAG_IGDCD)) { c = ((rr0 & ZSRR0_DCD) != 0); diff --git a/sys/arch/mac68k/dev/zs.c b/sys/arch/mac68k/dev/zs.c index 5e0876e70e7..9bf0a6dcd00 100644 --- a/sys/arch/mac68k/dev/zs.c +++ b/sys/arch/mac68k/dev/zs.c @@ -1,5 +1,5 @@ -/* $OpenBSD: zs.c,v 1.4 1996/06/09 03:17:48 briggs Exp $ */ -/* $NetBSD: zs.c,v 1.5 1996/06/09 04:27:59 briggs Exp $ */ +/* $OpenBSD: zs.c,v 1.5 1996/10/13 15:29:09 briggs Exp $ */ +/* $NetBSD: zs.c,v 1.10 1996/10/13 03:21:31 christos Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -185,7 +185,7 @@ static u_char zs_init_reg[16] = { /* Definition of the driver for autoconfig. */ static int zsc_match __P((struct device *, void *, void *)); static void zsc_attach __P((struct device *, struct device *, void *)); -static int zsc_print __P((void *aux, char *name)); +static int zsc_print __P((void *aux, const char *name)); struct cfattach zsc_ca = { sizeof(struct zsc_softc), zsc_match, zsc_attach @@ -214,7 +214,7 @@ zsc_match(parent, vcf, aux) static int zsc_print(aux, name) void *aux; - char *name; + const char *name; { struct zsc_attach_args *args = aux; @@ -678,7 +678,10 @@ zscninit(struct consdev * cp) mac68k_set_io_offsets(IOBase); zs_conschan = (struct zschan *) -1; zs_consunit = chan; - zs_hwflags[0][zs_consunit] = ZS_HWFLAG_CONSOLE | ZS_HWFLAG_CONABRT; + zs_hwflags[0][zs_consunit] = ZS_HWFLAG_CONSOLE; +#ifdef ZS_CONSOLE_ABORT + zs_hwflags[0][zs_consunit] |= ZS_HWFLAG_CONABRT; +#endif zs_init(); /* * zsinit will set up the addresses of the scc. It will also, if @@ -784,6 +787,9 @@ zs_abort(zst) int rr0; register long wait = 0; + if ((zst->zst_hwflags & ZS_HWFLAG_CONABRT) == 0) + return; + /* Wait for end of break to avoid PROM abort. */ /* XXX - Limit the wait? */ do { -- cgit v1.2.3