[parisc-linux] [PATCH] timer_interrupt and gettimeoffset.

Grant Grundler grundler at parisc-linux.org
Fri Sep 1 16:59:04 MDT 2006


On Fri, Sep 01, 2006 at 04:48:25PM -0600, Grant Grundler wrote:
> On Thu, Aug 31, 2006 at 12:53:27AM -0600, Grant Grundler wrote:
> > And I've hacked your version some more.
> > diff is below.
> 
> version #3: seems to be working fine on 64-bit SMP.
> 32-bit UP kernel is still under construction.
...
> gettimeoffset printk is busticated. I'll fix that in the next version.
> But it looks like wrapped values are causing problems.

Looks like only the printk is broken.

The attached test program (based on Guy's description) seems
to be working fine on 32-bit UP/b2600:
...
Time : 1157151360 sec, 106770 usec
Time : 1157151361 sec, 116765 usec
Time : 1157151362 sec, 126770 usec
Time : 1157151363 sec, 136764 usec
...

Note there is ~10ms shift on each "Time" output.
I believe this is because the task will run on the next
tick _after_ the 1 second time has expired.

hth,
grant


#include <stdio.h>
#include <sys/time.h>
#include <time.h>
main()
{
	struct timeval tv;

	while(gettimeofday(&tv, NULL) == 0) {
		printf("Time : %d sec, %d usec\n", tv.tv_sec, tv.tv_usec);
		sleep(1);
	}
}



More information about the parisc-linux mailing list