Module Name: src Committed By: ad Date: Sat May 16 23:06:40 UTC 2020
Modified Files: src/sys/dev/ic: hpet.c Log Message: Store initial TSC/HPET readings for hpet0 only. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ic/hpet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/hpet.c diff -u src/sys/dev/ic/hpet.c:1.16 src/sys/dev/ic/hpet.c:1.17 --- src/sys/dev/ic/hpet.c:1.16 Fri May 8 22:01:54 2020 +++ src/sys/dev/ic/hpet.c Sat May 16 23:06:40 2020 @@ -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 @@ hpet_attach_subr(device_t dv) 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();