From owner-p4-projects@FreeBSD.ORG Fri Sep 5 00:04:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DFE0716A4C1; Fri, 5 Sep 2003 00:04:56 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BD2F16A4BF for ; Fri, 5 Sep 2003 00:04:56 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E33143F75 for ; Fri, 5 Sep 2003 00:04:56 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h8574t0U091755 for ; Fri, 5 Sep 2003 00:04:55 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h8574tMk091752 for perforce@freebsd.org; Fri, 5 Sep 2003 00:04:55 -0700 (PDT) Date: Fri, 5 Sep 2003 00:04:55 -0700 (PDT) Message-Id: <200309050704.h8574tMk091752@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 37555 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2003 07:04:57 -0000 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;