aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorJohn Stultz <johnstul@us.ibm.com>2010-07-13 20:56:20 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-07-27 06:40:54 -0400
commit592913ecb87a9e06f98ddb55b298f1a66bf94c6b (patch)
tree0f63f5535fe517faf418e0f7e69800fcf1e4d8db /kernel/time/timekeeping.c
parentce3bf7ab22527183634a76512d9854a38615e4d5 (diff)
time: Kill off CONFIG_GENERIC_TIME
Now that all arches have been converted over to use generic time via clocksources or arch_gettimeoffset(), we can remove the GENERIC_TIME config option and simplify the generic code. Signed-off-by: John Stultz <johnstul@us.ibm.com> LKML-Reference: <1279068988-21864-4-git-send-email-johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c55
1 files changed, 4 insertions, 51 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 623fe3d504dc..73edd4074b50 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -173,8 +173,6 @@ void timekeeping_leap_insert(int leapsecond)
173 update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult); 173 update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult);
174} 174}
175 175
176#ifdef CONFIG_GENERIC_TIME
177
178/** 176/**
179 * timekeeping_forward_now - update clock to the current time 177 * timekeeping_forward_now - update clock to the current time
180 * 178 *
@@ -376,52 +374,6 @@ void timekeeping_notify(struct clocksource *clock)
376 tick_clock_notify(); 374 tick_clock_notify();
377} 375}
378 376
379#else /* GENERIC_TIME */
380
381static inline void timekeeping_forward_now(void) { }
382
383/**
384 * ktime_get - get the monotonic time in ktime_t format
385 *
386 * returns the time in ktime_t format
387 */
388ktime_t ktime_get(void)
389{
390 struct timespec now;
391
392 ktime_get_ts(&now);
393
394 return timespec_to_ktime(now);
395}
396EXPORT_SYMBOL_GPL(ktime_get);
397
398/**
399 * ktime_get_ts - get the monotonic clock in timespec format
400 * @ts: pointer to timespec variable
401 *
402 * The function calculates the monotonic clock from the realtime
403 * clock and the wall_to_monotonic offset and stores the result
404 * in normalized timespec format in the variable pointed to by @ts.
405 */
406void ktime_get_ts(struct timespec *ts)
407{
408 struct timespec tomono;
409 unsigned long seq;
410
411 do {
412 seq = read_seqbegin(&xtime_lock);
413 getnstimeofday(ts);
414 tomono = wall_to_monotonic;
415
416 } while (read_seqretry(&xtime_lock, seq));
417
418 set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec,
419 ts->tv_nsec + tomono.tv_nsec);
420}
421EXPORT_SYMBOL_GPL(ktime_get_ts);
422
423#endif /* !GENERIC_TIME */
424
425/** 377/**
426 * ktime_get_real - get the real (wall-) time in ktime_t format 378 * ktime_get_real - get the real (wall-) time in ktime_t format
427 * 379 *
@@ -784,10 +736,11 @@ void update_wall_time(void)
784 return; 736 return;
785 737
786 clock = timekeeper.clock; 738 clock = timekeeper.clock;
787#ifdef CONFIG_GENERIC_TIME 739
788 offset = (clock->read(clock) - clock->cycle_last) & clock->mask; 740#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
789#else
790 offset = timekeeper.cycle_interval; 741 offset = timekeeper.cycle_interval;
742#else
743 offset = (clock->read(clock) - clock->cycle_last) & clock->mask;
791#endif 744#endif
792 timekeeper.xtime_nsec = (s64)xtime.tv_nsec << timekeeper.shift; 745 timekeeper.xtime_nsec = (s64)xtime.tv_nsec << timekeeper.shift;
793 746