Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic - microtime -> microuptime



details:   https://anonhg.NetBSD.org/src/rev/ca6a10f052d3
branches:  trunk
changeset: 989909:ca6a10f052d3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Oct 20 01:09:49 2021 +0000

description:
- microtime -> microuptime
- avoid kpause with timeo=0

diffstat:

 sys/arch/evbarm/dev/plcom.c |  15 ++++++++-------
 sys/dev/ic/com.c            |  14 +++++++-------
 2 files changed, 15 insertions(+), 14 deletions(-)

diffs (92 lines):

diff -r 878b18887fba -r ca6a10f052d3 sys/arch/evbarm/dev/plcom.c
--- a/sys/arch/evbarm/dev/plcom.c       Tue Oct 19 21:39:19 2021 +0000
+++ b/sys/arch/evbarm/dev/plcom.c       Wed Oct 20 01:09:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: plcom.c,v 1.63 2021/10/17 22:34:17 jmcneill Exp $      */
+/*     $NetBSD: plcom.c,v 1.64 2021/10/20 01:09:49 jmcneill Exp $      */
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.63 2021/10/17 22:34:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.64 2021/10/20 01:09:49 jmcneill Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -686,7 +686,7 @@
         */
        if (ISSET(tp->t_cflag, HUPCL)) {
                plcom_modem(sc, 0);
-               microtime(&sc->sc_hup_pending);
+               microuptime(&sc->sc_hup_pending);
                sc->sc_hup_pending.tv_sec++;
        }
 
@@ -790,13 +790,14 @@
                }
 
                if (timerisset(&sc->sc_hup_pending)) {
-                       microtime(&now);
+                       microuptime(&now);
                        while (timercmp(&now, &sc->sc_hup_pending, <)) {
                                timersub(&sc->sc_hup_pending, &now, &diff);
                                const int ms = diff.tv_sec * 100 +
-                                   uimax(diff.tv_usec / 1000, 1);
-                               kpause(ttclos, false, mstohz(ms), &sc->sc_lock);
-                               microtime(&now);
+                                   diff.tv_usec / 1000;
+                               kpause(ttclos, false, uimax(mstohz(ms), 1),
+                                   &sc->sc_lock);
+                               microuptime(&now);
                        }
                        timerclear(&sc->sc_hup_pending);
                }
diff -r 878b18887fba -r ca6a10f052d3 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Tue Oct 19 21:39:19 2021 +0000
+++ b/sys/dev/ic/com.c  Wed Oct 20 01:09:49 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.369 2021/10/14 09:56:12 jmcneill Exp $ */
+/* $NetBSD: com.c,v 1.370 2021/10/20 01:09:49 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.369 2021/10/14 09:56:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.370 2021/10/20 01:09:49 jmcneill Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -891,7 +891,7 @@
         */
        if (ISSET(tp->t_cflag, HUPCL)) {
                com_modem(sc, 0);
-               microtime(&sc->sc_hup_pending);
+               microuptime(&sc->sc_hup_pending);
                sc->sc_hup_pending.tv_sec++;
        }
 
@@ -984,14 +984,14 @@
                }
 
                if (timerisset(&sc->sc_hup_pending)) {
-                       microtime(&now);
+                       microuptime(&now);
                        while (timercmp(&now, &sc->sc_hup_pending, <)) {
                                timersub(&sc->sc_hup_pending, &now, &diff);
                                const int ms = diff.tv_sec * 1000 +
-                                   uimax(diff.tv_usec / 1000, 1);
-                               kpause(ttclos, false, mstohz(ms),
+                                   diff.tv_usec / 1000;
+                               kpause(ttclos, false, uimax(mstohz(ms), 1),
                                    &sc->sc_lock);
-                               microtime(&now);
+                               microuptime(&now);
                        }
                        timerclear(&sc->sc_hup_pending);
                }



Home | Main Index | Thread Index | Old Index