diff options
author | jkim <jkim@FreeBSD.org> | 2011-03-16 16:09:08 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2011-03-16 16:09:08 +0000 |
commit | 881681406bae7f22438ebef034b8ccfbdc468574 (patch) | |
tree | 907d572b97bf0c2ddb217d65d4fe8d4c544658d9 /sys/i386 | |
parent | 0ef0516836e9f3918c51602ae86816750dbed5f2 (diff) | |
download | FreeBSD-src-881681406bae7f22438ebef034b8ccfbdc468574.zip FreeBSD-src-881681406bae7f22438ebef034b8ccfbdc468574.tar.gz |
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
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/include/cpu.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 42424c8..d1d796b 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -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 |