Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Revert revision 1.159. The correct answer was no...



details:   https://anonhg.NetBSD.org/src/rev/169efb945ad2
branches:  trunk
changeset: 472028:169efb945ad2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Apr 18 22:02:47 1999 +0000

description:
Revert revision 1.159.  The correct answer was not to re-break the
serial console support, but rather to fix the Shark delay().

diffstat:

 sys/dev/ic/com.c |  25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diffs (53 lines):

diff -r f54b1e54416d -r 169efb945ad2 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Sun Apr 18 21:01:57 1999 +0000
+++ b/sys/dev/ic/com.c  Sun Apr 18 22:02:47 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com.c,v 1.159 1999/03/31 12:44:04 mrg Exp $    */
+/*     $NetBSD: com.c,v 1.160 1999/04/18 22:02:47 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -223,6 +223,10 @@
 #define        COM_ISALIVE(sc) ((sc)->enabled != 0 && \
                         ISSET((sc)->sc_dev.dv_flags, DVF_ACTIVE))
 
+#define        BR      BUS_SPACE_BARRIER_READ
+#define        BW      BUS_SPACE_BARRIER_WRITE
+#define COM_BARRIER(t, h, f) bus_space_barrier((t), (h), 0, COM_NPORTS, (f))
+
 int
 comspeed(speed, frequency)
        long speed, frequency;
@@ -2170,24 +2174,21 @@
        int c;
 {
        int s = splserial();
-       u_char stat;
        int timo;
 
        /* wait for any pending transmission to finish */
-       timo = 50000;
-       while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY)
-           && --timo)
-               ;
+       timo = 1500;
+       while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo)
+               delay(100);
 
        bus_space_write_1(iot, ioh, com_data, c);
+       COM_BARRIER(iot, ioh, BR | BW);
+
        /* wait for this transmission to complete */
-       timo = 1500000;
-       while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY)
-           && --timo)
-               ;
+       timo = 15000;
+       while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo)
+               delay(100);
 
-       /* clear any interrupts generated by this transmission */
-       stat = bus_space_read_1(iot, ioh, com_iir);
        splx(s);
 }
 



Home | Main Index | Thread Index | Old Index