Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/7a2e8ce080ae
branches:  trunk
changeset: 973535:7a2e8ce080ae
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Jul 03 16:23:02 2020 +0000

description:
hardclock_ticks -> getticks()

diffstat:

 sys/arch/amiga/dev/clock.c                          |   8 ++++----
 sys/arch/arm/at91/at91st.c                          |  13 ++++++-------
 sys/arch/arm/at91/at91tctmr.c                       |  12 ++++++------
 sys/arch/atari/dev/clock.c                          |   6 +++---
 sys/arch/vax/vax/clock.c                            |  16 ++++++++--------
 sys/external/bsd/common/include/linux/completion.h  |   6 +++---
 sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h |  14 +++++++-------
 sys/external/bsd/drm2/include/linux/sched.h         |   6 +++---
 sys/external/bsd/drm2/linux/linux_fence.c           |  12 ++++++------
 9 files changed, 46 insertions(+), 47 deletions(-)

diffs (truncated from 355 to 300 lines):

diff -r cb5ab855937d -r 7a2e8ce080ae sys/arch/amiga/dev/clock.c
--- a/sys/arch/amiga/dev/clock.c        Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/arch/amiga/dev/clock.c        Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.57 2020/05/29 05:35:47 rin Exp $ */
+/*     $NetBSD: clock.c,v 1.58 2020/07/03 16:23:03 maxv Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.57 2020/05/29 05:35:47 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.58 2020/07/03 16:23:03 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -292,9 +292,9 @@
        u_int counter;
 
        do {
-               cur_hardclock = hardclock_ticks;
+               cur_hardclock = getticks();
                counter = clk_gettick();
-       } while (cur_hardclock != hardclock_ticks);
+       } while (cur_hardclock != getticks());
 
        /*
         * Handle the situation of a wrapped interval counter, while
diff -r cb5ab855937d -r 7a2e8ce080ae sys/arch/arm/at91/at91st.c
--- a/sys/arch/arm/at91/at91st.c        Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/arch/arm/at91/at91st.c        Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: at91st.c,v 1.6 2012/11/12 18:00:36 skrll Exp $*/
+/*$NetBSD: at91st.c,v 1.7 2020/07/03 16:23:02 maxv Exp $*/
 
 /*
  * AT91RM9200 clock functions
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91st.c,v 1.6 2012/11/12 18:00:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91st.c,v 1.7 2020/07/03 16:23:02 maxv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -213,8 +213,8 @@
         /* call the kernel timer handler */
         hardclock((struct clockframe*) arg);
 #if 0
-        if (hardclock_ticks % (HZ * 10) == 0)
-            printf("time %i sec\n", hardclock_ticks/HZ);
+        if (getticks() % (HZ * 10) == 0)
+            printf("time %i sec\n", getticks()/HZ);
 #endif
         return 1;
     }
@@ -333,18 +333,17 @@
 
 
 #if 0
-extern int hardclock_ticks;
 static void tdelay(unsigned int ticks)
 {
     uint32_t   start, end, current;
     
-    current = hardclock_ticks;
+    current = getticks();
     start = current;
     end = start + ticks;
     
     /* just loop for the specified number of ticks */
     while (current < end)
-        current = hardclock_ticks;
+        current = getticks();
 }
 #endif
 
diff -r cb5ab855937d -r 7a2e8ce080ae sys/arch/arm/at91/at91tctmr.c
--- a/sys/arch/arm/at91/at91tctmr.c     Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/arch/arm/at91/at91tctmr.c     Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: at91tctmr.c,v 1.8 2020/05/29 12:30:38 rin Exp $*/
+/*$NetBSD: at91tctmr.c,v 1.9 2020/07/03 16:23:02 maxv Exp $*/
 
 /*
  * AT91 Timer Counter (TC) based clock functions
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91tctmr.c,v 1.8 2020/05/29 12:30:38 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91tctmr.c,v 1.9 2020/07/03 16:23:02 maxv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -302,20 +302,20 @@
     unsigned footick = (sc->sc_timerclock * 64ULL / 1000000UL);
 
     if (usec > 0) {
-      prev_ticks = hardclock_ticks;
+      prev_ticks = getticks();
       __insn_barrier();
       prev_cvr = READ_TC(sc, TC_CV);
-      ticks = hardclock_ticks;
+      ticks = getticks();
       __insn_barrier();
       if (ticks != prev_ticks) {
        prev_cvr = READ_TC(sc, TC_CV);
        prev_ticks = ticks;
       }
       for (;;) {
-       ticks = hardclock_ticks;
+       ticks = getticks();
        __insn_barrier();
        cvr = READ_TC(sc, TC_CV);
-       ticks2 = hardclock_ticks;
+       ticks2 = getticks();
        __insn_barrier();
        if (ticks2 != ticks) {
          cvr = READ_TC(sc, TC_CV);
diff -r cb5ab855937d -r 7a2e8ce080ae sys/arch/atari/dev/clock.c
--- a/sys/arch/atari/dev/clock.c        Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/arch/atari/dev/clock.c        Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.61 2020/05/29 12:30:39 rin Exp $   */
+/*     $NetBSD: clock.c,v 1.62 2020/07/03 16:23:03 maxv Exp $  */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.61 2020/05/29 12:30:39 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.62 2020/07/03 16:23:03 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -280,7 +280,7 @@
        static uint32_t lastcount;
 
        s = splhigh();
-       cur_hardclock = hardclock_ticks;
+       cur_hardclock = getticks();
        ipra = MFP->mf_ipra;
        tadr = MFP->mf_tadr;
        delta = divisor - tadr;
diff -r cb5ab855937d -r 7a2e8ce080ae sys/arch/vax/vax/clock.c
--- a/sys/arch/vax/vax/clock.c  Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/arch/vax/vax/clock.c  Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.59 2020/05/29 12:30:41 rin Exp $    */
+/*     $NetBSD: clock.c,v 1.60 2020/07/03 16:23:03 maxv Exp $   */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.59 2020/05/29 12:30:41 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.60 2020/07/03 16:23:03 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,13 +66,13 @@
        u_int counter;
 
        do {
-               cur_hardclock = hardclock_ticks;
+               cur_hardclock = getticks();
                counter = *(volatile u_int *)&ka46_cpu->vc_diagtimu;
-       } while (cur_hardclock != hardclock_ticks);
+       } while (cur_hardclock != getticks());
 
        counter = (counter & 0x3ff) + (counter >> 16) * 1024;
 
-       return counter + hardclock_ticks * tick;
+       return counter + getticks() * tick;
 }
 #endif
 
@@ -84,13 +84,13 @@
        static int prev_count, prev_hardclock;
 
        do {
-               cur_hardclock = hardclock_ticks;
+               cur_hardclock = getticks();
                counter = mfpr(PR_ICR) + tick;
-       } while (cur_hardclock != hardclock_ticks);
+       } while (cur_hardclock != getticks());
 
        /*
         * Handle interval counter wrapping with interrupts blocked.
-        * If the current hardclock_ticks is less than what we saw
+        * If the current getticks() is less than what we saw
         *   previously, use the previous value.
         * If the interval counter is smaller, assume it has wrapped,
         *   and if the [adjusted] current hardclock ticks is the same
diff -r cb5ab855937d -r 7a2e8ce080ae sys/external/bsd/common/include/linux/completion.h
--- a/sys/external/bsd/common/include/linux/completion.h        Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/external/bsd/common/include/linux/completion.h        Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: completion.h,v 1.6 2017/01/11 11:42:09 skrll Exp $     */
+/*     $NetBSD: completion.h,v 1.7 2020/07/03 16:23:02 maxv Exp $      */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -191,7 +191,7 @@
     unsigned long ticks)
 {
        /* XXX Arithmetic overflow...?  */
-       unsigned int start = hardclock_ticks, now;
+       unsigned int start = getticks(), now;
        int error;
 
        mutex_enter(&completion->c_lock);
@@ -202,7 +202,7 @@
                    &completion->c_lock, ticks);
                if (error)
                        goto out;
-               now = hardclock_ticks;
+               now = getticks();
                if (ticks < (now - start)) {
                        error = EWOULDBLOCK;
                        goto out;
diff -r cb5ab855937d -r 7a2e8ce080ae sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h
--- a/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h       Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h       Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_wait_netbsd.h,v 1.16 2020/02/14 04:37:43 riastradh Exp $   */
+/*     $NetBSD: drm_wait_netbsd.h,v 1.17 2020/07/03 16:23:02 maxv Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -140,10 +140,10 @@
                        (RET) = -EBUSY;         /* Match Linux...  */         \
                        break;                                                \
                }                                                             \
-               _dswo_start = hardclock_ticks;                                \
+               _dswo_start = getticks();                                     \
                /* XXX errno NetBSD->Linux */                                 \
                (RET) = -cv_timedwait_sig((Q), &(INTERLOCK)->sl_lock, 1);     \
-               _dswo_end = hardclock_ticks;                                  \
+               _dswo_end = getticks();                                       \
                if (_dswo_end - _dswo_start < _dswo_ticks)                    \
                        _dswo_ticks -= _dswo_end - _dswo_start;               \
                else                                                          \
@@ -239,11 +239,11 @@
                        (RET) = 0;                                      \
                        break;                                          \
                }                                                       \
-               _dtwu_start = hardclock_ticks;                          \
+               _dtwu_start = getticks();                               \
                /* XXX errno NetBSD->Linux */                           \
                (RET) = -WAIT((Q), &(INTERLOCK)->mtx_lock,              \
                    MIN(_dtwu_ticks, INT_MAX/2));                       \
-               _dtwu_end = hardclock_ticks;                            \
+               _dtwu_end = getticks();                                 \
                if ((_dtwu_end - _dtwu_start) < _dtwu_ticks)            \
                        _dtwu_ticks -= _dtwu_end - _dtwu_start;         \
                else                                                    \
@@ -314,11 +314,11 @@
                        (RET) = 0;                                      \
                        break;                                          \
                }                                                       \
-               _dstwu_start = hardclock_ticks;                         \
+               _dstwu_start = getticks();                              \
                /* XXX errno NetBSD->Linux */                           \
                (RET) = -WAIT((Q), &(INTERLOCK)->sl_lock,               \
                    MIN(_dstwu_ticks, INT_MAX/2));                      \
-               _dstwu_end = hardclock_ticks;                           \
+               _dstwu_end = getticks();                                \
                if ((_dstwu_end - _dstwu_start) < _dstwu_ticks)         \
                        _dstwu_ticks -= _dstwu_end - _dstwu_start;      \
                else                                                    \
diff -r cb5ab855937d -r 7a2e8ce080ae sys/external/bsd/drm2/include/linux/sched.h
--- a/sys/external/bsd/drm2/include/linux/sched.h       Fri Jul 03 16:17:24 2020 +0000
+++ b/sys/external/bsd/drm2/include/linux/sched.h       Fri Jul 03 16:23:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sched.h,v 1.14 2020/03/14 18:08:39 ad Exp $    */
+/*     $NetBSD: sched.h,v 1.15 2020/07/03 16:23:02 maxv Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -74,10 +74,10 @@
                return 0;
        }
 
-       start = hardclock_ticks;
+       start = getticks();
        /* Caller is expected to loop anyway, so no harm in truncating.  */
        (void)kpause("loonix", false /*!intr*/, MIN(timeout, INT_MAX), NULL);
-       end = hardclock_ticks;
+       end = getticks();
 
        remain = timeout - (end - start);



Home | Main Index | Thread Index | Old Index