diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-09-28 11:08:17 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-09-28 11:08:17 -0400 |
commit | 0c56ebffe68e71b0de3505386401c212984242b7 (patch) | |
tree | df198e5f596b282f86cced4abc723df38eae70b2 | |
parent | acdf6100407bc743bab02f699eedf629b4eb4d9d (diff) |
Add init helper function to properly set hrtimer_start_on_info params
This helper function is also useful to remind us that if we use
hrtimer_pull outside the scope of triggering remote releases, we need to
take care of properly set the "state" field of hrtimer_start_on_info
structure.
-rw-r--r-- | include/linux/hrtimer.h | 1 | ||||
-rw-r--r-- | kernel/hrtimer.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 370096d132d1..9470a9e4a8ff 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -374,6 +374,7 @@ __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, | |||
374 | const enum hrtimer_mode mode, int wakeup); | 374 | const enum hrtimer_mode mode, int wakeup); |
375 | 375 | ||
376 | #ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS | 376 | #ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS |
377 | extern void hrtimer_start_on_info_init(struct hrtimer_start_on_info *info); | ||
377 | extern int hrtimer_start_on(int cpu, struct hrtimer_start_on_info *info, | 378 | extern int hrtimer_start_on(int cpu, struct hrtimer_start_on_info *info, |
378 | struct hrtimer *timer, ktime_t time, | 379 | struct hrtimer *timer, ktime_t time, |
379 | const enum hrtimer_mode mode); | 380 | const enum hrtimer_mode mode); |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 18314ae830ee..fdf95968e517 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -1046,6 +1046,15 @@ EXPORT_SYMBOL_GPL(hrtimer_start); | |||
1046 | #ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS | 1046 | #ifdef CONFIG_ARCH_HAS_SEND_PULL_TIMERS |
1047 | 1047 | ||
1048 | /** | 1048 | /** |
1049 | * hrtimer_start_on_info_init - Initialize hrtimer_start_on_info | ||
1050 | */ | ||
1051 | void hrtimer_start_on_info_init(struct hrtimer_start_on_info *info) | ||
1052 | { | ||
1053 | memset(info, 0, sizeof(struct hrtimer_start_on_info)); | ||
1054 | atomic_set(&info->state, HRTIMER_START_ON_INACTIVE); | ||
1055 | } | ||
1056 | |||
1057 | /** | ||
1049 | * hrtimer_pull - PULL_TIMERS_VECTOR callback on remote cpu | 1058 | * hrtimer_pull - PULL_TIMERS_VECTOR callback on remote cpu |
1050 | */ | 1059 | */ |
1051 | void hrtimer_pull(void) | 1060 | void hrtimer_pull(void) |