diff options
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r-- | include/linux/hrtimer.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 56f3236da829..6d93dce61cbb 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -266,6 +266,21 @@ extern ktime_t ktime_get_real(void); | |||
266 | extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, | 266 | extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, |
267 | enum hrtimer_mode mode); | 267 | enum hrtimer_mode mode); |
268 | 268 | ||
269 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS | ||
270 | extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clock, | ||
271 | enum hrtimer_mode mode); | ||
272 | |||
273 | extern void destroy_hrtimer_on_stack(struct hrtimer *timer); | ||
274 | #else | ||
275 | static inline void hrtimer_init_on_stack(struct hrtimer *timer, | ||
276 | clockid_t which_clock, | ||
277 | enum hrtimer_mode mode) | ||
278 | { | ||
279 | hrtimer_init(timer, which_clock, mode); | ||
280 | } | ||
281 | static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } | ||
282 | #endif | ||
283 | |||
269 | /* Basic timer operations: */ | 284 | /* Basic timer operations: */ |
270 | extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, | 285 | extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, |
271 | const enum hrtimer_mode mode); | 286 | const enum hrtimer_mode mode); |
@@ -301,6 +316,15 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) | |||
301 | (HRTIMER_STATE_ENQUEUED | HRTIMER_STATE_PENDING); | 316 | (HRTIMER_STATE_ENQUEUED | HRTIMER_STATE_PENDING); |
302 | } | 317 | } |
303 | 318 | ||
319 | /* | ||
320 | * Helper function to check, whether the timer is running the callback | ||
321 | * function | ||
322 | */ | ||
323 | static inline int hrtimer_callback_running(struct hrtimer *timer) | ||
324 | { | ||
325 | return timer->state & HRTIMER_STATE_CALLBACK; | ||
326 | } | ||
327 | |||
304 | /* Forward a hrtimer so it expires after now: */ | 328 | /* Forward a hrtimer so it expires after now: */ |
305 | extern u64 | 329 | extern u64 |
306 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); | 330 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); |