• Home
  • Raw
  • Download

Lines Matching refs:timer

122 	struct k_itimer *timer;  in __posix_timers_find()  local
124 hlist_for_each_entry_rcu(timer, head, t_hash, in __posix_timers_find()
126 if ((timer->it_signal == sig) && (timer->it_id == id)) in __posix_timers_find()
127 return timer; in __posix_timers_find()
140 static int posix_timer_add(struct k_itimer *timer) in posix_timer_add() argument
151 hlist_add_head_rcu(&timer->t_hash, head); in posix_timer_add()
295 struct hrtimer *timer = &timr->it.real.timer; in common_hrtimer_rearm() local
297 timr->it_overrun += hrtimer_forward(timer, timer->base->get_time(), in common_hrtimer_rearm()
299 hrtimer_restart(timer); in common_hrtimer_rearm()
366 static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer) in posix_timer_fn() argument
373 timr = container_of(timer, struct k_itimer, it.real.timer); in posix_timer_fn()
387 ktime_t now = hrtimer_cb_get_time(timer); in posix_timer_fn()
419 timr->it_overrun += hrtimer_forward(timer, now, in posix_timer_fn()
493 hrtimer_init(&new_timer->it.real.timer, new_timer->it_clock, 0); in common_timer_create()
642 struct hrtimer *timer = &timr->it.real.timer; in common_hrtimer_remaining() local
644 return __hrtimer_expires_remaining_adjusted(timer, now); in common_hrtimer_remaining()
649 struct hrtimer *timer = &timr->it.real.timer; in common_hrtimer_forward() local
651 return hrtimer_forward(timer, now, timr->it_interval); in common_hrtimer_forward()
796 struct hrtimer *timer = &timr->it.real.timer; in common_hrtimer_arm() local
812 hrtimer_init(&timr->it.real.timer, timr->it_clock, mode); in common_hrtimer_arm()
813 timr->it.real.timer.function = posix_timer_fn; in common_hrtimer_arm()
816 expires = ktime_add_safe(expires, timer->base->get_time()); in common_hrtimer_arm()
817 hrtimer_set_expires(timer, expires); in common_hrtimer_arm()
820 hrtimer_start_expires(timer, HRTIMER_MODE_ABS); in common_hrtimer_arm()
825 return hrtimer_try_to_cancel(&timr->it.real.timer); in common_hrtimer_try_to_cancel()
828 static void common_timer_wait_running(struct k_itimer *timer) in common_timer_wait_running() argument
830 hrtimer_cancel_wait_running(&timer->it.real.timer); in common_timer_wait_running()
839 static struct k_itimer *timer_wait_running(struct k_itimer *timer, in timer_wait_running() argument
842 const struct k_clock *kc = READ_ONCE(timer->kclock); in timer_wait_running()
843 timer_t timer_id = READ_ONCE(timer->it_id); in timer_wait_running()
847 unlock_timer(timer, *flags); in timer_wait_running()
854 kc->timer_wait_running(timer); in timer_wait_running()
987 int common_timer_del(struct k_itimer *timer) in common_timer_del() argument
989 const struct k_clock *kc = timer->kclock; in common_timer_del()
991 timer->it_interval = 0; in common_timer_del()
992 if (kc->timer_try_to_cancel(timer) < 0) in common_timer_del()
994 timer->it_active = 0; in common_timer_del()
998 static inline int timer_delete_hook(struct k_itimer *timer) in timer_delete_hook() argument
1000 const struct k_clock *kc = timer->kclock; in timer_delete_hook()
1004 return kc->timer_del(timer); in timer_delete_hook()
1010 struct k_itimer *timer; in SYSCALL_DEFINE1() local
1013 timer = lock_timer(timer_id, &flags); in SYSCALL_DEFINE1()
1016 if (!timer) in SYSCALL_DEFINE1()
1019 if (unlikely(timer_delete_hook(timer) == TIMER_RETRY)) { in SYSCALL_DEFINE1()
1021 timer = timer_wait_running(timer, &flags); in SYSCALL_DEFINE1()
1026 list_del(&timer->list); in SYSCALL_DEFINE1()
1032 timer->it_signal = NULL; in SYSCALL_DEFINE1()
1034 unlock_timer(timer, flags); in SYSCALL_DEFINE1()
1035 release_posix_timer(timer, IT_ID_SET); in SYSCALL_DEFINE1()
1043 static void itimer_delete(struct k_itimer *timer) in itimer_delete() argument
1050 spin_lock_irqsave(&timer->it_lock, flags); in itimer_delete()
1059 if (timer_delete_hook(timer) == TIMER_RETRY) { in itimer_delete()
1071 if (WARN_ON_ONCE(timer_wait_running(timer, &flags) != timer)) in itimer_delete()
1076 list_del(&timer->list); in itimer_delete()
1078 spin_unlock_irqrestore(&timer->it_lock, flags); in itimer_delete()
1079 release_posix_timer(timer, IT_ID_SET); in itimer_delete()