1 #ifndef _LINUX_TIMER_H
2 #define _LINUX_TIMER_H
3
4 /*
5 * DON'T CHANGE THESE!! Most of them are hardcoded into some assembly language
6 * as well as being defined here.
7 */
8
9 /*
10 * The timers are:
11 *
12 * BLANK_TIMER console screen-saver timer
13 *
14 * BEEP_TIMER console beep timer
15 *
16 * RS_TIMER timer for the RS-232 ports
17 *
18 * HD_TIMER harddisk timer
19 *
20 * HD_TIMER2 (atdisk2 patches)
21 *
22 * FLOPPY_TIMER floppy disk timer (not used right now)
23 *
24 * SCSI_TIMER scsi.c timeout timer
25 *
26 * NET_TIMER tcp/ip timeout timer
27 *
28 * COPRO_TIMER 387 timeout for buggy hardware..
29 *
30 * TAPE_QIC02_TIMER timer for QIC-02 tape driver (it's not hardcoded)
31 *
32 * MCD_TIMER Mitsumi CD-ROM Timer
33 *
34 * SBPCD_TIMER SoundBlaster/Matsushita/Panasonic CD-ROM timer
35 */
36
37 #define BLANK_TIMER 0
38 #define BEEP_TIMER 1
39 #define RS_TIMER 2
40
41 #define HD_TIMER 16
42 #define FLOPPY_TIMER 17
43 #define SCSI_TIMER 18
44 #define NET_TIMER 19
45 #define SOUND_TIMER 20
46 #define COPRO_TIMER 21
47
48 #define TAPE_QIC02_TIMER 22 /* hhb */
49 #define MCD_TIMER 23
50
51 #define HD_TIMER2 24
52
53 #define SBPCD_TIMER 25
54
55 struct timer_struct {
56 unsigned long expires;
57 void (*fn)(void);
58 };
59
60 extern unsigned long timer_active;
61 extern struct timer_struct timer_table[32];
62
63 /*
64 * This is completely separate from the above, and is the
65 * "new and improved" way of handling timers more dynamically.
66 * Hopefully efficient and general enough for most things.
67 *
68 * The "hardcoded" timers above are still useful for well-
69 * defined problems, but the timer-list is probably better
70 * when you need multiple outstanding timers or similar.
71 *
72 * The "data" field is in case you want to use the same
73 * timeout function for several timeouts. You can use this
74 * to distinguish between the different invocations.
75 */
76 struct timer_list {
77 struct timer_list *next;
78 struct timer_list *prev;
79 unsigned long expires;
80 unsigned long data;
81 void (*function)(unsigned long);
82 };
83
84 extern void add_timer(struct timer_list * timer);
85 extern int del_timer(struct timer_list * timer);
86
87 #endif