From 859118a9a4e715707083aa8d656ce9e9a19b3547 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Tue, 30 Dec 1997 23:35:20 +0000 Subject: be carefull about div by zero --- sys/arch/i386/i386/microtime.s | 7 +++++-- 1 file 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 -- cgit v1.2.3