Home | History | Annotate | Download | only in linux

Lines Matching refs:timer

1 /*	$NetBSD: timer.h,v 1.17 2021/12/19 12:33:48 riastradh Exp $	*/
49 timer_setup(struct timer_list *timer, void (*fn)(struct timer_list *),
53 callout_init(&timer->tl_callout, 0);
56 callout_setfunc(&timer->tl_callout, (void (*)(void *))(void *)fn,
57 (void *)timer);
61 mod_timer(struct timer_list *timer, unsigned long then)
66 pending = callout_pending(&timer->tl_callout);
67 callout_schedule(&timer->tl_callout, (now < then? (then - now) : 0));
72 mod_timer_pinned(struct timer_list *timer, unsigned long then)
76 mod_timer(timer, then);
80 del_timer(struct timer_list *timer)
84 * Linux: `del_timer of an inactive timer returns 0, del_timer
85 * of an active timer returns 1.'
90 if (!callout_pending(&timer->tl_callout))
92 if (callout_stop(&timer->tl_callout))
98 del_timer_sync(struct timer_list *timer)
103 * pending timer or not.'
108 if (!callout_pending(&timer->tl_callout))
110 if (callout_halt(&timer->tl_callout, NULL))
116 timer_pending(struct timer_list *timer)
119 return callout_pending(&timer->tl_callout);