Date: Fri, 5 Sep 2003 00:04:55 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 37555 for review Message-ID: <200309050704.h8574tMk091752@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=37555 Change 37555 by marcel@marcel_nfs on 2003/09/05 00:04:10 Slightly change how sc_hwsig is to be used. We allow direct reads of even the DCE signals if accuracy is not of the highest importance. This, for example, applies to the TIOCMGET ioctl. The reason for this is that we avoid using UART_GETSIG() gratuitously. Since UART_GETSIG() gets the signals from the UART itself, it not only has the side-effect of clearing the delta bits, but also to suppress interrupts. We don't want that. Now that sc->sc_hwsig is updated atomically, any (atomic) read will yield a true representation of how signals are or have been without affecting the operation of the UART itself. Affected files ... .. //depot/projects/uart/dev/uart/uart_tty.c#14 edit Differences ... ==== //depot/projects/uart/dev/uart/uart_tty.c#14 (text+ko) ==== @@ -425,7 +425,7 @@ /* * Handle initial DCD. */ - if ((UART_GETSIG(sc) & UART_SIG_DCD) || sc->sc_callout) + if ((sc->sc_hwsig & UART_SIG_DCD) || sc->sc_callout) (*linesw[tp->t_line].l_modem)(tp, 1); } /* @@ -546,7 +546,7 @@ UART_SETSIG(sc, sig); break; case TIOCMGET: - sig = UART_GETSIG(sc); + sig = sc->sc_hwsig; bits = TIOCM_LE; if (sig & UART_SIG_DTR) bits |= TIOCM_DTR;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309050704.h8574tMk091752>