From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758063AbYDROt5 (ORCPT ); Fri, 18 Apr 2008 10:49:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757485AbYDROtp (ORCPT ); Fri, 18 Apr 2008 10:49:45 -0400 Received: from zcars04e.nortel.com ([47.129.242.56]:41604 "EHLO zcars04e.nortel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757431AbYDROto (ORCPT ); Fri, 18 Apr 2008 10:49:44 -0400 X-Greylist: delayed 825 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Apr 2008 10:49:44 EDT Message-ID: <4808B1C8.2060601@nortel.com> Date: Fri, 18 Apr 2008 08:35:52 -0600 From: "Chris Friesen" User-Agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jack Harvard CC: linux-kernel@vger.kernel.org Subject: Re: gettimeofday() in 2.6.24 References: <48079356.2090307@nortel.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 Apr 2008 14:35:56.0116 (UTC) FILETIME=[82F6A140:01C8A161] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jack Harvard wrote: > On Thu, Apr 17, 2008 at 7:13 PM, Chris Friesen > 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