aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/posix-timers.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-09 23:52:38 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:39 -0500
commitbecf8b5d00f4b47e847f98322cdaf8cd16243861 (patch)
tree152ba7583324c64d34ecc70d5401957ca7225761 /include/linux/posix-timers.h
parent97735f25d2ba898ec5e13746451525580631c834 (diff)
[PATCH] hrtimer: convert posix timers completely
- convert posix-timers.c to use hrtimers - remove the now obsolete abslist code Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/posix-timers.h')
-rw-r--r--include/linux/posix-timers.h37
1 files changed, 2 insertions, 35 deletions
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 3c0a5beb7f0d..54faf5236da0 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -51,12 +51,8 @@ struct k_itimer {
51 struct sigqueue *sigq; /* signal queue entry. */ 51 struct sigqueue *sigq; /* signal queue entry. */
52 union { 52 union {
53 struct { 53 struct {
54 struct timer_list timer; 54 struct hrtimer timer;
55 /* clock abs_timer_list: */ 55 ktime_t interval;
56 struct list_head abs_timer_entry;
57 /* wall_to_monotonic used when set: */
58 struct timespec wall_to_prev;
59 unsigned long incr; /* interval in jiffies */
60 } real; 56 } real;
61 struct cpu_timer_list cpu; 57 struct cpu_timer_list cpu;
62 struct { 58 struct {
@@ -68,15 +64,9 @@ struct k_itimer {
68 } it; 64 } it;
69}; 65};
70 66
71struct k_clock_abs {
72 struct list_head list;
73 spinlock_t lock;
74};
75
76struct k_clock { 67struct k_clock {
77 int res; /* in nanoseconds */ 68 int res; /* in nanoseconds */
78 int (*clock_getres) (const clockid_t which_clock, struct timespec *tp); 69 int (*clock_getres) (const clockid_t which_clock, struct timespec *tp);
79 struct k_clock_abs *abs_struct;
80 int (*clock_set) (const clockid_t which_clock, struct timespec * tp); 70 int (*clock_set) (const clockid_t which_clock, struct timespec * tp);
81 int (*clock_get) (const clockid_t which_clock, struct timespec * tp); 71 int (*clock_get) (const clockid_t which_clock, struct timespec * tp);
82 int (*timer_create) (struct k_itimer *timer); 72 int (*timer_create) (struct k_itimer *timer);
@@ -102,29 +92,6 @@ int do_posix_clock_nosettime(const clockid_t, struct timespec *tp);
102/* function to call to trigger timer event */ 92/* function to call to trigger timer event */
103int posix_timer_event(struct k_itimer *timr, int si_private); 93int posix_timer_event(struct k_itimer *timr, int si_private);
104 94
105struct now_struct {
106 unsigned long jiffies;
107};
108
109#define posix_get_now(now) \
110 do { (now)->jiffies = jiffies; } while (0)
111
112#define posix_time_before(timer, now) \
113 time_before((timer)->expires, (now)->jiffies)
114
115#define posix_bump_timer(timr, now) \
116 do { \
117 long delta, orun; \
118 \
119 delta = (now).jiffies - (timr)->it.real.timer.expires; \
120 if (delta >= 0) { \
121 orun = 1 + (delta / (timr)->it.real.incr); \
122 (timr)->it.real.timer.expires += \
123 orun * (timr)->it.real.incr; \
124 (timr)->it_overrun += orun; \
125 } \
126 } while (0)
127
128int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts); 95int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts);
129int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts); 96int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts);
130int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts); 97int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);