Lines Matching refs:timer
31 init_timer(struct timer_list *timer)
33 mutex_init(&timer->lock, NULL, MUTEX_DRIVER, NULL);
37 destroy_timer(struct timer_list *timer)
39 mutex_destroy(&timer->lock);
43 setup_timer(struct timer_list *timer, void (*func)(void *), void *arg)
45 timer->func = func;
46 timer->arg = arg;
47 timer->expired_time = 0;
51 mod_timer(struct timer_list *timer, clock_t expires)
53 mutex_enter(&timer->lock);
55 * If timer is already being updated, let previous caller do the work
56 * Note that we must drop timer->lock before the untimeout, as the
58 * centered around the overloading of the timer->expires element.
60 if (timer->expires == -1) {
61 mutex_exit(&timer->lock);
64 timer->expires = -1;
65 mutex_exit(&timer->lock);
67 (void) untimeout(timer->timer_id);
68 timer->expired_time = jiffies + expires;
69 timer->timer_id = timeout(timer->func, timer->arg, expires);
71 mutex_enter(&timer->lock);
72 timer->expires = 0;
73 mutex_exit(&timer->lock);
77 del_timer(struct timer_list *timer)
79 (void) untimeout(timer->timer_id);
83 test_set_timer(struct timer_list *timer, clock_t expires)
85 if (time_after(jiffies, timer->expired_time)) {
86 timer->expired_time = jiffies + expires;
87 timer->timer_id = timeout(timer->func, timer->arg, expires);