diff --git a/sys/arm/include/cpu.h b/sys/arm/include/cpu.h index 455332467d9..f9e94592973 100644 --- a/sys/arm/include/cpu.h +++ b/sys/arm/include/cpu.h @@ -16,7 +16,7 @@ get_cyclecount(void) struct bintime bt; binuptime(&bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); } #endif diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 75fc0c617a6..bee0b5fa31b 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -67,7 +67,7 @@ void swi_vm(void *); * Return contents of in-cpu fast counter as a sort of "bogo-time" * for random-harvesting purposes. */ -static __inline u_int64_t +static __inline uint64_t get_cyclecount(void) { #if defined(I486_CPU) || defined(KLD_MODULE) @@ -75,7 +75,7 @@ get_cyclecount(void) if (!tsc_present) { binuptime(&bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); } #endif return (rdtsc());