Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Mar 2011 16:09:08 +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: r219698 - head/sys/i386/include
Message-ID:  <201103161609.p2GG98q6097329@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Wed Mar 16 16:09:08 2011
New Revision: 219698
URL: http://svn.freebsd.org/changeset/base/219698

Log:
  Rework r219679.  Always check CPU class at run-time to make it predictable.
  Unfortunately, it pulls in <machine/cputypes.h> but it is small enough and
  namespace pollution is minimal, I hope.
  
  Pointed out by:	bde
  Pointy hat:	jkim

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

Modified: head/sys/i386/include/cpu.h
==============================================================================
--- head/sys/i386/include/cpu.h	Wed Mar 16 12:40:58 2011	(r219697)
+++ head/sys/i386/include/cpu.h	Wed Mar 16 16:09:08 2011	(r219698)
@@ -39,6 +39,7 @@
 /*
  * Definitions unique to i386 cpu support.
  */
+#include <machine/cputypes.h>
 #include <machine/psl.h>
 #include <machine/frame.h>
 #include <machine/segments.h>
@@ -69,14 +70,13 @@ void	swi_vm(void *);
 static __inline uint64_t
 get_cyclecount(void)
 {
-#if defined(I486_CPU) || defined(KLD_MODULE)
 	struct bintime bt;
 
-	binuptime(&bt);
-	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
-#else
+	if (cpu_class == CPUCLASS_486) {
+		binuptime(&bt);
+		return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
+	}
 	return (rdtsc());
-#endif
 }
 
 #endif



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