Deprecate tsc_present as the last of its real consumers finally disappeared.

This commit is contained in:
jkim 2011-03-15 17:19:52 +00:00
parent d3440080b0
commit ad8ef5e4c7
5 changed files with 9 additions and 13 deletions

View File

@ -56,7 +56,6 @@
#ifdef _KERNEL
extern char btext[];
extern char etext[];
extern int tsc_present;
void cpu_halt(void);
void cpu_reset(void);

View File

@ -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

View File

@ -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. */

View File

@ -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. */

View File

@ -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;
/*