Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ir irframetty(4): Convert to ttylock/ttyunlock.



details:   https://anonhg.NetBSD.org/src/rev/841798626169
branches:  trunk
changeset: 372092:841798626169
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Oct 26 23:45:43 2022 +0000

description:
irframetty(4): Convert to ttylock/ttyunlock.

diffstat:

 sys/dev/ir/irframe_tty.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (63 lines):

diff -r 22a3f1bbf718 -r 841798626169 sys/dev/ir/irframe_tty.c
--- a/sys/dev/ir/irframe_tty.c  Wed Oct 26 23:45:25 2022 +0000
+++ b/sys/dev/ir/irframe_tty.c  Wed Oct 26 23:45:43 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irframe_tty.c,v 1.66 2022/05/24 20:50:19 andvar Exp $  */
+/*     $NetBSD: irframe_tty.c,v 1.67 2022/10/26 23:45:43 riastradh Exp $       */
 
 /*
  * TODO
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.66 2022/05/24 20:50:19 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.67 2022/10/26 23:45:43 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -313,9 +313,9 @@
 
        DPRINTF(("%s: set sc=%p\n", __func__, sc));
 
-       mutex_spin_enter(&tty_lock);
+       ttylock(tp);
        ttyflush(tp, FREAD | FWRITE);
-       mutex_spin_exit(&tty_lock);
+       ttyunlock(tp);
 
        sc->sc_dongle = DONGLE_NONE;
        sc->sc_dongle_private = 0;
@@ -341,9 +341,9 @@
        DPRINTF(("%s: tp=%p\n", __func__, tp));
 
        s = spltty();
-       mutex_spin_enter(&tty_lock);
+       ttylock(tp);
        ttyflush(tp, FREAD | FWRITE);
-       mutex_spin_exit(&tty_lock);      /* XXX */
+       ttyunlock(tp);   /* XXX */
        ttyldisc_release(tp->t_linesw);
        tp->t_linesw = ttyldisc_default(); if (sc != NULL) {
                irt_buffer(sc, 0);
@@ -684,17 +684,17 @@
 #endif
        if (tp->t_outq.c_cc > tp->t_hiwat) {
                irframetstart(tp);
-               mutex_spin_enter(&tty_lock);
+               ttylock(tp);
                /*
                 * This can only occur if FLUSHO is set in t_lflag,
                 * or if ttstart/oproc is synchronous (or very fast).
                 */
                if (tp->t_outq.c_cc <= tp->t_hiwat) {
-                       mutex_spin_exit(&tty_lock);
+                       ttyunlock(tp);
                        goto go;
                }
                error = ttysleep(tp, &tp->t_outcv, true, 0);
-               mutex_spin_exit(&tty_lock);
+               ttyunlock(tp);
                if (error)
                        return (error);
        }



Home | Main Index | Thread Index | Old Index