diff options
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r-- | include/linux/hrtimer.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 62f500c724f9..51932e5acf7c 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -143,19 +143,18 @@ struct hrtimer_sleeper { | |||
143 | */ | 143 | */ |
144 | struct hrtimer_clock_base { | 144 | struct hrtimer_clock_base { |
145 | struct hrtimer_cpu_base *cpu_base; | 145 | struct hrtimer_cpu_base *cpu_base; |
146 | clockid_t index; | 146 | int index; |
147 | clockid_t clockid; | ||
147 | struct timerqueue_head active; | 148 | struct timerqueue_head active; |
148 | ktime_t resolution; | 149 | ktime_t resolution; |
149 | ktime_t (*get_time)(void); | 150 | ktime_t (*get_time)(void); |
150 | ktime_t softirq_time; | 151 | ktime_t softirq_time; |
151 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
152 | ktime_t offset; | 152 | ktime_t offset; |
153 | #endif | ||
154 | }; | 153 | }; |
155 | 154 | ||
156 | enum hrtimer_base_type { | 155 | enum hrtimer_base_type { |
157 | HRTIMER_BASE_REALTIME, | ||
158 | HRTIMER_BASE_MONOTONIC, | 156 | HRTIMER_BASE_MONOTONIC, |
157 | HRTIMER_BASE_REALTIME, | ||
159 | HRTIMER_BASE_BOOTTIME, | 158 | HRTIMER_BASE_BOOTTIME, |
160 | HRTIMER_MAX_CLOCK_BASES, | 159 | HRTIMER_MAX_CLOCK_BASES, |
161 | }; | 160 | }; |
@@ -164,7 +163,7 @@ enum hrtimer_base_type { | |||
164 | * struct hrtimer_cpu_base - the per cpu clock bases | 163 | * struct hrtimer_cpu_base - the per cpu clock bases |
165 | * @lock: lock protecting the base and associated clock bases | 164 | * @lock: lock protecting the base and associated clock bases |
166 | * and timers | 165 | * and timers |
167 | * @clock_base: array of clock bases for this cpu | 166 | * @active_bases: Bitfield to mark bases with active timers |
168 | * @expires_next: absolute time of the next event which was scheduled | 167 | * @expires_next: absolute time of the next event which was scheduled |
169 | * via clock_set_next_event() | 168 | * via clock_set_next_event() |
170 | * @hres_active: State of high resolution mode | 169 | * @hres_active: State of high resolution mode |
@@ -173,10 +172,11 @@ enum hrtimer_base_type { | |||
173 | * @nr_retries: Total number of hrtimer interrupt retries | 172 | * @nr_retries: Total number of hrtimer interrupt retries |
174 | * @nr_hangs: Total number of hrtimer interrupt hangs | 173 | * @nr_hangs: Total number of hrtimer interrupt hangs |
175 | * @max_hang_time: Maximum time spent in hrtimer_interrupt | 174 | * @max_hang_time: Maximum time spent in hrtimer_interrupt |
175 | * @clock_base: array of clock bases for this cpu | ||
176 | */ | 176 | */ |
177 | struct hrtimer_cpu_base { | 177 | struct hrtimer_cpu_base { |
178 | raw_spinlock_t lock; | 178 | raw_spinlock_t lock; |
179 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; | 179 | unsigned long active_bases; |
180 | #ifdef CONFIG_HIGH_RES_TIMERS | 180 | #ifdef CONFIG_HIGH_RES_TIMERS |
181 | ktime_t expires_next; | 181 | ktime_t expires_next; |
182 | int hres_active; | 182 | int hres_active; |
@@ -186,6 +186,7 @@ struct hrtimer_cpu_base { | |||
186 | unsigned long nr_hangs; | 186 | unsigned long nr_hangs; |
187 | ktime_t max_hang_time; | 187 | ktime_t max_hang_time; |
188 | #endif | 188 | #endif |
189 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; | ||
189 | }; | 190 | }; |
190 | 191 | ||
191 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) | 192 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) |
@@ -256,8 +257,6 @@ static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) | |||
256 | #ifdef CONFIG_HIGH_RES_TIMERS | 257 | #ifdef CONFIG_HIGH_RES_TIMERS |
257 | struct clock_event_device; | 258 | struct clock_event_device; |
258 | 259 | ||
259 | extern void clock_was_set(void); | ||
260 | extern void hres_timers_resume(void); | ||
261 | extern void hrtimer_interrupt(struct clock_event_device *dev); | 260 | extern void hrtimer_interrupt(struct clock_event_device *dev); |
262 | 261 | ||
263 | /* | 262 | /* |
@@ -291,16 +290,8 @@ extern void hrtimer_peek_ahead_timers(void); | |||
291 | # define MONOTONIC_RES_NSEC LOW_RES_NSEC | 290 | # define MONOTONIC_RES_NSEC LOW_RES_NSEC |
292 | # define KTIME_MONOTONIC_RES KTIME_LOW_RES | 291 | # define KTIME_MONOTONIC_RES KTIME_LOW_RES |
293 | 292 | ||
294 | /* | ||
295 | * clock_was_set() is a NOP for non- high-resolution systems. The | ||
296 | * time-sorted order guarantees that a timer does not expire early and | ||
297 | * is expired in the next softirq when the clock was advanced. | ||
298 | */ | ||
299 | static inline void clock_was_set(void) { } | ||
300 | static inline void hrtimer_peek_ahead_timers(void) { } | 293 | static inline void hrtimer_peek_ahead_timers(void) { } |
301 | 294 | ||
302 | static inline void hres_timers_resume(void) { } | ||
303 | |||
304 | /* | 295 | /* |
305 | * In non high resolution mode the time reference is taken from | 296 | * In non high resolution mode the time reference is taken from |
306 | * the base softirq time variable. | 297 | * the base softirq time variable. |
@@ -316,10 +307,18 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer) | |||
316 | } | 307 | } |
317 | #endif | 308 | #endif |
318 | 309 | ||
310 | extern void clock_was_set(void); | ||
311 | #ifdef CONFIG_TIMERFD | ||
312 | extern void timerfd_clock_was_set(void); | ||
313 | #else | ||
314 | static inline void timerfd_clock_was_set(void) { } | ||
315 | #endif | ||
316 | extern void hrtimers_resume(void); | ||
317 | |||
319 | extern ktime_t ktime_get(void); | 318 | extern ktime_t ktime_get(void); |
320 | extern ktime_t ktime_get_real(void); | 319 | extern ktime_t ktime_get_real(void); |
321 | extern ktime_t ktime_get_boottime(void); | 320 | extern ktime_t ktime_get_boottime(void); |
322 | 321 | extern ktime_t ktime_get_monotonic_offset(void); | |
323 | 322 | ||
324 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); | 323 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); |
325 | 324 | ||