mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
krping: Use get_cyclecount for get_cycles.
This avoids having to duplicate identical MD code. Reviewed by: np, emaste Differential Revision: https://reviews.freebsd.org/D38971
This commit is contained in:
parent
6dcd6d199f
commit
f4ea84cea2
1 changed files with 1 additions and 7 deletions
|
|
@ -69,13 +69,7 @@ MODULE_DEPEND(krping, linuxkpi, 1, 1, 1);
|
|||
static __inline uint64_t
|
||||
get_cycles(void)
|
||||
{
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
uint32_t low, high;
|
||||
__asm __volatile("rdtsc" : "=a" (low), "=d" (high));
|
||||
return (low | ((u_int64_t)high << 32));
|
||||
#elif defined(__powerpc64__)
|
||||
return __builtin_readcyclecounter();
|
||||
#endif
|
||||
return (get_cyclecount());
|
||||
}
|
||||
|
||||
typedef uint64_t cycles_t;
|
||||
|
|
|
|||
Loading…
Reference in a new issue