diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-04-03 06:27:29 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-04-03 06:27:29 -0400 |
commit | 0ed2aef9b3bffe598045b62a31a50d912eee92d8 (patch) | |
tree | d7dda12955c838f531727d2775d09c4e04bdf066 /kernel/hrtimer.c | |
parent | cfea7d7e452f57682a0bb55a55e9f79c569558c2 (diff) | |
parent | 8011657b9e63cb2e914b9a0f75233b910c1854cb (diff) |
Merge branch 'fortglx/3.10/time' of git://git.linaro.org/people/jstultz/linux into timers/core
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r-- | kernel/hrtimer.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 031184e3d872..d6830d5ae730 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -83,6 +83,12 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) = | |||
83 | .get_time = &ktime_get_boottime, | 83 | .get_time = &ktime_get_boottime, |
84 | .resolution = KTIME_LOW_RES, | 84 | .resolution = KTIME_LOW_RES, |
85 | }, | 85 | }, |
86 | { | ||
87 | .index = HRTIMER_BASE_TAI, | ||
88 | .clockid = CLOCK_TAI, | ||
89 | .get_time = &ktime_get_clocktai, | ||
90 | .resolution = KTIME_LOW_RES, | ||
91 | }, | ||
86 | } | 92 | } |
87 | }; | 93 | }; |
88 | 94 | ||
@@ -90,6 +96,7 @@ static const int hrtimer_clock_to_base_table[MAX_CLOCKS] = { | |||
90 | [CLOCK_REALTIME] = HRTIMER_BASE_REALTIME, | 96 | [CLOCK_REALTIME] = HRTIMER_BASE_REALTIME, |
91 | [CLOCK_MONOTONIC] = HRTIMER_BASE_MONOTONIC, | 97 | [CLOCK_MONOTONIC] = HRTIMER_BASE_MONOTONIC, |
92 | [CLOCK_BOOTTIME] = HRTIMER_BASE_BOOTTIME, | 98 | [CLOCK_BOOTTIME] = HRTIMER_BASE_BOOTTIME, |
99 | [CLOCK_TAI] = HRTIMER_BASE_TAI, | ||
93 | }; | 100 | }; |
94 | 101 | ||
95 | static inline int hrtimer_clockid_to_base(clockid_t clock_id) | 102 | static inline int hrtimer_clockid_to_base(clockid_t clock_id) |
@@ -106,8 +113,10 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) | |||
106 | { | 113 | { |
107 | ktime_t xtim, mono, boot; | 114 | ktime_t xtim, mono, boot; |
108 | struct timespec xts, tom, slp; | 115 | struct timespec xts, tom, slp; |
116 | s32 tai_offset; | ||
109 | 117 | ||
110 | get_xtime_and_monotonic_and_sleep_offset(&xts, &tom, &slp); | 118 | get_xtime_and_monotonic_and_sleep_offset(&xts, &tom, &slp); |
119 | tai_offset = timekeeping_get_tai_offset(); | ||
111 | 120 | ||
112 | xtim = timespec_to_ktime(xts); | 121 | xtim = timespec_to_ktime(xts); |
113 | mono = ktime_add(xtim, timespec_to_ktime(tom)); | 122 | mono = ktime_add(xtim, timespec_to_ktime(tom)); |
@@ -115,6 +124,8 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) | |||
115 | base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim; | 124 | base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim; |
116 | base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono; | 125 | base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono; |
117 | base->clock_base[HRTIMER_BASE_BOOTTIME].softirq_time = boot; | 126 | base->clock_base[HRTIMER_BASE_BOOTTIME].softirq_time = boot; |
127 | base->clock_base[HRTIMER_BASE_TAI].softirq_time = | ||
128 | ktime_add(xtim, ktime_set(tai_offset, 0)); | ||
118 | } | 129 | } |
119 | 130 | ||
120 | /* | 131 | /* |
@@ -651,8 +662,9 @@ static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) | |||
651 | { | 662 | { |
652 | ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; | 663 | ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; |
653 | ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; | 664 | ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; |
665 | ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset; | ||
654 | 666 | ||
655 | return ktime_get_update_offsets(offs_real, offs_boot); | 667 | return ktime_get_update_offsets(offs_real, offs_boot, offs_tai); |
656 | } | 668 | } |
657 | 669 | ||
658 | /* | 670 | /* |