X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fhrtimer.h;h=306acf1dc6d58b54aef407d2ab9e370ff18eaa99;hb=4e8f10b7ccf1c3c53a818a157962074a7340732e;hp=f57cc7bd7008e0e6dc4fb1a81d56e1b6710622b2;hpb=b75f7a51ca75c977d7d77f735d7a7859194eb39e;p=linux-2.6 diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index f57cc7bd70..306acf1dc6 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -45,9 +45,7 @@ struct hrtimer_base; * @expires: the absolute expiry time in the hrtimers internal * representation. The time is related to the clock on * which the timer is based. - * @state: state of the timer * @function: timer expiry callback function - * @data: argument for the callback function * @base: pointer to the timer base (per cpu and per clock) * * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE() @@ -55,11 +53,23 @@ struct hrtimer_base; struct hrtimer { struct rb_node node; ktime_t expires; - int (*function)(void *); - void *data; + int (*function)(struct hrtimer *); struct hrtimer_base *base; }; +/** + * struct hrtimer_sleeper - simple sleeper structure + * + * @timer: embedded timer structure + * @task: task to wake up + * + * task is set to NULL, when the timer expires. + */ +struct hrtimer_sleeper { + struct hrtimer timer; + struct task_struct *task; +}; + /** * struct hrtimer_base - the timer base for a specific clock * @@ -70,7 +80,7 @@ struct hrtimer { * @first: pointer to the timer node which expires first * @resolution: the resolution of the clock, in nanoseconds * @get_time: function to retrieve the current time of the clock - * @get_sofirq_time: function to retrieve the current time from the softirq + * @get_softirq_time: function to retrieve the current time from the softirq * @curr_timer: the timer which is executing a callback right now * @softirq_time: the time when running the hrtimer queue in the softirq */ @@ -130,6 +140,9 @@ extern long hrtimer_nanosleep(struct timespec *rqtp, const enum hrtimer_mode mode, const clockid_t clockid); +extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, + struct task_struct *tsk); + /* Soft interrupt function to run the hrtimer queues: */ extern void hrtimer_run_queues(void);