diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pc98/i386/microtime.s | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/pc98/i386/microtime.s b/sys/pc98/i386/microtime.s index 45eb1f4..2419e39 100644 --- a/sys/pc98/i386/microtime.s +++ b/sys/pc98/i386/microtime.s @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: Steve McCanne's microtime code - * $Id: microtime.s,v 1.21 1997/12/28 08:16:28 kato Exp $ + * $Id: microtime.s,v 1.22 1997/12/29 16:17:09 kato Exp $ */ #include <machine/asmacros.h> @@ -60,9 +60,22 @@ ENTRY(microtime) subl _tsc_bias, %eax mull _tsc_multiplier movl %edx, %eax + addl _time+4, %eax /* usec += time.tv_sec */ + movl _time, %edx /* sec = time.tv_sec */ popfl /* restore interrupt mask */ - jmp common_microtime + cmpl $1000000, %eax /* usec valid? */ + jb 1f + subl $1000000, %eax /* adjust usec */ + incl %edx /* bump sec */ +1: + movl 4(%esp), %ecx /* load timeval pointer arg */ + movl %edx, (%ecx) /* tvp->tv_sec = sec */ + movl %eax, 4(%ecx) /* tvp->tv_usec = usec */ + + ret + + ALIGN_TEXT i8254_microtime: movb $TIMER_SEL0|TIMER_LATCH, %al /* prepare to latch */ @@ -275,13 +288,12 @@ overflow: popl %edx popl %eax #endif /* USE_CLOCKLOCK */ - popfl /* restore interrupt mask */ - -common_microtime: addl _time+4, %eax /* usec += time.tv_sec */ movl _time, %edx /* sec = time.tv_sec */ + popfl /* restore interrupt mask */ + cmpl $1000000, %eax /* usec valid? */ jb 1f subl $1000000, %eax /* adjust usec */ |