diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
commit | 529c593ece216e4aaffd36bd940cb94f1fa63129 (patch) | |
tree | 78f1c0b805f5656aa7b0417a043c5346f700a2cf /include/linux/timer.h | |
parent | 0bd079751d25808d1972baee5c4eaa1db2227257 (diff) |
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'include/linux/timer.h')
-rw-r--r-- | include/linux/timer.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index 796749fdb..d159222b7 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -51,6 +51,7 @@ struct timer_list { unsigned long expires; unsigned long data; void (*function)(unsigned long); + volatile int running; }; extern void add_timer(struct timer_list * timer); @@ -61,7 +62,7 @@ extern int del_timer(struct timer_list * timer); * active timer (if the timer is inactive it will be activated) * mod_timer(a,b) is equivalent to del_timer(a); a->expires = b; add_timer(a) */ -void mod_timer(struct timer_list *timer, unsigned long expires); +int mod_timer(struct timer_list *timer, unsigned long expires); extern void it_real_fn(unsigned long); @@ -69,6 +70,9 @@ extern inline void init_timer(struct timer_list * timer) { timer->next = NULL; timer->prev = NULL; +#ifdef __SMP__ + timer->running = 0; +#endif } extern inline int timer_pending(const struct timer_list * timer) @@ -76,6 +80,20 @@ extern inline int timer_pending(const struct timer_list * timer) return timer->prev != NULL; } +#ifdef __SMP__ +#define timer_exit(t) do { (t)->running = 0; mb(); } while (0) +#define timer_set_running(t) do { (t)->running = 1; mb(); } while (0) +#define timer_is_running(t) ((t)->running != 0) +#define timer_synchronize(t) while (timer_is_running(t)) barrier() +extern int del_timer_sync(struct timer_list * timer); +#else +#define timer_exit(t) do { } while (0) +#define timer_set_running(t) do { } while (0) +#define timer_is_running(t) (0) +#define timer_synchronize(t) barrier() +#define del_timer_sync(t) del_timer(t) +#endif + /* * These inlines deal with timer wrapping correctly. You are * strongly encouraged to use them |