Lines Matching refs:hrtimer

40 	struct hrtimer *hrtimer;  in hrtimer_call_handler()  local
43 hrtimer = arg; in hrtimer_call_handler()
44 ret = hrtimer->function(hrtimer); in hrtimer_call_handler()
47 callout_schedule_sbt(&hrtimer->callout, in hrtimer_call_handler()
48 nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); in hrtimer_call_handler()
50 callout_deactivate(&hrtimer->callout); in hrtimer_call_handler()
55 linux_hrtimer_active(struct hrtimer *hrtimer) in linux_hrtimer_active() argument
59 mtx_lock(&hrtimer->mtx); in linux_hrtimer_active()
60 ret = callout_active(&hrtimer->callout); in linux_hrtimer_active()
61 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_active()
72 linux_hrtimer_try_to_cancel(struct hrtimer *hrtimer) in linux_hrtimer_try_to_cancel() argument
76 mtx_lock(&hrtimer->mtx); in linux_hrtimer_try_to_cancel()
77 ret = callout_stop(&hrtimer->callout); in linux_hrtimer_try_to_cancel()
78 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_try_to_cancel()
93 linux_hrtimer_cancel(struct hrtimer *hrtimer) in linux_hrtimer_cancel() argument
96 return (callout_drain(&hrtimer->callout) > 0); in linux_hrtimer_cancel()
100 linux_hrtimer_init(struct hrtimer *hrtimer) in linux_hrtimer_init() argument
103 memset(hrtimer, 0, sizeof(*hrtimer)); in linux_hrtimer_init()
104 mtx_init(&hrtimer->mtx, "hrtimer", NULL, in linux_hrtimer_init()
106 callout_init_mtx(&hrtimer->callout, &hrtimer->mtx, 0); in linux_hrtimer_init()
110 linux_hrtimer_set_expires(struct hrtimer *hrtimer, ktime_t time) in linux_hrtimer_set_expires() argument
112 hrtimer->expires = ktime_to_ns(time); in linux_hrtimer_set_expires()
116 linux_hrtimer_start(struct hrtimer *hrtimer, ktime_t time) in linux_hrtimer_start() argument
119 linux_hrtimer_start_range_ns(hrtimer, time, 0); in linux_hrtimer_start()
123 linux_hrtimer_start_range_ns(struct hrtimer *hrtimer, ktime_t time, in linux_hrtimer_start_range_ns() argument
127 mtx_lock(&hrtimer->mtx); in linux_hrtimer_start_range_ns()
128 hrtimer->precision = nsec; in linux_hrtimer_start_range_ns()
129 callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), in linux_hrtimer_start_range_ns()
130 nstosbt(nsec), hrtimer_call_handler, hrtimer, 0); in linux_hrtimer_start_range_ns()
131 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_start_range_ns()
135 linux_hrtimer_forward_now(struct hrtimer *hrtimer, ktime_t interval) in linux_hrtimer_forward_now() argument
138 mtx_lock(&hrtimer->mtx); in linux_hrtimer_forward_now()
139 callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), in linux_hrtimer_forward_now()
140 nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); in linux_hrtimer_forward_now()
141 mtx_unlock(&hrtimer->mtx); in linux_hrtimer_forward_now()