summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-05-06 20:29:39 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-05-06 20:29:39 +0000
commit717dedd6c08d933f409f66fc8a4544536b281c66 (patch)
treecd8ac267c8953095a2b9c21ece09319f01fd213f /sys/arch/i386
parent7472e7abc37d1d43120ae025f36f6803252efa88 (diff)
Zero the instruction counter on Pentium's after detecting one if we have
NTP code compiled in; prevents division errors in microtime()
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/locore.s7
1 files changed, 7 insertions, 0 deletions
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