diff options
author | jkim <jkim@FreeBSD.org> | 2011-03-15 17:19:52 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2011-03-15 17:19:52 +0000 |
commit | ad8ef5e4c74c5284ed975a5c90bc986ea4ed3933 (patch) | |
tree | d87e7f881f4daa44164c406cd5648fc96c3d4144 | |
parent | d3440080b0bc9de31def1f395728bafd1bcb558f (diff) | |
download | FreeBSD-src-ad8ef5e4c74c5284ed975a5c90bc986ea4ed3933.zip FreeBSD-src-ad8ef5e4c74c5284ed975a5c90bc986ea4ed3933.tar.gz |
Deprecate tsc_present as the last of its real consumers finally disappeared.
-rw-r--r-- | sys/amd64/include/cpu.h | 1 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_subr.c | 8 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 2 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 2 | ||||
-rw-r--r-- | sys/x86/x86/tsc.c | 9 |
5 files changed, 9 insertions, 13 deletions
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h index 3cc4af7..1c2871f 100644 --- a/sys/amd64/include/cpu.h +++ b/sys/amd64/include/cpu.h @@ -56,7 +56,6 @@ #ifdef _KERNEL extern char btext[]; extern char etext[]; -extern int tsc_present; void cpu_halt(void); void cpu_reset(void); diff --git a/sys/contrib/altq/altq/altq_subr.c b/sys/contrib/altq/altq/altq_subr.c index a58747d..524e752 100644 --- a/sys/contrib/altq/altq/altq_subr.c +++ b/sys/contrib/altq/altq/altq_subr.c @@ -78,10 +78,12 @@ #include <machine/clock.h> #endif #if defined(__amd64__) || defined(__i386__) -#include <machine/cpu.h> /* for cpu_feature or tsc_present */ #include <machine/cpufunc.h> /* for pentium tsc */ -#if defined(__NetBSD__) || defined(__OpenBSD__) #include <machine/specialreg.h> /* for CPUID_TSC */ +#ifdef __FreeBSD__ +#include <machine/md_var.h> /* for cpu_feature */ +#elif defined(__NetBSD__) || defined(__OpenBSD__) +#include <machine/cpu.h> /* for cpu_feature */ #endif #endif /* __amd64 || __i386__ */ @@ -927,7 +929,7 @@ init_machclk_setup(void) #if defined(__amd64__) || defined(__i386__) /* check if TSC is available */ #ifdef __FreeBSD__ - if (!tsc_present || tsc_freq == 0) + if ((cpu_feature & CPUID_TSC) == 0 || tsc_freq == 0) #else if ((cpu_feature & CPUID_TSC) == 0) #endif diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index a87095f..57fc74d 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1141,7 +1141,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate) if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); - if (!tsc_present) + if ((cpu_feature & CPUID_TSC) == 0) return (EOPNOTSUPP); /* If TSC is P-state invariant, DELAY(9) based logic fails. */ diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index c1d065c..d778de5 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -1076,7 +1076,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate) if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); - if (!tsc_present) + if ((cpu_feature & CPUID_TSC) == 0) return (EOPNOTSUPP); /* If we're booting, trust the rate calibrated moments ago. */ diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 40d5f3c..1781a78 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); uint64_t tsc_freq; int tsc_is_invariant; -int tsc_present; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, @@ -89,11 +88,7 @@ init_TSC(void) { u_int64_t tscval[2]; - if ((cpu_feature & CPUID_TSC) == 0) - return; - tsc_present = 1; - - if (tsc_disabled) + if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) return; if (bootverbose) @@ -155,7 +150,7 @@ void init_TSC_tc(void) { - if (!tsc_present || tsc_disabled) + if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) return; /* |