Module Name: src
Committed By: christos
Date: Tue Jul 2 00:01:17 UTC 2013
Modified Files:
src/sys/arch/x86/x86: tsc.c
Log Message:
- remove unused variable
- call rdmsr() twice to avoid the 5.4210108624275222e-18% probability that
rdmsr() returns 0.
>From dsl@
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/x86/tsc.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/arch/x86/x86/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.31 src/sys/arch/x86/x86/tsc.c:1.32
--- src/sys/arch/x86/x86/tsc.c:1.31 Wed Jun 26 20:37:34 2013
+++ src/sys/arch/x86/x86/tsc.c Mon Jul 1 20:01:17 2013
@@ -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 @@ tsc_tc_init(void)
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 @@ cpu_hascounter(void)
return cpu_feature[0] & CPUID_TSC;
}
-extern int cpu_msr_tsc;
-
uint64_t
cpu_counter_serializing(void)
{