Not unless you're talking floating-point/MMX, or using the RDTSC
instruction.
However, if you have a reasonable limit on how long you may be
interrupted (1/2 of the major increment) you can do this without
loops:
mov (xtime_sec),%ecx
mov (xtime_usec),%eax
mov (xtime_sec),%edx
cmp %eax,500000 ; 1/2 of the major increment
jb 1f
mov %ecx,%edx
1: ; Result in %edx:%eax
If the minor counter is less than halfway to rollover, it is safe to
assume the value read immediately *after* is stable; if it's more than
halfway, that the value read immediately *before* is stable. One
advantage with not having a loop is that you don't bias the output.
-hpa
-- "Linux is a very complete and sophisticated operating system. There are, and will be, large numbers of applications available for it." -- Paul Maritz, Group Vice President for Platforms And Applications, Microsoft Corporation [Reference at: http://www.kernel.org/~hpa/ms.html]- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/