aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/hrtimer.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2014-07-16 17:03:52 -0400
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 13:16:50 -0400
commit76f4108892d9a9e3408bba839914f97a54086a6f (patch)
tree9f44cd624fc7781cac2f77630c37013fe24432e6 /kernel/time/hrtimer.c
parente06fde37b860f5030e93475a2a95857af7ad13e1 (diff)
hrtimer: Cleanup hrtimer accessors to the timekepeing state
Rather then having two similar but totally different implementations that provide timekeeping state to the hrtimer code, try to unify the two implementations to be more simliar. Thus this clarifies ktime_get_update_offsets to ktime_get_update_offsets_now and changes get_xtime... to ktime_get_update_offsets_tick. Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/hrtimer.c')
-rw-r--r--kernel/time/hrtimer.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 66a6dc1075ad..2f4ef8a1e5ff 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -114,21 +114,18 @@ static inline int hrtimer_clockid_to_base(clockid_t clock_id)
114 */ 114 */
115static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) 115static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
116{ 116{
117 ktime_t xtim, mono, boot; 117 ktime_t xtim, mono, boot, tai;
118 struct timespec xts, tom, slp; 118 ktime_t off_real, off_boot, off_tai;
119 s32 tai_offset;
120 119
121 get_xtime_and_monotonic_and_sleep_offset(&xts, &tom, &slp); 120 mono = ktime_get_update_offsets_tick(&off_real, &off_boot, &off_tai);
122 tai_offset = timekeeping_get_tai_offset(); 121 boot = ktime_add(mono, off_boot);
122 xtim = ktime_add(mono, off_real);
123 tai = ktime_add(xtim, off_tai);
123 124
124 xtim = timespec_to_ktime(xts);
125 mono = ktime_add(xtim, timespec_to_ktime(tom));
126 boot = ktime_add(mono, timespec_to_ktime(slp));
127 base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim; 125 base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim;
128 base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono; 126 base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono;
129 base->clock_base[HRTIMER_BASE_BOOTTIME].softirq_time = boot; 127 base->clock_base[HRTIMER_BASE_BOOTTIME].softirq_time = boot;
130 base->clock_base[HRTIMER_BASE_TAI].softirq_time = 128 base->clock_base[HRTIMER_BASE_TAI].softirq_time = tai;
131 ktime_add(xtim, ktime_set(tai_offset, 0));
132} 129}
133 130
134/* 131/*
@@ -673,7 +670,7 @@ static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
673 ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; 670 ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset;
674 ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset; 671 ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset;
675 672
676 return ktime_get_update_offsets(offs_real, offs_boot, offs_tai); 673 return ktime_get_update_offsets_now(offs_real, offs_boot, offs_tai);
677} 674}
678 675
679/* 676/*