diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2006-01-09 23:52:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 11:01:39 -0500 |
commit | becf8b5d00f4b47e847f98322cdaf8cd16243861 (patch) | |
tree | 152ba7583324c64d34ecc70d5401957ca7225761 /include | |
parent | 97735f25d2ba898ec5e13746451525580631c834 (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')
-rw-r--r-- | include/linux/hrtimer.h | 7 | ||||
-rw-r--r-- | include/linux/posix-timers.h | 37 | ||||
-rw-r--r-- | include/linux/time.h | 3 |
3 files changed, 10 insertions, 37 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 2ac20b48b2f3..cf5cfdf8d613 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -93,6 +93,13 @@ struct hrtimer_base { | |||
93 | struct hrtimer *curr_timer; | 93 | struct hrtimer *curr_timer; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | /* | ||
97 | * clock_was_set() is a NOP for non- high-resolution systems. The | ||
98 | * time-sorted order guarantees that a timer does not expire early and | ||
99 | * is expired in the next softirq when the clock was advanced. | ||
100 | */ | ||
101 | #define clock_was_set() do { } while (0) | ||
102 | |||
96 | /* Exported timer functions: */ | 103 | /* Exported timer functions: */ |
97 | 104 | ||
98 | /* Initialize timers: */ | 105 | /* Initialize timers: */ |
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 | ||
71 | struct k_clock_abs { | ||
72 | struct list_head list; | ||
73 | spinlock_t lock; | ||
74 | }; | ||
75 | |||
76 | struct k_clock { | 67 | struct 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 */ |
103 | int posix_timer_event(struct k_itimer *timr, int si_private); | 93 | int posix_timer_event(struct k_itimer *timr, int si_private); |
104 | 94 | ||
105 | struct 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 | |||
128 | int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts); | 95 | int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts); |
129 | int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts); | 96 | int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts); |
130 | int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts); | 97 | int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts); |
diff --git a/include/linux/time.h b/include/linux/time.h index f639fde29253..1201155b2202 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -73,8 +73,7 @@ struct timespec current_kernel_time(void); | |||
73 | extern void do_gettimeofday(struct timeval *tv); | 73 | extern void do_gettimeofday(struct timeval *tv); |
74 | extern int do_settimeofday(struct timespec *tv); | 74 | extern int do_settimeofday(struct timespec *tv); |
75 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | 75 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); |
76 | extern void clock_was_set(void); // call whenever the clock is set | 76 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) |
77 | extern int do_posix_clock_monotonic_gettime(struct timespec *tp); | ||
78 | extern long do_utimes(char __user *filename, struct timeval *times); | 77 | extern long do_utimes(char __user *filename, struct timeval *times); |
79 | struct itimerval; | 78 | struct itimerval; |
80 | extern int do_setitimer(int which, struct itimerval *value, | 79 | extern int do_setitimer(int which, struct itimerval *value, |