Re: gettimeofday() in 2.6.24

From: Chris Friesen
Date: Fri Apr 18 2008 - 10:49:58 EST


Jack Harvard wrote:
On Thu, Apr 17, 2008 at 7:13 PM, Chris Friesen <cfriesen@xxxxxxxxxx>
wrote:

system_timer->offset() uses the added timer to return the number of
usecs since the last timer tick. It's potentially different for
each specific type of arm blade, and the function often has
"gettimeoffset" in the name.

"xtime" is updated in the core kernel code.


is "xtime" updated by the time tick clock timer, i.e., the timer
which generates interrupts every 1/HZ second to the kernel. Put it in
another way, does gettimeofday get time in two parts 1) seconds from
xtime.tv_sec, updated by timer0, 2) microseconds from xtime.tv_nsec +
system_timer->offset(), updated by timer0 and timer3.

Yes, I think xtime is updated by the tick timer.

system_timer->offset() may be updated by different mechanisms, depending on the specific arm subarch.

Do you mean the code here "http://lxr.linux.no/linux+v2.6.24/kernel/time/timekeeping.c#L45";

No. As I said, the function usually has "gettimeoffset" in the name and it's specific to arm so it would be under arch/arm. For instance, on Xscale boards it's ixp2000_gettimeoffset() in arch/arm/mach-ixp2000/core.c.

For more information you might want to look at the code in arch/arm or else talk to the arm developers on the linux-arm-kernel mailing list.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/