diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hrtimer.h | 20 | ||||
| -rw-r--r-- | include/linux/timer.h | 2 |
2 files changed, 13 insertions, 9 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 660d91dea78c..44c7d280b1a5 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -25,17 +25,18 @@ | |||
| 25 | * Mode arguments of xxx_hrtimer functions: | 25 | * Mode arguments of xxx_hrtimer functions: |
| 26 | */ | 26 | */ |
| 27 | enum hrtimer_mode { | 27 | enum hrtimer_mode { |
| 28 | HRTIMER_ABS, /* Time value is absolute */ | 28 | HRTIMER_MODE_ABS, /* Time value is absolute */ |
| 29 | HRTIMER_REL, /* Time value is relative to now */ | 29 | HRTIMER_MODE_REL, /* Time value is relative to now */ |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | /* | ||
| 33 | * Return values for the callback function | ||
| 34 | */ | ||
| 32 | enum hrtimer_restart { | 35 | enum hrtimer_restart { |
| 33 | HRTIMER_NORESTART, | 36 | HRTIMER_NORESTART, /* Timer is not restarted */ |
| 34 | HRTIMER_RESTART, | 37 | HRTIMER_RESTART, /* Timer must be restarted */ |
| 35 | }; | 38 | }; |
| 36 | 39 | ||
| 37 | #define HRTIMER_INACTIVE ((void *)1UL) | ||
| 38 | |||
| 39 | struct hrtimer_base; | 40 | struct hrtimer_base; |
| 40 | 41 | ||
| 41 | /** | 42 | /** |
| @@ -52,7 +53,7 @@ struct hrtimer_base; | |||
| 52 | struct hrtimer { | 53 | struct hrtimer { |
| 53 | struct rb_node node; | 54 | struct rb_node node; |
| 54 | ktime_t expires; | 55 | ktime_t expires; |
| 55 | int (*function)(struct hrtimer *); | 56 | enum hrtimer_restart (*function)(struct hrtimer *); |
| 56 | struct hrtimer_base *base; | 57 | struct hrtimer_base *base; |
| 57 | }; | 58 | }; |
| 58 | 59 | ||
| @@ -114,7 +115,10 @@ extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, | |||
| 114 | extern int hrtimer_cancel(struct hrtimer *timer); | 115 | extern int hrtimer_cancel(struct hrtimer *timer); |
| 115 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); | 116 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); |
| 116 | 117 | ||
| 117 | #define hrtimer_restart(timer) hrtimer_start((timer), (timer)->expires, HRTIMER_ABS) | 118 | static inline int hrtimer_restart(struct hrtimer *timer) |
| 119 | { | ||
| 120 | return hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS); | ||
| 121 | } | ||
| 118 | 122 | ||
| 119 | /* Query timers: */ | 123 | /* Query timers: */ |
| 120 | extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); | 124 | extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); |
diff --git a/include/linux/timer.h b/include/linux/timer.h index bd0af324fd48..44d41e9d7818 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -106,7 +106,7 @@ static inline void add_timer(struct timer_list *timer) | |||
| 106 | extern void init_timers(void); | 106 | extern void init_timers(void); |
| 107 | extern void run_local_timers(void); | 107 | extern void run_local_timers(void); |
| 108 | struct hrtimer; | 108 | struct hrtimer; |
| 109 | extern int it_real_fn(struct hrtimer *); | 109 | extern enum hrtimer_restart it_real_fn(struct hrtimer *); |
| 110 | 110 | ||
| 111 | unsigned long __round_jiffies(unsigned long j, int cpu); | 111 | unsigned long __round_jiffies(unsigned long j, int cpu); |
| 112 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); | 112 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); |
