summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-05-09 09:40:50 +0000
committerotto <otto@openbsd.org>2006-05-09 09:40:50 +0000
commitcc957eba2e5b87a265d7fb32cf795986bb24b19b (patch)
tree44bf39afe24a1530f9c3bdc7b0f3d3dbcf73ea75
parentMove the sti to after the memory write. We do not want execution of (diff)
downloadwireguard-openbsd-cc957eba2e5b87a265d7fb32cf795986bb24b19b.tar.xz
wireguard-openbsd-cc957eba2e5b87a265d7fb32cf795986bb24b19b.zip
Avoid estimating pentium_mhz too low, which has the effect of resulting
in non-monotonic time. Now the gettimeofday regression no longer fails on my 500MHz PIII. ok toby@ mickey@
-rw-r--r--sys/arch/i386/isa/clock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index af7ce370ac3..24cd986b182 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.34 2006/02/12 19:55:39 miod Exp $ */
+/* $OpenBSD: clock.c,v 1.35 2006/05/09 09:40:50 otto Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -392,7 +392,7 @@ calibrate_cyclecounter()
__asm __volatile("rdtsc" : "=A" (last_count));
delay(1000000);
__asm __volatile("rdtsc" : "=A" (count));
- pentium_mhz = ((count - last_count) + 500000) / 1000000;
+ pentium_mhz = ((count - last_count) + 999999) / 1000000;
}
#endif