diff options
author | jkim <jkim@FreeBSD.org> | 2011-03-11 00:44:32 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2011-03-11 00:44:32 +0000 |
commit | 7df55dcdeb4359716cc7b6a3381d2772e1187d62 (patch) | |
tree | c5a4a6ac9d73738d09f204667eb641e541525a80 /sys/pc98/pc98 | |
parent | 8c8d7206ece7a4dc88c61d5910c6724b0137b26a (diff) | |
download | FreeBSD-src-7df55dcdeb4359716cc7b6a3381d2772e1187d62.zip FreeBSD-src-7df55dcdeb4359716cc7b6a3381d2772e1187d62.tar.gz |
Add a tunable "machdep.disable_tsc" to turn off TSC. Specifically, it turns
off boot-time CPU frequency calibration, DELAY(9) with TSC, and using TSC as
a CPU ticker. Note tsc_present does not change by this tunable.
Diffstat (limited to 'sys/pc98/pc98')
-rw-r--r-- | sys/pc98/pc98/machdep.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 07b3b84..c1d065c 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -77,6 +77,9 @@ __FBSDID("$FreeBSD$"); #include <sys/reboot.h> #include <sys/sched.h> #include <sys/signalvar.h> +#ifdef SMP +#include <sys/smp.h> +#endif #include <sys/syscallsubr.h> #include <sys/sysctl.h> #include <sys/sysent.h> @@ -1077,16 +1080,18 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate) return (EOPNOTSUPP); /* If we're booting, trust the rate calibrated moments ago. */ - if (cold) { + if (cold && tsc_freq != 0) { *rate = tsc_freq; return (0); } #ifdef SMP - /* Schedule ourselves on the indicated cpu. */ - thread_lock(curthread); - sched_bind(curthread, cpu_id); - thread_unlock(curthread); + if (smp_cpus > 1) { + /* Schedule ourselves on the indicated cpu. */ + thread_lock(curthread); + sched_bind(curthread, cpu_id); + thread_unlock(curthread); + } #endif /* Calibrate by measuring a short delay. */ @@ -1097,9 +1102,11 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate) intr_restore(reg); #ifdef SMP - thread_lock(curthread); - sched_unbind(curthread); - thread_unlock(curthread); + if (smp_cpus > 1) { + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); + } #endif tsc2 -= tsc1; |