aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time.c
diff options
context:
space:
mode:
authorBob Picco <bob.picco@hp.com>2007-07-18 18:51:28 -0400
committerTony Luck <tony.luck@intel.com>2007-07-20 14:23:02 -0400
commit1f564ad6d4182859612cbae452122e5eb2d62a76 (patch)
treeef98ce12ed64853437c35a81e29f0d1c09a4393b /kernel/time.c
parent0aa366f351d044703e25c8425e508170e80d83b1 (diff)
[IA64] remove time interpolator
Remove time_interpolator code (This is generic code, but only user was ia64. It has been superseded by the CONFIG_GENERIC_TIME code). Signed-off-by: Bob Picco <bob.picco@hp.com> Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Peter Keilty <peter.keilty@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'kernel/time.c')
-rw-r--r--kernel/time.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/kernel/time.c b/kernel/time.c
index ffe19149d770..e325597f5bf5 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -136,7 +136,6 @@ static inline void warp_clock(void)
136 write_seqlock_irq(&xtime_lock); 136 write_seqlock_irq(&xtime_lock);
137 wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60; 137 wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60;
138 xtime.tv_sec += sys_tz.tz_minuteswest * 60; 138 xtime.tv_sec += sys_tz.tz_minuteswest * 60;
139 time_interpolator_reset();
140 write_sequnlock_irq(&xtime_lock); 139 write_sequnlock_irq(&xtime_lock);
141 clock_was_set(); 140 clock_was_set();
142} 141}
@@ -309,92 +308,6 @@ struct timespec timespec_trunc(struct timespec t, unsigned gran)
309} 308}
310EXPORT_SYMBOL(timespec_trunc); 309EXPORT_SYMBOL(timespec_trunc);
311 310
312#ifdef CONFIG_TIME_INTERPOLATION
313void getnstimeofday (struct timespec *tv)
314{
315 unsigned long seq,sec,nsec;
316
317 do {
318 seq = read_seqbegin(&xtime_lock);
319 sec = xtime.tv_sec;
320 nsec = xtime.tv_nsec+time_interpolator_get_offset();
321 } while (unlikely(read_seqretry(&xtime_lock, seq)));
322
323 while (unlikely(nsec >= NSEC_PER_SEC)) {
324 nsec -= NSEC_PER_SEC;
325 ++sec;
326 }
327 tv->tv_sec = sec;
328 tv->tv_nsec = nsec;
329}
330EXPORT_SYMBOL_GPL(getnstimeofday);
331
332int do_settimeofday (struct timespec *tv)
333{
334 time_t wtm_sec, sec = tv->tv_sec;
335 long wtm_nsec, nsec = tv->tv_nsec;
336
337 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
338 return -EINVAL;
339
340 write_seqlock_irq(&xtime_lock);
341 {
342 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
343 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
344
345 set_normalized_timespec(&xtime, sec, nsec);
346 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
347
348 time_adjust = 0; /* stop active adjtime() */
349 time_status |= STA_UNSYNC;
350 time_maxerror = NTP_PHASE_LIMIT;
351 time_esterror = NTP_PHASE_LIMIT;
352 time_interpolator_reset();
353 }
354 write_sequnlock_irq(&xtime_lock);
355 clock_was_set();
356 return 0;
357}
358EXPORT_SYMBOL(do_settimeofday);
359
360void do_gettimeofday (struct timeval *tv)
361{
362 unsigned long seq, nsec, usec, sec, offset;
363 do {
364 seq = read_seqbegin(&xtime_lock);
365 offset = time_interpolator_get_offset();
366 sec = xtime.tv_sec;
367 nsec = xtime.tv_nsec;
368 } while (unlikely(read_seqretry(&xtime_lock, seq)));
369
370 usec = (nsec + offset) / 1000;
371
372 while (unlikely(usec >= USEC_PER_SEC)) {
373 usec -= USEC_PER_SEC;
374 ++sec;
375 }
376
377 tv->tv_sec = sec;
378 tv->tv_usec = usec;
379
380 /*
381 * Make sure xtime.tv_sec [returned by sys_time()] always
382 * follows the gettimeofday() result precisely. This
383 * condition is extremely unlikely, it can hit at most
384 * once per second:
385 */
386 if (unlikely(xtime.tv_sec != tv->tv_sec)) {
387 unsigned long flags;
388
389 write_seqlock_irqsave(&xtime_lock, flags);
390 update_wall_time();
391 write_sequnlock_irqrestore(&xtime_lock, flags);
392 }
393}
394EXPORT_SYMBOL(do_gettimeofday);
395
396#else /* CONFIG_TIME_INTERPOLATION */
397
398#ifndef CONFIG_GENERIC_TIME 311#ifndef CONFIG_GENERIC_TIME
399/* 312/*
400 * Simulate gettimeofday using do_gettimeofday which only allows a timeval 313 * Simulate gettimeofday using do_gettimeofday which only allows a timeval
@@ -410,7 +323,6 @@ void getnstimeofday(struct timespec *tv)
410} 323}
411EXPORT_SYMBOL_GPL(getnstimeofday); 324EXPORT_SYMBOL_GPL(getnstimeofday);
412#endif 325#endif
413#endif /* CONFIG_TIME_INTERPOLATION */
414 326
415/* Converts Gregorian date to seconds since 1970-01-01 00:00:00. 327/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
416 * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 328 * Assumes input in normal date format, i.e. 1980-12-31 23:59:59