PERFORCE change 37555 for review
    Marcel Moolenaar 
    marcel at FreeBSD.org
       
    Fri Sep  5 00:04:57 PDT 2003
    
    
  
http://perforce.freebsd.org/chv.cgi?CH=37555
Change 37555 by marcel at 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;
    
    
More information about the p4-projects
mailing list