Author: jkim
Date: Tue Mar 15 17:19:52 2011
New Revision: 219673
URL: http://svn.freebsd.org/changeset/base/219673

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

Modified:
  head/sys/amd64/include/cpu.h
  head/sys/contrib/altq/altq/altq_subr.c
  head/sys/i386/i386/machdep.c
  head/sys/pc98/pc98/machdep.c
  head/sys/x86/x86/tsc.c

Modified: head/sys/amd64/include/cpu.h
==============================================================================
--- head/sys/amd64/include/cpu.h        Tue Mar 15 17:14:26 2011        
(r219672)
+++ head/sys/amd64/include/cpu.h        Tue Mar 15 17:19:52 2011        
(r219673)
@@ -56,7 +56,6 @@
 #ifdef _KERNEL
 extern char    btext[];
 extern char    etext[];
-extern int     tsc_present;
 
 void   cpu_halt(void);
 void   cpu_reset(void);

Modified: head/sys/contrib/altq/altq/altq_subr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_subr.c      Tue Mar 15 17:14:26 2011        
(r219672)
+++ head/sys/contrib/altq/altq/altq_subr.c      Tue Mar 15 17:19:52 2011        
(r219673)
@@ -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

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c        Tue Mar 15 17:14:26 2011        
(r219672)
+++ head/sys/i386/i386/machdep.c        Tue Mar 15 17:19:52 2011        
(r219673)
@@ -1141,7 +1141,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 
        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. */

Modified: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c        Tue Mar 15 17:14:26 2011        
(r219672)
+++ head/sys/pc98/pc98/machdep.c        Tue Mar 15 17:19:52 2011        
(r219673)
@@ -1076,7 +1076,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 
        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. */

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c      Tue Mar 15 17:14:26 2011        (r219672)
+++ head/sys/x86/x86/tsc.c      Tue Mar 15 17:19:52 2011        (r219673)
@@ -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;
 
        /*
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to