mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-05 16:10:55 +00:00
Sync with sys/i386/i386/microtime.s revision 1.40.
This commit is contained in:
parent
6f34dba98a
commit
f27e599a9c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=32179
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue