diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-12-19 01:22:41 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-12-19 01:22:41 +0000 |
commit | 5c00e4c53fe036f2ea2d92935cff666a7645af68 (patch) | |
tree | d68248cbabe7ef28261feb9ec64feedf7e0bcb8c /sys/dev/ic | |
parent | 614af33d6f618e1f0274bcef2762266ff6c2f85e (diff) |
comparam() does not need an spltty() for it, already called there.
time-bound loops in com_common_cnputc() and lower to spltty(),
which i guess is left from times when timeouts were processed at splhigh().
jason@ tested and ok, art@ ok
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/com.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 2320adbf530..3d29112b1ee 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.87 2002/10/17 22:11:02 art Exp $ */ +/* $OpenBSD: com.c,v 1.88 2002/12/19 01:22:40 mickey Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -919,6 +919,7 @@ comioctl(dev, cmd, data, flag, p) return 0; } +/* already called at spltty */ int comparam(tp, t) struct tty *tp; @@ -930,7 +931,6 @@ comparam(tp, t) int ospeed = comspeed(sc->sc_frequency, t->c_ospeed); u_char lcr; tcflag_t oldcflag; - int s; /* check requested parameters */ if (ospeed < 0 || (t->c_ispeed && t->c_ispeed != t->c_ospeed)) @@ -962,8 +962,6 @@ comparam(tp, t) sc->sc_lcr = lcr; - s = spltty(); - if (ospeed == 0) { CLR(sc->sc_mcr, MCR_DTR); bus_space_write_1(iot, ioh, com_mcr, sc->sc_mcr); @@ -993,7 +991,6 @@ comparam(tp, t) TTOPRI | PCATCH, "comprm", 0); --sc->sc_halt; if (error) { - splx(s); comstart(tp); return (error); } @@ -1060,7 +1057,6 @@ comparam(tp, t) } /* Just to be sure... */ - splx(s); comstart(tp); return 0; } @@ -1420,22 +1416,22 @@ com_common_putc(iot, ioh, c) bus_space_handle_t ioh; int c; { - int s = splhigh(); + int s = spltty(); int timo; /* wait for any pending transmission to finish */ - timo = 150000; + timo = 2000; while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo) - continue; + delay(1); bus_space_write_1(iot, ioh, com_data, c); bus_space_barrier(iot, ioh, 0, COM_NPORTS, (BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE)); /* wait for this transmission to complete */ - timo = 1500000; + timo = 2000; while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo) - continue; + delay(1); splx(s); } |