aboutsummaryrefslogtreecommitdiff
path: root/sys/pc98
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2011-04-07 23:28:28 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2011-04-07 23:28:28 +0000
commit3453537fa54255e670f22aaf57e45ab40a14f55e (patch)
tree664d6632a866948517ff612d5ccfb37cd5bf91db /sys/pc98
parentcb379161b1e700f2ce5d6985085983b77410475c (diff)
Notes
Diffstat (limited to 'sys/pc98')
-rw-r--r--sys/pc98/pc98/machdep.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 5e7215e57de8..4727351c84c8 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -1072,16 +1072,17 @@ int
cpu_est_clockrate(int cpu_id, uint64_t *rate)
{
register_t reg;
- uint64_t tsc1, tsc2;
+ uint64_t freq, tsc1, tsc2;
if (pcpu_find(cpu_id) == NULL || rate == NULL)
return (EINVAL);
if ((cpu_feature & CPUID_TSC) == 0)
return (EOPNOTSUPP);
+ freq = atomic_load_acq_64(&tsc_freq);
/* If we're booting, trust the rate calibrated moments ago. */
- if (cold && tsc_freq != 0) {
- *rate = tsc_freq;
+ if (cold && freq != 0) {
+ *rate = freq;
return (0);
}
@@ -1110,7 +1111,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate)
#endif
tsc2 -= tsc1;
- if (tsc_freq != 0) {
+ if (freq != 0) {
*rate = tsc2 * 1000;
return (0);
}