diff options
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r-- | kernel/softirq.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c index 10277429ed84..2c3382378d94 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -573,57 +573,6 @@ void tasklet_kill(struct tasklet_struct *t) | |||
573 | } | 573 | } |
574 | EXPORT_SYMBOL(tasklet_kill); | 574 | EXPORT_SYMBOL(tasklet_kill); |
575 | 575 | ||
576 | /* | ||
577 | * tasklet_hrtimer | ||
578 | */ | ||
579 | |||
580 | /* | ||
581 | * The trampoline is called when the hrtimer expires. It schedules a tasklet | ||
582 | * to run __tasklet_hrtimer_trampoline() which in turn will call the intended | ||
583 | * hrtimer callback, but from softirq context. | ||
584 | */ | ||
585 | static enum hrtimer_restart __hrtimer_tasklet_trampoline(struct hrtimer *timer) | ||
586 | { | ||
587 | struct tasklet_hrtimer *ttimer = | ||
588 | container_of(timer, struct tasklet_hrtimer, timer); | ||
589 | |||
590 | tasklet_hi_schedule(&ttimer->tasklet); | ||
591 | return HRTIMER_NORESTART; | ||
592 | } | ||
593 | |||
594 | /* | ||
595 | * Helper function which calls the hrtimer callback from | ||
596 | * tasklet/softirq context | ||
597 | */ | ||
598 | static void __tasklet_hrtimer_trampoline(unsigned long data) | ||
599 | { | ||
600 | struct tasklet_hrtimer *ttimer = (void *)data; | ||
601 | enum hrtimer_restart restart; | ||
602 | |||
603 | restart = ttimer->function(&ttimer->timer); | ||
604 | if (restart != HRTIMER_NORESTART) | ||
605 | hrtimer_restart(&ttimer->timer); | ||
606 | } | ||
607 | |||
608 | /** | ||
609 | * tasklet_hrtimer_init - Init a tasklet/hrtimer combo for softirq callbacks | ||
610 | * @ttimer: tasklet_hrtimer which is initialized | ||
611 | * @function: hrtimer callback function which gets called from softirq context | ||
612 | * @which_clock: clock id (CLOCK_MONOTONIC/CLOCK_REALTIME) | ||
613 | * @mode: hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL) | ||
614 | */ | ||
615 | void tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer, | ||
616 | enum hrtimer_restart (*function)(struct hrtimer *), | ||
617 | clockid_t which_clock, enum hrtimer_mode mode) | ||
618 | { | ||
619 | hrtimer_init(&ttimer->timer, which_clock, mode); | ||
620 | ttimer->timer.function = __hrtimer_tasklet_trampoline; | ||
621 | tasklet_init(&ttimer->tasklet, __tasklet_hrtimer_trampoline, | ||
622 | (unsigned long)ttimer); | ||
623 | ttimer->function = function; | ||
624 | } | ||
625 | EXPORT_SYMBOL_GPL(tasklet_hrtimer_init); | ||
626 | |||
627 | void __init softirq_init(void) | 576 | void __init softirq_init(void) |
628 | { | 577 | { |
629 | int cpu; | 578 | int cpu; |