aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hrtimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r--include/linux/hrtimer.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index f79dcba4b2c1..600fc3bcf63e 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -78,7 +78,7 @@ enum hrtimer_cb_mode {
78 * as otherwise the timer could be removed before the softirq code finishes the 78 * as otherwise the timer could be removed before the softirq code finishes the
79 * the handling of the timer. 79 * the handling of the timer.
80 * 80 *
81 * The HRTIMER_STATE_ENQUEUE bit is always or'ed to the current state to 81 * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to
82 * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. 82 * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario.
83 * 83 *
84 * All state transitions are protected by cpu_base->lock. 84 * All state transitions are protected by cpu_base->lock.
@@ -225,11 +225,14 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer)
225 * idea of the (in)accuracy of timers. Timer values are rounded up to 225 * idea of the (in)accuracy of timers. Timer values are rounded up to
226 * this resolution values. 226 * this resolution values.
227 */ 227 */
228# define KTIME_HIGH_RES (ktime_t) { .tv64 = 1 } 228# define HIGH_RES_NSEC 1
229# define KTIME_HIGH_RES (ktime_t) { .tv64 = HIGH_RES_NSEC }
230# define MONOTONIC_RES_NSEC HIGH_RES_NSEC
229# define KTIME_MONOTONIC_RES KTIME_HIGH_RES 231# define KTIME_MONOTONIC_RES KTIME_HIGH_RES
230 232
231#else 233#else
232 234
235# define MONOTONIC_RES_NSEC LOW_RES_NSEC
233# define KTIME_MONOTONIC_RES KTIME_LOW_RES 236# define KTIME_MONOTONIC_RES KTIME_LOW_RES
234 237
235/* 238/*
@@ -301,9 +304,16 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
301} 304}
302 305
303/* Forward a hrtimer so it expires after now: */ 306/* Forward a hrtimer so it expires after now: */
304extern unsigned long 307extern u64
305hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); 308hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
306 309
310/* Forward a hrtimer so it expires after the hrtimer's current now */
311static inline u64 hrtimer_forward_now(struct hrtimer *timer,
312 ktime_t interval)
313{
314 return hrtimer_forward(timer, timer->base->get_time(), interval);
315}
316
307/* Precise sleep: */ 317/* Precise sleep: */
308extern long hrtimer_nanosleep(struct timespec *rqtp, 318extern long hrtimer_nanosleep(struct timespec *rqtp,
309 struct timespec *rmtp, 319 struct timespec *rmtp,
@@ -322,9 +332,9 @@ extern void hrtimer_run_pending(void);
322extern void __init hrtimers_init(void); 332extern void __init hrtimers_init(void);
323 333
324#if BITS_PER_LONG < 64 334#if BITS_PER_LONG < 64
325extern unsigned long ktime_divns(const ktime_t kt, s64 div); 335extern u64 ktime_divns(const ktime_t kt, s64 div);
326#else /* BITS_PER_LONG < 64 */ 336#else /* BITS_PER_LONG < 64 */
327# define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div)) 337# define ktime_divns(kt, div) (u64)((kt).tv64 / (div))
328#endif 338#endif
329 339
330/* Show pending timers: */ 340/* Show pending timers: */