diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-03 21:46:06 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-03 21:46:06 +0000 |
commit | 3e414096429d55fbc8116171bba3487647bbe638 (patch) | |
tree | 2b5fcfd9d16fa3a32c829fc2076f6e3785b43374 /include/linux/timer.h | |
parent | 20b23bfcf36fcb2d16d8b844501072541970637c (diff) |
Merge with Linux 2.4.0-test3-pre2.
Diffstat (limited to 'include/linux/timer.h')
-rw-r--r-- | include/linux/timer.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index 2de8050ea..9d6b8c3a2 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -52,9 +52,10 @@ struct timer_list { unsigned long expires; unsigned long data; void (*function)(unsigned long); - volatile int running; + unsigned long sequence; }; +extern volatile unsigned long timer_sequence; extern void add_timer(struct timer_list * timer); extern int del_timer(struct timer_list * timer); @@ -71,7 +72,7 @@ static inline void init_timer(struct timer_list * timer) { timer->list.next = timer->list.prev = NULL; #ifdef CONFIG_SMP - timer->running = 0; + timer->sequence = timer_sequence-1; #endif } @@ -81,17 +82,17 @@ static inline int timer_pending (const struct timer_list * timer) } #ifdef CONFIG_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_enter(t) do { (t)->sequence = timer_sequence; mb(); } while (0) +#define timer_exit() do { timer_sequence++; } while (0) +#define timer_is_running(t) ((t)->sequence == timer_sequence) #define timer_synchronize(t) while (timer_is_running(t)) barrier() extern int del_timer_sync(struct timer_list * timer); #else -#define timer_exit(t) (void)(t) -#define timer_set_running(t) (void)(t) -#define timer_is_running(t) (0) -#define timer_synchronize(t) do { (void)(t); barrier(); } while(0) -#define del_timer_sync(t) del_timer(t) +#define timer_enter(t) do { } while (0) +#define timer_exit() do { } while (0) +#define timer_is_running(t) (0) +#define timer_synchronize(t) do { (void)(t); barrier(); } while(0) +#define del_timer_sync(t) del_timer(t) #endif /* |