svn commit: r220347 - head/sys/i386/include

Jung-uk Kim jkim at FreeBSD.org
Mon Apr 4 22:56:33 UTC 2011


Author: jkim
Date: Mon Apr  4 22:56:33 2011
New Revision: 220347
URL: http://svn.freebsd.org/changeset/base/220347

Log:
  Use cpu_ticks() for get_cyclecount(9) rather than checking existence of TSC
  at run-time on i386.  cpu_ticks() is set to use RDTSC early enough on i386
  where it is available.  Otherwise, cpu_ticks() is driven by the current
  timecounter hardware as binuptime(9) does.  This also avoids unnecessary
  namespace pollution from <machine/cputypes.h>.

Modified:
  head/sys/i386/include/cpu.h

Modified: head/sys/i386/include/cpu.h
==============================================================================
--- head/sys/i386/include/cpu.h	Mon Apr  4 22:30:12 2011	(r220346)
+++ head/sys/i386/include/cpu.h	Mon Apr  4 22:56:33 2011	(r220347)
@@ -39,7 +39,6 @@
 /*
  * Definitions unique to i386 cpu support.
  */
-#include <machine/cputypes.h>
 #include <machine/psl.h>
 #include <machine/frame.h>
 #include <machine/segments.h>
@@ -70,13 +69,8 @@ void	swi_vm(void *);
 static __inline uint64_t
 get_cyclecount(void)
 {
-	struct bintime bt;
 
-	if (cpu_class == CPUCLASS_486) {
-		binuptime(&bt);
-		return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
-	}
-	return (rdtsc());
+	return (cpu_ticks());
 }
 
 #endif


More information about the svn-src-head mailing list