Index: include/cpu.h =================================================================== RCS file: /cvs/src/sys/arch/amd64/include/cpu.h,v retrieving revision 1.136 diff -u -p -r1.136 cpu.h --- include/cpu.h 31 May 2020 06:23:56 -0000 1.136 +++ include/cpu.h 31 May 2020 12:21:36 -0000 @@ -304,7 +304,15 @@ void cpu_unidle(struct cpu_info *); #include #include -unsigned int cpu_rnd_messybits(void); +static inline unsigned int +cpu_rnd_messybits(void) +{ + unsigned int hi, lo; + + __asm volatile("rdtsc" : "=d" (hi), "=a" (lo)); + + return (hi ^ lo); +} #endif /* _KERNEL */ Index: amd64/machdep.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/machdep.c,v retrieving revision 1.266 diff -u -p -r1.266 machdep.c --- amd64/machdep.c 31 May 2020 06:23:56 -0000 1.266 +++ amd64/machdep.c 31 May 2020 12:21:36 -0000 @@ -2055,12 +2055,3 @@ check_context(const struct reg *regs, st return 0; } - -unsigned int -cpu_rnd_messybits(void) -{ - struct timespec ts; - - nanotime(&ts); - return (ts.tv_nsec ^ (ts.tv_sec << 20)); -}