aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hrtimer.h7
-rw-r--r--include/linux/posix-timers.h37
-rw-r--r--include/linux/time.h3
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
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);
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);
73extern void do_gettimeofday(struct timeval *tv); 73extern void do_gettimeofday(struct timeval *tv);
74extern int do_settimeofday(struct timespec *tv); 74extern int do_settimeofday(struct timespec *tv);
75extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); 75extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
76extern void clock_was_set(void); // call whenever the clock is set 76#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
77extern int do_posix_clock_monotonic_gettime(struct timespec *tp);
78extern long do_utimes(char __user *filename, struct timeval *times); 77extern long do_utimes(char __user *filename, struct timeval *times);
79struct itimerval; 78struct itimerval;
80extern int do_setitimer(int which, struct itimerval *value, 79extern int do_setitimer(int which, struct itimerval *value,