svn commit: r220429 - head/sys/amd64/amd64

Jung-uk Kim jkim at FreeBSD.org
Thu Apr 7 21:29:34 UTC 2011


Author: jkim
Date: Thu Apr  7 21:29:34 2011
New Revision: 220429
URL: http://svn.freebsd.org/changeset/base/220429

Log:
  Remove stale checks for RDTSC support.  amd64 must have TSC support anyway.

Modified:
  head/sys/amd64/amd64/prof_machdep.c

Modified: head/sys/amd64/amd64/prof_machdep.c
==============================================================================
--- head/sys/amd64/amd64/prof_machdep.c	Thu Apr  7 21:20:26 2011	(r220428)
+++ head/sys/amd64/amd64/prof_machdep.c	Thu Apr  7 21:29:34 2011	(r220429)
@@ -63,9 +63,7 @@ static u_int	cputime_clock_pmc_conf = I5
 static int	cputime_clock_pmc_init;
 static struct gmonparam saved_gmp;
 #endif
-#if defined(I586_CPU) || defined(I686_CPU)
 static int	cputime_prof_active;
-#endif
 #endif /* GUPROF */
 
 #ifdef __GNUCLIKE_ASM
@@ -200,14 +198,12 @@ cputime()
 {
 	u_int count;
 	int delta;
-#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) && \
-    defined(PERFMON) && defined(I586_PMC_GUPROF)
+#if defined(PERFMON) && defined(I586_PMC_GUPROF) && !defined(SMP)
 	u_quad_t event_count;
 #endif
 	u_char high, low;
 	static u_int prev_count;
 
-#if defined(I586_CPU) || defined(I686_CPU)
 	if (cputime_clock == CPUTIME_CLOCK_TSC) {
 		/*
 		 * Scale the TSC a little to make cputime()'s frequency
@@ -236,7 +232,6 @@ cputime()
 		return (delta);
 	}
 #endif /* PERFMON && I586_PMC_GUPROF && !SMP */
-#endif /* I586_CPU || I686_CPU */
 
 	/*
 	 * Read the current value of the 8254 timer counter 0.
@@ -318,13 +313,10 @@ startguprof(gp)
 {
 	if (cputime_clock == CPUTIME_CLOCK_UNINITIALIZED) {
 		cputime_clock = CPUTIME_CLOCK_I8254;
-#if defined(I586_CPU) || defined(I686_CPU)
 		if (tsc_freq != 0 && mp_ncpus == 1)
 			cputime_clock = CPUTIME_CLOCK_TSC;
-#endif
 	}
 	gp->profrate = i8254_freq << CPUTIME_CLOCK_I8254_SHIFT;
-#if defined(I586_CPU) || defined(I686_CPU)
 	if (cputime_clock == CPUTIME_CLOCK_TSC) {
 		gp->profrate = tsc_freq >> 1;
 		cputime_prof_active = 1;
@@ -355,7 +347,6 @@ startguprof(gp)
 		}
 	}
 #endif /* PERFMON && I586_PMC_GUPROF */
-#endif /* I586_CPU || I686_CPU */
 	cputime_bias = 0;
 	cputime();
 }
@@ -371,13 +362,10 @@ stopguprof(gp)
 		cputime_clock_pmc_init = FALSE;
 	}
 #endif
-#if defined(I586_CPU) || defined(I686_CPU)
 	if (cputime_clock == CPUTIME_CLOCK_TSC)
 		cputime_prof_active = 0;
-#endif
 }
 
-#if defined(I586_CPU) || defined(I686_CPU)
 /* If the cpu frequency changed while profiling, report a warning. */
 static void
 tsc_freq_changed(void *arg, const struct cf_level *level, int status)
@@ -395,6 +383,5 @@ tsc_freq_changed(void *arg, const struct
 
 EVENTHANDLER_DEFINE(cpufreq_post_change, tsc_freq_changed, NULL,
     EVENTHANDLER_PRI_ANY);
-#endif /* I586_CPU || I686_CPU */
 
 #endif /* GUPROF */


More information about the svn-src-head mailing list