Lines Matching refs:timer
93 struct hrtimer timer; member
97 static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) in hrtimer_set_expires() argument
99 timer->node.expires = time; in hrtimer_set_expires()
100 timer->_softexpires = time; in hrtimer_set_expires()
103 static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) in hrtimer_set_expires_range() argument
105 timer->_softexpires = time; in hrtimer_set_expires_range()
106 timer->node.expires = ktime_add_safe(time, delta); in hrtimer_set_expires_range()
109 static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, u64 delta) in hrtimer_set_expires_range_ns() argument
111 timer->_softexpires = time; in hrtimer_set_expires_range_ns()
112 timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta)); in hrtimer_set_expires_range_ns()
115 static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) in hrtimer_set_expires_tv64() argument
117 timer->node.expires = tv64; in hrtimer_set_expires_tv64()
118 timer->_softexpires = tv64; in hrtimer_set_expires_tv64()
121 static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) in hrtimer_add_expires() argument
123 timer->node.expires = ktime_add_safe(timer->node.expires, time); in hrtimer_add_expires()
124 timer->_softexpires = ktime_add_safe(timer->_softexpires, time); in hrtimer_add_expires()
127 static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns) in hrtimer_add_expires_ns() argument
129 timer->node.expires = ktime_add_ns(timer->node.expires, ns); in hrtimer_add_expires_ns()
130 timer->_softexpires = ktime_add_ns(timer->_softexpires, ns); in hrtimer_add_expires_ns()
133 static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) in hrtimer_get_expires() argument
135 return timer->node.expires; in hrtimer_get_expires()
138 static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) in hrtimer_get_softexpires() argument
140 return timer->_softexpires; in hrtimer_get_softexpires()
143 static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) in hrtimer_get_expires_tv64() argument
145 return timer->node.expires; in hrtimer_get_expires_tv64()
147 static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) in hrtimer_get_softexpires_tv64() argument
149 return timer->_softexpires; in hrtimer_get_softexpires_tv64()
152 static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) in hrtimer_get_expires_ns() argument
154 return ktime_to_ns(timer->node.expires); in hrtimer_get_expires_ns()
157 static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) in hrtimer_expires_remaining() argument
159 return ktime_sub(timer->node.expires, timer->base->get_time()); in hrtimer_expires_remaining()
162 static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) in hrtimer_cb_get_time() argument
164 return timer->base->get_time(); in hrtimer_cb_get_time()
167 static inline int hrtimer_is_hres_active(struct hrtimer *timer) in hrtimer_is_hres_active() argument
170 timer->base->cpu_base->hres_active : 0; in hrtimer_is_hres_active()
187 __hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now) in __hrtimer_expires_remaining_adjusted() argument
189 ktime_t rem = ktime_sub(timer->node.expires, now); in __hrtimer_expires_remaining_adjusted()
195 if (IS_ENABLED(CONFIG_TIME_LOW_RES) && timer->is_rel) in __hrtimer_expires_remaining_adjusted()
201 hrtimer_expires_remaining_adjusted(const struct hrtimer *timer) in hrtimer_expires_remaining_adjusted() argument
203 return __hrtimer_expires_remaining_adjusted(timer, in hrtimer_expires_remaining_adjusted()
204 timer->base->get_time()); in hrtimer_expires_remaining_adjusted()
218 void hrtimer_cancel_wait_running(const struct hrtimer *timer);
220 static inline void hrtimer_cancel_wait_running(struct hrtimer *timer) in hrtimer_cancel_wait_running() argument
229 extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
235 extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clock,
241 extern void destroy_hrtimer_on_stack(struct hrtimer *timer);
243 static inline void hrtimer_init_on_stack(struct hrtimer *timer, in hrtimer_init_on_stack() argument
247 hrtimer_init(timer, which_clock, mode); in hrtimer_init_on_stack()
257 static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } in destroy_hrtimer_on_stack() argument
261 extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
272 static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim, in hrtimer_start() argument
275 hrtimer_start_range_ns(timer, tim, 0, mode); in hrtimer_start()
278 extern int hrtimer_cancel(struct hrtimer *timer);
279 extern int hrtimer_try_to_cancel(struct hrtimer *timer);
281 static inline void hrtimer_start_expires(struct hrtimer *timer, in hrtimer_start_expires() argument
286 soft = hrtimer_get_softexpires(timer); in hrtimer_start_expires()
287 hard = hrtimer_get_expires(timer); in hrtimer_start_expires()
289 hrtimer_start_range_ns(timer, soft, delta, mode); in hrtimer_start_expires()
295 static inline void hrtimer_restart(struct hrtimer *timer) in hrtimer_restart() argument
297 hrtimer_start_expires(timer, HRTIMER_MODE_ABS); in hrtimer_restart()
301 extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
307 static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer) in hrtimer_get_remaining() argument
309 return __hrtimer_get_remaining(timer, false); in hrtimer_get_remaining()
315 extern bool hrtimer_active(const struct hrtimer *timer);
325 static inline bool hrtimer_is_queued(struct hrtimer *timer) in hrtimer_is_queued() argument
328 return !!(READ_ONCE(timer->state) & HRTIMER_STATE_ENQUEUED); in hrtimer_is_queued()
335 static inline int hrtimer_callback_running(struct hrtimer *timer) in hrtimer_callback_running() argument
337 return timer->base->running == timer; in hrtimer_callback_running()
342 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
352 static inline u64 hrtimer_forward_now(struct hrtimer *timer, in hrtimer_forward_now() argument
355 return hrtimer_forward(timer, timer->base->get_time(), interval); in hrtimer_forward_now()