From c15be843778236e9f2fdbc207ab36ba996b2bb1b Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Thu, 17 Dec 2009 21:45:38 -0500 Subject: [ported from 2008.3] Add hrtimer_start_on() API --- include/linux/hrtimer.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/linux/hrtimer.h') diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index ff037f0b1b4e..b984b947f5db 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -166,6 +166,7 @@ struct hrtimer_clock_base { * event devices whether high resolution mode can be * activated. * @nr_events: Total number of timer interrupt events + * @to_pull: LITMUS^RT list of timers to be pulled on this cpu */ struct hrtimer_cpu_base { spinlock_t lock; @@ -175,6 +176,26 @@ struct hrtimer_cpu_base { int hres_active; unsigned long nr_events; #endif + struct list_head to_pull; +}; + +#define HRTIMER_START_ON_INACTIVE 0 +#define HRTIMER_START_ON_QUEUED 1 + +/* + * struct hrtimer_start_on_info - save timer info on remote cpu + * @list: list of hrtimer_start_on_info on remote cpu (to_pull) + * @timer: timer to be triggered on remote cpu + * @time: time event + * @mode: timer mode + * @state: activity flag + */ +struct hrtimer_start_on_info { + struct list_head list; + struct hrtimer *timer; + ktime_t time; + enum hrtimer_mode mode; + atomic_t state; }; 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, unsigned long delta_ns, const enum hrtimer_mode mode, int wakeup); +extern int hrtimer_start_on(int cpu, struct hrtimer_start_on_info *info, + struct hrtimer *timer, ktime_t time, + const enum hrtimer_mode mode); + extern int hrtimer_cancel(struct hrtimer *timer); extern int hrtimer_try_to_cancel(struct hrtimer *timer); -- cgit v1.2.2