From owner-svn-src-all@FreeBSD.ORG Wed Mar 16 16:09:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93329106564A; Wed, 16 Mar 2011 16:09:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81A568FC12; Wed, 16 Mar 2011 16:09:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2GG98uu097331; Wed, 16 Mar 2011 16:09:08 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GG98q6097329; Wed, 16 Mar 2011 16:09:08 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103161609.p2GG98q6097329@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 16 Mar 2011 16:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219698 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2011 16:09:08 -0000 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 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 #include #include #include @@ -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