diff options
-rw-r--r-- | sys/arch/sparc/dev/zs.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c index ec83c5e7e54..ad8537224fa 100644 --- a/sys/arch/sparc/dev/zs.c +++ b/sys/arch/sparc/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.23 2000/06/28 20:22:14 mjacob Exp $ */ +/* $OpenBSD: zs.c,v 1.24 2000/07/07 11:51:24 art Exp $ */ /* $NetBSD: zs.c,v 1.49 1997/08/31 21:26:37 pk Exp $ */ /* @@ -469,18 +469,13 @@ static void zscnputc(c) int c; { - register volatile struct zschan *zc = zs_conschan; - register int s; + volatile struct zschan *zc = zs_conschan; + int s; if (c == '\n') zscnputc('\r'); - /* - * Must block output interrupts (i.e., raise to >= splzs) without - * lowering current ipl. Need a better way. - */ - s = splhigh(); - if (CPU_ISSUN4C && s <= (12 << 8)) /* XXX */ - (void) splzs(); + + s = splzs(); while ((zc->zc_csr & ZSRR0_TX_READY) == 0) ZS_DELAY(); /* @@ -873,10 +868,10 @@ int zshard(intrarg) void *intrarg; { - register struct zs_chanstate *a; + struct zs_chanstate *a; #define b (a + 1) - register volatile struct zschan *zc; - register int rr3, intflags = 0, v, i, ringmask; + volatile struct zschan *zc; + int rr3, intflags = 0, v, i, ringmask; #define ZSHARD_NEED_SOFTINTR 1 #define ZSHARD_WAS_SERVICED 2 @@ -885,6 +880,8 @@ zshard(intrarg) for (a = zslist; a != NULL; a = b->cs_next) { ringmask = a->cs_ringmask; rr3 = ZS_READ(a->cs_zc, 3); + if (rr3) + intflags |= ZSHARD_WAS_SERVICED; if (rr3 & (ZSRR3_IP_A_RX|ZSRR3_IP_A_TX|ZSRR3_IP_A_STAT)) { intflags |= (ZSHARD_CHIP_GOTINTR|ZSHARD_WAS_SERVICED); zc = a->cs_zc; @@ -929,6 +926,10 @@ zshard(intrarg) #undef b if (intflags & ZSHARD_NEED_SOFTINTR) { +#if 0 /* + * seems to break things and will not work when spl* are + * converted to be only raising. + */ if (CPU_ISSUN4COR4M) { /* XXX -- but this will go away when zshard moves to locore.s */ struct clockframe *p = intrarg; @@ -943,6 +944,7 @@ zshard(intrarg) return (zssoft(intrarg)); } } +#endif #if defined(SUN4M) if (CPU_ISSUN4M) @@ -951,7 +953,7 @@ zshard(intrarg) #endif ienab_bis(IE_ZSSOFT); } - return (intflags & ZSHARD_WAS_SERVICED); + return (intflags & ZSHARD_WAS_SERVICED) ? 1 : 0 /* -1 XXX */; } static int @@ -1415,7 +1417,7 @@ zsstart(tp) register struct tty *tp; { register struct zs_chanstate *cs; - register int s, nch; + register int s, ss, nch; int unit = DEVUNIT(tp->t_dev); struct zs_softc *sc = zs_cd.cd_devs[unit >> 1]; @@ -1441,12 +1443,12 @@ zsstart(tp) } nch = ndqb(&tp->t_outq, 0); /* XXX */ + ss = splzs(); 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] |= ZSWR1_TIE; ZS_WRITE(cs->cs_zc, 1, cs->cs_creg[1]); @@ -1459,11 +1461,11 @@ 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] &= ~ZSWR1_TIE; ZS_WRITE(cs->cs_zc, 1, cs->cs_creg[1]); } + splx(ss); out: splx(s); } |