From 6e04bc6b518516bfbb9fdcfe4aa19f8deaf3a176 Mon Sep 17 00:00:00 2001 From: tholo Date: Mon, 6 May 1996 20:29:38 +0000 Subject: [PATCH] Zero the instruction counter on Pentium's after detecting one if we have NTP code compiled in; prevents division errors in microtime() --- sys/arch/i386/i386/locore.s | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 9d6eb1775d3..bd1ca34badf 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -437,6 +437,13 @@ try586: /* Use the `cpuid' instruction. */ jb is486 # less than a Pentium movl $CPU_586,RELOC(_cpu) +#ifdef NTP + xorl %eax,%eax + xorl %edx,%edx + movl $10,%ecx + .byte 0xf, 0x30 # wrmsr (or trap on non-pentium :-) +#endif + 2: /* * Finished with old stack; load new %esp now instead of later so we -- 2.20.1