summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-12-30 23:35:20 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-12-30 23:35:20 +0000
commit859118a9a4e715707083aa8d656ce9e9a19b3547 (patch)
tree33b3c77866f89499387469653b9a43fa24af6e01
parent03ee54c664c4a96a7212f4470c80f94e20dc0661 (diff)
be carefull about div by zero
-rw-r--r--sys/arch/i386/i386/microtime.s7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/microtime.s b/sys/arch/i386/i386/microtime.s
index 8c342f0b53c..27b417abe52 100644
--- a/sys/arch/i386/i386/microtime.s
+++ b/sys/arch/i386/i386/microtime.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: microtime.s,v 1.9 1997/12/17 08:54:49 downsj Exp $ */
+/* $OpenBSD: microtime.s,v 1.10 1997/12/30 23:35:19 mickey Exp $ */
/* $NetBSD: microtime.s,v 1.16 1995/04/17 12:06:47 cgd Exp $ */
/*-
@@ -151,7 +151,10 @@ pentium_microtime:
.byte 0x0f, 0x31 # RDTSC
subl _pentium_base_tsc,%eax
sbbl _pentium_base_tsc+4,%edx
- divl %ecx # convert to usec
+ orl %ecx, %ecx
+ jnz 1f
+ incl %ecx
+1: divl %ecx # convert to usec
jmp common_microtime
#endif
#endif