aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-09 23:52:28 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:36 -0500
commit2a698971941bf5e6ebe96275f7d5318b2cf91ccf (patch)
tree89440360d61ec88a52023682fb670aa7f77ed40b /include
parenta924b04ddea9788e09f387fe19ccbede5f09ddd8 (diff)
[PATCH] hrtimer: coding style and white space cleanup 2
style/whitespace/macro cleanups of posix-timers.h Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.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/posix-timers.h80
1 files changed, 44 insertions, 36 deletions
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index ecda38e07899..ae51473d3d48 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -42,7 +42,7 @@ struct k_itimer {
42 timer_t it_id; /* timer id */ 42 timer_t it_id; /* timer id */
43 int it_overrun; /* overrun on pending signal */ 43 int it_overrun; /* overrun on pending signal */
44 int it_overrun_last; /* overrun on last delivered signal */ 44 int it_overrun_last; /* overrun on last delivered signal */
45 int it_requeue_pending; /* waiting to requeue this timer */ 45 int it_requeue_pending; /* waiting to requeue this timer */
46#define REQUEUE_PENDING 1 46#define REQUEUE_PENDING 1
47 int it_sigev_notify; /* notify word of sigevent struct */ 47 int it_sigev_notify; /* notify word of sigevent struct */
48 int it_sigev_signo; /* signo word of sigevent struct */ 48 int it_sigev_signo; /* signo word of sigevent struct */
@@ -52,8 +52,10 @@ struct k_itimer {
52 union { 52 union {
53 struct { 53 struct {
54 struct timer_list timer; 54 struct timer_list timer;
55 struct list_head abs_timer_entry; /* clock abs_timer_list */ 55 /* clock abs_timer_list: */
56 struct timespec wall_to_prev; /* wall_to_monotonic used when set */ 56 struct list_head abs_timer_entry;
57 /* wall_to_monotonic used when set: */
58 struct timespec wall_to_prev;
57 unsigned long incr; /* interval in jiffies */ 59 unsigned long incr; /* interval in jiffies */
58 } real; 60 } real;
59 struct cpu_timer_list cpu; 61 struct cpu_timer_list cpu;
@@ -70,14 +72,16 @@ struct k_clock_abs {
70 struct list_head list; 72 struct list_head list;
71 spinlock_t lock; 73 spinlock_t lock;
72}; 74};
75
73struct k_clock { 76struct k_clock {
74 int res; /* in nano seconds */ 77 int res; /* in nanoseconds */
75 int (*clock_getres) (const clockid_t which_clock, struct timespec *tp); 78 int (*clock_getres) (const clockid_t which_clock, struct timespec *tp);
76 struct k_clock_abs *abs_struct; 79 struct k_clock_abs *abs_struct;
77 int (*clock_set) (const clockid_t which_clock, struct timespec * tp); 80 int (*clock_set) (const clockid_t which_clock, struct timespec * tp);
78 int (*clock_get) (const clockid_t which_clock, struct timespec * tp); 81 int (*clock_get) (const clockid_t which_clock, struct timespec * tp);
79 int (*timer_create) (struct k_itimer *timer); 82 int (*timer_create) (struct k_itimer *timer);
80 int (*nsleep) (const clockid_t which_clock, int flags, struct timespec *); 83 int (*nsleep) (const clockid_t which_clock, int flags,
84 struct timespec *);
81 int (*timer_set) (struct k_itimer * timr, int flags, 85 int (*timer_set) (struct k_itimer * timr, int flags,
82 struct itimerspec * new_setting, 86 struct itimerspec * new_setting,
83 struct itimerspec * old_setting); 87 struct itimerspec * old_setting);
@@ -89,7 +93,7 @@ struct k_clock {
89 93
90void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock); 94void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock);
91 95
92/* Error handlers for timer_create, nanosleep and settime */ 96/* error handlers for timer_create, nanosleep and settime */
93int do_posix_clock_notimer_create(struct k_itimer *timer); 97int do_posix_clock_notimer_create(struct k_itimer *timer);
94int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *); 98int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *);
95int do_posix_clock_nosettime(const clockid_t, struct timespec *tp); 99int do_posix_clock_nosettime(const clockid_t, struct timespec *tp);
@@ -101,39 +105,43 @@ struct now_struct {
101 unsigned long jiffies; 105 unsigned long jiffies;
102}; 106};
103 107
104#define posix_get_now(now) (now)->jiffies = jiffies; 108#define posix_get_now(now) \
109 do { (now)->jiffies = jiffies; } while (0)
110
105#define posix_time_before(timer, now) \ 111#define posix_time_before(timer, now) \
106 time_before((timer)->expires, (now)->jiffies) 112 time_before((timer)->expires, (now)->jiffies)
107 113
108#define posix_bump_timer(timr, now) \ 114#define posix_bump_timer(timr, now) \
109 do { \ 115 do { \
110 long delta, orun; \ 116 long delta, orun; \
111 delta = now.jiffies - (timr)->it.real.timer.expires; \ 117 \
112 if (delta >= 0) { \ 118 delta = (now).jiffies - (timr)->it.real.timer.expires; \
113 orun = 1 + (delta / (timr)->it.real.incr); \ 119 if (delta >= 0) { \
114 (timr)->it.real.timer.expires += \ 120 orun = 1 + (delta / (timr)->it.real.incr); \
115 orun * (timr)->it.real.incr; \ 121 (timr)->it.real.timer.expires += \
116 (timr)->it_overrun += orun; \ 122 orun * (timr)->it.real.incr; \
117 } \ 123 (timr)->it_overrun += orun; \
118 }while (0) 124 } \
119 125 } while (0)
120int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *); 126
121int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *); 127int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts);
122int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *tp); 128int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts);
123int posix_cpu_timer_create(struct k_itimer *); 129int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);
124int posix_cpu_nsleep(const clockid_t, int, struct timespec *); 130int posix_cpu_timer_create(struct k_itimer *timer);
125int posix_cpu_timer_set(struct k_itimer *, int, 131int posix_cpu_nsleep(const clockid_t which_clock, int flags,
126 struct itimerspec *, struct itimerspec *); 132 struct timespec *ts);
127int posix_cpu_timer_del(struct k_itimer *); 133int posix_cpu_timer_set(struct k_itimer *timer, int flags,
128void posix_cpu_timer_get(struct k_itimer *, struct itimerspec *); 134 struct itimerspec *new, struct itimerspec *old);
129 135int posix_cpu_timer_del(struct k_itimer *timer);
130void posix_cpu_timer_schedule(struct k_itimer *); 136void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp);
131 137
132void run_posix_cpu_timers(struct task_struct *); 138void posix_cpu_timer_schedule(struct k_itimer *timer);
133void posix_cpu_timers_exit(struct task_struct *); 139
134void posix_cpu_timers_exit_group(struct task_struct *); 140void run_posix_cpu_timers(struct task_struct *task);
135 141void posix_cpu_timers_exit(struct task_struct *task);
136void set_process_cpu_timer(struct task_struct *, unsigned int, 142void posix_cpu_timers_exit_group(struct task_struct *task);
137 cputime_t *, cputime_t *); 143
144void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
145 cputime_t *newval, cputime_t *oldval);
138 146
139#endif 147#endif