Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Apr 2011 22:56:33 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220347 - head/sys/i386/include
Message-ID:  <201104042256.p34MuXtU098071@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104042256.p34MuXtU098071>