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 * QIC02_TAPE_TIMER timer for QIC-02 tape driver (it's not hardcoded) 31 * 32 * MCD_TIMER Mitsumi CD-ROM Timer 33 */ 34
35 #defineBLANK_TIMER 0
36 #define BEEP_TIMER 1
37 #defineRS_TIMER 2
38
39 #defineHD_TIMER 16
40 #defineFLOPPY_TIMER 17
41 #defineSCSI_TIMER 18
42 #define NET_TIMER 19
43 #defineSOUND_TIMER 20
44 #defineCOPRO_TIMER 21
45
46 #defineQIC02_TAPE_TIMER 22 /* hhb */ 47 #defineMCD_TIMER 23
48
49 #define HD_TIMER2 24
50
51 structtimer_struct{ 52 unsignedlongexpires;
53 void (*fn)(void);
54 };
55
56 externunsignedlongtimer_active;
57 externstructtimer_structtimer_table[32];
58
59 /* 60 * This is completely separate from the above, and is the 61 * "new and improved" way of handling timers more dynamically. 62 * Hopefully efficient and general enough for most things. 63 * 64 * The "hardcoded" timers above are still useful for well- 65 * defined problems, but the timer-list is probably better 66 * when you need multiple outstanding timers or similar. 67 * 68 * The "data" field is in case you want to use the same 69 * timeout function for several timeouts. You can use this 70 * to distinguish between the different invocations. 71 */ 72 structtimer_list{ 73 structtimer_list *next;
74 structtimer_list *prev;
75 unsignedlongexpires;
76 unsignedlongdata;
77 void (*function)(unsignedlong);
78 };
79
80 externvoidadd_timer(structtimer_list * timer);
81 externintdel_timer(structtimer_list * timer);
82
83 externinlinevoidinit_timer(structtimer_list * timer)
/* */ 84 { 85 timer->next = NULL;
86 timer->prev = NULL;
87 } 88
89 #endif