Reading Sun 3 timer register within Kernel device driver

smb at research.att.com smb at research.att.com
Thu Dec 21 13:42:07 AEST 1989


There are easier things to do than reading the clock chip.  For one thing,
there's an external struct timeval named 'time'; it's the variable the
gettimeofday() system call uses to return the current time.  (As such, of
course, it's limited to the precision of that call.)  Actually, that's not
quite true; there's a subroutine uniqtime() that takes a struct timeval*
as a parameter; it returns that structure, but will increment the
low-order bit (i.e., the microsecond value) to ensure that no two calls
yield the exact same time.



More information about the Comp.sys.sun mailing list