summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2011-03-15 19:47:20 +0000
committerjkim <jkim@FreeBSD.org>2011-03-15 19:47:20 +0000
commit2c6f3a8cd1e07be6b43068ef410a204e2b267143 (patch)
tree57f2fe2286592a5b2355ca40bc281582c508d97a /sys/x86
parent2108e6a8560d1dcdcc257030f68716270751d8e8 (diff)
downloadFreeBSD-src-2c6f3a8cd1e07be6b43068ef410a204e2b267143.zip
FreeBSD-src-2c6f3a8cd1e07be6b43068ef410a204e2b267143.tar.gz
Do not let machdep.tsc_freq modify tsc_freq itself. It is bad for i386 as
it does not operate atomically. Actually, it serves no purpose. Noticed by: bde
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/x86/tsc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
index 1781a78..d0afff1 100644
--- a/sys/x86/x86/tsc.c
+++ b/sys/x86/x86/tsc.c
@@ -263,12 +263,10 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS)
if (tsc_timecounter.tc_frequency == 0)
return (EOPNOTSUPP);
- freq = tsc_freq;
+ freq = tsc_timecounter.tc_frequency;
error = sysctl_handle_64(oidp, &freq, 0, req);
- if (error == 0 && req->newptr != NULL) {
- tsc_freq = freq;
- tsc_timecounter.tc_frequency = tsc_freq;
- }
+ if (error == 0 && req->newptr != NULL)
+ tsc_timecounter.tc_frequency = freq;
return (error);
}
OpenPOWER on IntegriCloud