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
7fbd5cdea3
commit
38217c1393
@ -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…
x
Reference in New Issue
Block a user