mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
This commit is contained in:
parent
e98198cdbb
commit
2ffa4044e9
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue