patch-2.4.0-test3 linux/include/linux/timer.h
Next file: linux/include/linux/tpqic02.h
Previous file: linux/include/linux/sysv_fs.h
Back to the patch index
Back to the overall index
- Lines: 84
- Date:
Mon Jul 10 13:21:50 2000
- Orig file:
v2.4.0-test2/linux/include/linux/timer.h
- Orig date:
Thu May 11 15:30:08 2000
diff -u --recursive --new-file v2.4.0-test2/linux/include/linux/timer.h linux/include/linux/timer.h
@@ -5,36 +5,6 @@
#include <linux/list.h>
/*
- * Old-style timers. Please don't use for any new code.
- *
- * Numbering of these timers should be consecutive to minimize
- * processing delays. [MJ]
- */
-
-#define BLANK_TIMER 0 /* Console screen-saver */
-#define BEEP_TIMER 1 /* Console beep */
-#define RS_TIMER 2 /* RS-232 ports */
-#define SWAP_TIMER 3 /* Background pageout */
-#define BACKGR_TIMER 4 /* io_request background I/O */
-#define HD_TIMER 5 /* Old IDE driver */
-#define FLOPPY_TIMER 6 /* Floppy */
-#define QIC02_TAPE_TIMER 7 /* QIC 02 tape */
-#define MCD_TIMER 8 /* Mitsumi CDROM */
-#define GSCD_TIMER 9 /* Goldstar CDROM */
-#define COMTROL_TIMER 10 /* Comtrol serial */
-#define DIGI_TIMER 11 /* Digi serial */
-
-#define COPRO_TIMER 31 /* 387 timeout for buggy hardware (boot only) */
-
-struct timer_struct {
- unsigned long expires;
- void (*fn)(void);
-};
-
-extern unsigned long timer_active;
-extern struct timer_struct timer_table[32];
-
-/*
* This is completely separate from the above, and is the
* "new and improved" way of handling timers more dynamically.
* Hopefully efficient and general enough for most things.
@@ -52,9 +22,9 @@
unsigned long expires;
unsigned long data;
void (*function)(unsigned long);
- volatile int running;
};
+extern volatile struct timer_list *running_timer;
extern void add_timer(struct timer_list * timer);
extern int del_timer(struct timer_list * timer);
@@ -70,9 +40,6 @@
static inline void init_timer(struct timer_list * timer)
{
timer->list.next = timer->list.prev = NULL;
-#ifdef CONFIG_SMP
- timer->running = 0;
-#endif
}
static inline int timer_pending (const struct timer_list * timer)
@@ -81,17 +48,17 @@
}
#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 { running_timer = t; mb(); } while (0)
+#define timer_exit() do { running_timer = NULL; } while (0)
+#define timer_is_running(t) (running_timer == t)
#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
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)