lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48079356.2090307@nortel.com>
Date:	Thu, 17 Apr 2008 12:13:42 -0600
From:	"Chris Friesen" <cfriesen@...tel.com>
To:	Jack Harvard <jack.harvard@...glemail.com>
CC:	linux-kernel@...r.kernel.org
Subject: Re: gettimeofday() in 2.6.24

Jack Harvard wrote:

> http://lxr.linux.no/linux+v2.6.24/arch/arm/kernel/time.c#L240
>  239#ifndef CONFIG_GENERIC_TIME
>  240void do_gettimeofday(struct timeval *tv)
>  241{
>  242        unsigned long flags;
>  243        unsigned long seq;
>  244        unsigned long usec, sec;
>  245
>  246        do {
>  247                seq = read_seqbegin_irqsave(&xtime_lock, flags);
>  248                usec = system_timer->offset();
>  249                sec = xtime.tv_sec;
>  250                usec += xtime.tv_nsec / 1000;
>  251        } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));


> but I haven't quite figured out how gettimeofday() actually gets time
> from this added timer, also how xtime is updated?


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.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ