From 57af65d40189969951496fa32d4ac7606910e6c3 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Mon, 4 Apr 2011 22:56:33 +0000 Subject: [PATCH] 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 . --- sys/i386/include/cpu.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index d1d796b06b1..5bc9f5c04c1 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -39,7 +39,6 @@ /* * Definitions unique to i386 cpu support. */ -#include #include #include #include @@ -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 -- 2.45.2