diff options
Diffstat (limited to 'linux/sched.c')
-rw-r--r-- | linux/sched.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/linux/sched.c b/linux/sched.c index 2d61c480..de6eb142 100644 --- a/linux/sched.c +++ b/linux/sched.c @@ -40,14 +40,22 @@ void schedule(void) v, NULL, NULL, 0); } -static void process_timeout(unsigned long __data) +struct process_timer { + struct timer_list timer; + struct task_struct *task; +}; + +static void process_timeout(struct timer_list *t) { - wake_up_process((struct task_struct *)__data); + struct process_timer *timeout = + container_of(t, struct process_timer, timer); + + wake_up_process(timeout->task); } long schedule_timeout(long timeout) { - struct timer_list timer; + struct process_timer timer; unsigned long expire; switch (timeout) @@ -80,10 +88,11 @@ long schedule_timeout(long timeout) expire = timeout + jiffies; - setup_timer(&timer, process_timeout, (unsigned long)current); - mod_timer(&timer, expire); + timer.task = current; + timer_setup_on_stack(&timer.timer, process_timeout, 0); + mod_timer(&timer.timer, expire); schedule(); - del_timer_sync(&timer); + del_timer_sync(&timer.timer); timeout = expire - jiffies; out: |