Source-Changes-HG archive

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

[src/trunk]: src/sys/net/agr hardclock_ticks -> getticks()



details:   https://anonhg.NetBSD.org/src/rev/c041667aff6c
branches:  trunk
changeset: 932778:c041667aff6c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri May 15 19:28:09 2020 +0000

description:
hardclock_ticks -> getticks()

diffstat:

 sys/arch/arm/sunxi/sun8i_crypto.c   |   8 ++++----
 sys/dev/i2c/ibmhawk.c               |   8 ++++----
 sys/dev/ic/ciss.c                   |   8 ++++----
 sys/dev/usb/if_cdce.c               |   7 ++++---
 sys/fs/puffs/puffs_msgif.c          |   6 +++---
 sys/fs/puffs/puffs_vnops.c          |  12 ++++++------
 sys/net/agr/ieee8023ad_lacp_sm_tx.c |   8 ++++----
 7 files changed, 29 insertions(+), 28 deletions(-)

diffs (237 lines):

diff -r 18a5796252cf -r c041667aff6c sys/arch/arm/sunxi/sun8i_crypto.c
--- a/sys/arch/arm/sunxi/sun8i_crypto.c Fri May 15 19:07:01 2020 +0000
+++ b/sys/arch/arm/sunxi/sun8i_crypto.c Fri May 15 19:28:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sun8i_crypto.c,v 1.13 2020/04/30 03:40:53 riastradh Exp $      */
+/*     $NetBSD: sun8i_crypto.c,v 1.14 2020/05/15 19:28:09 maxv Exp $   */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.13 2020/04/30 03:40:53 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.14 2020/05/15 19:28:09 maxv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -614,7 +614,7 @@
 
        /* Loaded up and ready to go.  Start a timer ticking.  */
        sc->sc_chan[i].cc_task = task;
-       sc->sc_chan[i].cc_starttime = atomic_load_relaxed(&hardclock_ticks);
+       sc->sc_chan[i].cc_starttime = getticks();
        callout_schedule(&sc->sc_timeout, SUN8I_CRYPTO_TIMEOUT);
 
        /* XXX Consider polling if cold to get entropy earlier.  */
@@ -725,7 +725,7 @@
        sc->sc_esr = 0;
 
        /* Check the time to determine what's timed out.  */
-       now = atomic_load_relaxed(&hardclock_ticks);
+       now = getticks();
 
        /* Process the channels.  */
        for (i = 0; i < SUN8I_CRYPTO_NCHAN; i++) {
diff -r 18a5796252cf -r c041667aff6c sys/dev/i2c/ibmhawk.c
--- a/sys/dev/i2c/ibmhawk.c     Fri May 15 19:07:01 2020 +0000
+++ b/sys/dev/i2c/ibmhawk.c     Fri May 15 19:28:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ibmhawk.c,v 1.8 2018/09/03 16:29:31 riastradh Exp $ */
+/* $NetBSD: ibmhawk.c,v 1.9 2020/05/15 19:28:09 maxv Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -365,13 +365,13 @@
        struct ibmhawk_softc *sc = sme->sme_cookie;
 
        /* No more than two refreshes per second. */
-       if (hardclock_ticks-sc->sc_refresh < hz/2)
+       if (getticks() - sc->sc_refresh < hz/2)
                return;
 #if IBMHAWK_DEBUG > 1
        aprint_normal_dev(sc->sc_dev, "refresh \"%s\" delta %d\n",
-           edata->desc, hardclock_ticks-sc->sc_refresh);
+           edata->desc, getticks() - sc->sc_refresh);
 #endif
-       sc->sc_refresh = hardclock_ticks;
+       sc->sc_refresh = getticks();
        ibmhawk_refreshall(sc, false);
 }
 
diff -r 18a5796252cf -r c041667aff6c sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Fri May 15 19:07:01 2020 +0000
+++ b/sys/dev/ic/ciss.c Fri May 15 19:28:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss.c,v 1.41 2019/11/10 21:16:35 chs Exp $    */
+/*     $NetBSD: ciss.c,v 1.42 2020/05/15 19:28:10 maxv Exp $   */
 /*     $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $       */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.41 2019/11/10 21:16:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.42 2020/05/15 19:28:10 maxv Exp $");
 
 #include "bio.h"
 
@@ -501,7 +501,7 @@
        tohz = mstohz(ms);
        if (tohz == 0)
                tohz = 1;
-       etick = hardclock_ticks + tohz;
+       etick = getticks() + tohz;
 
        for (;;) {
                ccb->ccb_state = CISS_CCB_POLL;
@@ -517,7 +517,7 @@
                        ciss_done(ccb);
                        return 0;
                }
-               tohz = etick - hardclock_ticks;
+               tohz = etick - getticks();
                if (tohz <= 0)
                        return EWOULDBLOCK;
                CISS_DPRINTF(CISS_D_CMD, ("T"));
diff -r 18a5796252cf -r c041667aff6c sys/dev/usb/if_cdce.c
--- a/sys/dev/usb/if_cdce.c     Fri May 15 19:07:01 2020 +0000
+++ b/sys/dev/usb/if_cdce.c     Fri May 15 19:28:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cdce.c,v 1.71 2020/05/08 06:24:28 skrll Exp $ */
+/*     $NetBSD: if_cdce.c,v 1.72 2020/05/15 19:28:10 maxv Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul%windriver.com@localhost>
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.71 2020/05/08 06:24:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.72 2020/05/15 19:28:10 maxv Exp $");
 
 #include <sys/param.h>
 
@@ -245,7 +245,8 @@
            ether_aton_r(un->un_eaddr, sizeof(un->un_eaddr), eaddr_str)) {
                aprint_normal_dev(self, "faking address\n");
                un->un_eaddr[0] = 0x2a;
-               memcpy(&un->un_eaddr[1], &hardclock_ticks, sizeof(uint32_t));
+               uint32_t ticks = getticks();
+               memcpy(&un->un_eaddr[1], &ticks, sizeof(ticks));
                un->un_eaddr[5] = (uint8_t)(device_unit(un->un_dev));
        }
 
diff -r 18a5796252cf -r c041667aff6c sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c        Fri May 15 19:07:01 2020 +0000
+++ b/sys/fs/puffs/puffs_msgif.c        Fri May 15 19:28:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_msgif.c,v 1.105 2020/02/23 15:46:40 ad Exp $     */
+/*     $NetBSD: puffs_msgif.c,v 1.106 2020/05/15 19:28:10 maxv Exp $   */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.105 2020/02/23 15:46:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.106 2020/05/15 19:28:10 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1046,7 +1046,7 @@
  * once the file server acknowledges a request
  */
 #define TIMED_OUT(expire) \
-    ((int)((unsigned int)hardclock_ticks - (unsigned int)expire) > 0)
+    ((int)((unsigned int)getticks() - (unsigned int)expire) > 0)
 void
 puffs_sop_thread(void *arg)
 {
diff -r 18a5796252cf -r c041667aff6c sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c        Fri May 15 19:07:01 2020 +0000
+++ b/sys/fs/puffs/puffs_vnops.c        Fri May 15 19:28:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_vnops.c,v 1.215 2020/04/23 21:47:07 ad Exp $     */
+/*     $NetBSD: puffs_vnops.c,v 1.216 2020/05/15 19:28:10 maxv Exp $   */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.215 2020/04/23 21:47:07 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.216 2020/05/15 19:28:10 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -40,7 +40,7 @@
 #include <sys/namei.h>
 #include <sys/vnode.h>
 #include <sys/proc.h>
-#include <sys/kernel.h> /* For hz, hardclock_ticks */
+#include <sys/kernel.h> /* For hz, getticks() */
 
 #include <uvm/uvm.h>
 
@@ -473,11 +473,11 @@
  */
 
 #define TTL_TO_TIMEOUT(ts) \
-    (hardclock_ticks + (ts->tv_sec * hz) + (ts->tv_nsec * hz / 1000000000))
+    (getticks() + (ts->tv_sec * hz) + (ts->tv_nsec * hz / 1000000000))
 #define TTL_VALID(ts) \
     ((ts != NULL) && !((ts->tv_sec == 0) && (ts->tv_nsec == 0)))
 #define TIMED_OUT(expire) \
-    ((int)((unsigned int)hardclock_ticks - (unsigned int)expire) > 0)
+    ((int)((unsigned int)getticks() - (unsigned int)expire) > 0)
 int
 puffs_vnop_lookup(void *v)
 {
@@ -661,7 +661,7 @@
                 * lifetime of busiest * nodes - with some limits.
                 */
                grace = 10 * puffs_sopreq_expire_timeout;
-               cpn->pn_cn_grace = hardclock_ticks + grace;
+               cpn->pn_cn_grace = getticks() + grace;
                vp = cvp;
        }
 
diff -r 18a5796252cf -r c041667aff6c sys/net/agr/ieee8023ad_lacp_sm_tx.c
--- a/sys/net/agr/ieee8023ad_lacp_sm_tx.c       Fri May 15 19:07:01 2020 +0000
+++ b/sys/net/agr/ieee8023ad_lacp_sm_tx.c       Fri May 15 19:28:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee8023ad_lacp_sm_tx.c,v 1.3 2005/12/11 12:24:54 christos Exp $       */
+/*     $NetBSD: ieee8023ad_lacp_sm_tx.c,v 1.4 2020/05/15 19:28:10 maxv Exp $   */
 
 /*-
  * Copyright (c)2005 YAMAMOTO Takashi,
@@ -27,13 +27,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ieee8023ad_lacp_sm_tx.c,v 1.3 2005/12/11 12:24:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee8023ad_lacp_sm_tx.c,v 1.4 2020/05/15 19:28:10 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
 #include <sys/mbuf.h>
 #include <sys/systm.h>
-#include <sys/kernel.h>        /* hardclock_ticks */
+#include <sys/kernel.h>        /* getticks() */
 
 #include <net/if.h>
 #include <net/if_ether.h>
@@ -67,7 +67,7 @@
        }
 
        /* rate limit */
-       now = hardclock_ticks;
+       now = getticks();
        if ((unsigned int)(now - lp->lp_last_lacpdu_sent) <=
            LACP_FAST_PERIODIC_TIME * hz / 3) {
                return;



Home | Main Index | Thread Index | Old Index