Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 - remove unused variable



details:   https://anonhg.NetBSD.org/src/rev/16f377126b73
branches:  trunk
changeset: 787758:16f377126b73
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jul 02 00:01:17 2013 +0000

description:
- remove unused variable
- call rdmsr() twice to avoid the 5.4210108624275222e-18% probability that
  rdmsr() returns 0.
>From dsl@

diffstat:

 sys/arch/x86/x86/tsc.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r 1a6c8d516df6 -r 16f377126b73 sys/arch/x86/x86/tsc.c
--- a/sys/arch/x86/x86/tsc.c    Mon Jul 01 23:58:42 2013 +0000
+++ b/sys/arch/x86/x86/tsc.c    Tue Jul 02 00:01:17 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tsc.c,v 1.31 2013/06/27 00:37:34 christos Exp $        */
+/*     $NetBSD: tsc.c,v 1.32 2013/07/02 00:01:17 christos Exp $        */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.31 2013/06/27 00:37:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.32 2013/07/02 00:01:17 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -77,7 +77,8 @@
        ci = curcpu();
        safe = false;
        tsc_freq = ci->ci_data.cpu_cc_freq;
-       tsc_good = (cpu_feature[0] & CPUID_MSR) != 0 && rdmsr(MSR_TSC) != 0;
+       tsc_good = (cpu_feature[0] & CPUID_MSR) != 0 &&
+           (rdmsr(MSR_TSC) != 0 || rdmsr(MSR_TSC) != 0);
 
        if (cpu_vendor == CPUVENDOR_INTEL) {
                /*
@@ -260,8 +261,6 @@
        return cpu_feature[0] & CPUID_TSC;
 }
 
-extern int cpu_msr_tsc;
-
 uint64_t
 cpu_counter_serializing(void)
 {



Home | Main Index | Thread Index | Old Index