Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Store initial TSC/HPET readings for hpet0 only.



details:   https://anonhg.NetBSD.org/src/rev/af5c4a3cada1
branches:  trunk
changeset: 1010169:af5c4a3cada1
user:      ad <ad%NetBSD.org@localhost>
date:      Sat May 16 23:06:40 2020 +0000

description:
Store initial TSC/HPET readings for hpet0 only.

diffstat:

 sys/dev/ic/hpet.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r d7a69ab21b0f -r af5c4a3cada1 sys/dev/ic/hpet.c
--- a/sys/dev/ic/hpet.c Sat May 16 22:53:37 2020 +0000
+++ b/sys/dev/ic/hpet.c Sat May 16 23:06:40 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hpet.c,v 1.16 2020/05/08 22:01:54 ad Exp $ */
+/* $NetBSD: hpet.c,v 1.17 2020/05/16 23:06:40 ad Exp $ */
 
 /*
  * Copyright (c) 2006 Nicolas Joly
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpet.c,v 1.16 2020/05/08 22:01:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpet.c,v 1.17 2020/05/16 23:06:40 ad Exp $");
 
 #include <sys/systm.h>
 #include <sys/device.h>
@@ -149,7 +149,7 @@
        sc->sc_adj = (int64_t)val * sc->sc_period / 1000;
 
        /* Store attach-time values for computing TSC frequency later. */
-       if (cpu_hascounter()) {
+       if (cpu_hascounter() && sc == hpet0) {
                (void)cpu_counter();
                val = bus_space_read_4(sc->sc_memt, sc->sc_memh, HPET_MCOUNT_LO);
                hpet_attach_tsc = cpu_counter();



Home | Main Index | Thread Index | Old Index