2 * GeekOS timer interrupt support
3 * Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
4 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
5 * (c) 2008, The V3VEE Project <http://www.v3vee.org>
8 * This is free software. You are permitted to use,
9 * redistribute, and modify it as specified in the file "COPYING".
12 #ifndef GEEKOS_TIMER_H
13 #define GEEKOS_TIMER_H
17 extern volatile ulong_t g_numTicks;
19 typedef void (*timerCallback)(int);
21 void Init_Timer(void);
23 void Micro_Delay(int us);
27 int ticks; /* timer code decrements this */
28 int id; /* unqiue id for this timer even */
29 timerCallback callBack; /* Queue to wakeup on timer expire */
33 int Start_Timer_Secs(int seconds, timerCallback cb);
34 int Start_Timer_MSecs(int msecs, timerCallback cb);
35 int Start_Timer(int ticks, timerCallback);
37 double Get_Remaining_Timer_Secs(int id);
38 int Get_Remaining_Timer_MSecs(int id);
39 int Get_Remaining_Timer_Ticks(int id);
40 int Cancel_Timer(int id);
43 void Micro_Delay(int us);
45 #endif /* GEEKOS_TIMER_H */