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
This commit is contained in:
jkim 2011-03-15 19:47:20 +00:00
parent 2108e6a856
commit 2c6f3a8cd1

View File

@ -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);
}