Hi, I was trying to figure out how gettimeofday() measures time in 2.6.24-arm2, in which a free-running timer is added to improve the resolution of gettimeofday() from 10ms to us, I can trace down to do_gettimeofday() as follows: 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)); 252 253 /* usec may have gone up a lot: be safe */ 254 while (usec >= 1000000) { 255 usec -= 1000000; 256 sec++; 257 } 258 259 tv->tv_sec = sec; 260 tv->tv_usec = usec; 261} 262 263EXPORT_SYMBOL(do_gettimeofday); but I haven't quite figured out how gettimeofday() actually gets time from this added timer, also how xtime is updated? Thanks, Jack --
| Benjamin Herrenschmidt | Re: [PATCH 0 of 4] Generic AIO by scheduling stacks |
| Rafael J. Wysocki | [Bug #11264] Invalid op opcode in kernel/workqueue |
| Bruce Leonard | [PATCH 2/2][MTD] Add support for > 2GiB MTD devices |
| Andrew Morton | 2.6.24-rc2-mm1 |
git: | |
| Elijah Newren | Trying to use git-filter-branch to compress history by removing large, obsolete bi... |
| Jon Smirl | Huge win, compressing a window of delta runs as a unit |
| Florian Weimer | Re: comparing file contents in is_exact_match? |
| David Woodhouse | Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins |
| Jan Stary | Re: Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| alemao | Azalia - Realtek/0x0885 - plays, but no sound |
| Joachim Schipper | Re: Radeon X1300 mobile + WXGA - out of luck? |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Doug Evans | Re: Stabilizing Linux |
| Stephen Tweedie | Re: No utmp entry. You must exec "login" from lowest level "sh" |
| Dave `geek' Gymer | WARNING (was Re: New afio release) |
