diff options
Diffstat (limited to 'kernel/hrtimer.c')
| -rw-r--r-- | kernel/hrtimer.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 0237a556eb1f..877cdf9678bf 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
| @@ -656,6 +656,25 @@ void hrtimer_run_queues(void) | |||
| 656 | * Sleep related functions: | 656 | * Sleep related functions: |
| 657 | */ | 657 | */ |
| 658 | 658 | ||
| 659 | static int hrtimer_wakeup(struct hrtimer *timer) | ||
| 660 | { | ||
| 661 | struct hrtimer_sleeper *t = | ||
| 662 | container_of(timer, struct hrtimer_sleeper, timer); | ||
| 663 | struct task_struct *task = t->task; | ||
| 664 | |||
| 665 | t->task = NULL; | ||
| 666 | if (task) | ||
| 667 | wake_up_process(task); | ||
| 668 | |||
| 669 | return HRTIMER_NORESTART; | ||
| 670 | } | ||
| 671 | |||
| 672 | void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, task_t *task) | ||
| 673 | { | ||
| 674 | sl->timer.function = hrtimer_wakeup; | ||
| 675 | sl->task = task; | ||
| 676 | } | ||
| 677 | |||
| 659 | struct sleep_hrtimer { | 678 | struct sleep_hrtimer { |
| 660 | struct hrtimer timer; | 679 | struct hrtimer timer; |
| 661 | struct task_struct *task; | 680 | struct task_struct *task; |
