diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2009-12-17 21:45:38 -0500 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-29 17:19:45 -0400 |
commit | c15be843778236e9f2fdbc207ab36ba996b2bb1b (patch) | |
tree | 985dc4c5f034a742e68c7df0ce47a1e43222e813 /include/linux/hrtimer.h | |
parent | b085cafc43bc395e255626204169e20a587f28ba (diff) |
[ported from 2008.3] Add hrtimer_start_on() API
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r-- | include/linux/hrtimer.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index ff037f0b1b4..b984b947f5d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -166,6 +166,7 @@ struct hrtimer_clock_base { | |||
166 | * event devices whether high resolution mode can be | 166 | * event devices whether high resolution mode can be |
167 | * activated. | 167 | * activated. |
168 | * @nr_events: Total number of timer interrupt events | 168 | * @nr_events: Total number of timer interrupt events |
169 | * @to_pull: LITMUS^RT list of timers to be pulled on this cpu | ||
169 | */ | 170 | */ |
170 | struct hrtimer_cpu_base { | 171 | struct hrtimer_cpu_base { |
171 | spinlock_t lock; | 172 | spinlock_t lock; |
@@ -175,6 +176,26 @@ struct hrtimer_cpu_base { | |||
175 | int hres_active; | 176 | int hres_active; |
176 | unsigned long nr_events; | 177 | unsigned long nr_events; |
177 | #endif | 178 | #endif |
179 | struct list_head to_pull; | ||
180 | }; | ||
181 | |||
182 | #define HRTIMER_START_ON_INACTIVE 0 | ||
183 | #define HRTIMER_START_ON_QUEUED 1 | ||
184 | |||
185 | /* | ||
186 | * struct hrtimer_start_on_info - save timer info on remote cpu | ||
187 | * @list: list of hrtimer_start_on_info on remote cpu (to_pull) | ||
188 | * @timer: timer to be triggered on remote cpu | ||
189 | * @time: time event | ||
190 | * @mode: timer mode | ||
191 | * @state: activity flag | ||
192 | */ | ||
193 | struct hrtimer_start_on_info { | ||
194 | struct list_head list; | ||
195 | struct hrtimer *timer; | ||
196 | ktime_t time; | ||
197 | enum hrtimer_mode mode; | ||
198 | atomic_t state; | ||
178 | }; | 199 | }; |
179 | 200 | ||
180 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) | 201 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) |
@@ -343,6 +364,10 @@ __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, | |||
343 | unsigned long delta_ns, | 364 | unsigned long delta_ns, |
344 | const enum hrtimer_mode mode, int wakeup); | 365 | const enum hrtimer_mode mode, int wakeup); |
345 | 366 | ||
367 | extern int hrtimer_start_on(int cpu, struct hrtimer_start_on_info *info, | ||
368 | struct hrtimer *timer, ktime_t time, | ||
369 | const enum hrtimer_mode mode); | ||
370 | |||
346 | extern int hrtimer_cancel(struct hrtimer *timer); | 371 | extern int hrtimer_cancel(struct hrtimer *timer); |
347 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); | 372 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); |
348 | 373 | ||