X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Ftimer.h;h=b967fefb72094283020a4885fa61a77b11748bae;hb=3fb8af7e2069d7517b5d6c4fb7dc04b22ddf8396;hp=7fb783d7db368ee2af9d4196e2246db012054b85;hpb=663dc1f26febeb73037e6f68ea7177927d1338ec;p=palacios.releases.git diff --git a/palacios/include/geekos/timer.h b/palacios/include/geekos/timer.h index 7fb783d..b967fef 100644 --- a/palacios/include/geekos/timer.h +++ b/palacios/include/geekos/timer.h @@ -14,9 +14,9 @@ #define TIMER_IRQ 0 -extern volatile ulong_t g_numTicks; +extern volatile unsigned long g_numTicks; -typedef void (*timerCallback)(int); +typedef void (*timerCallback)(int, void*); void Init_Timer(void); @@ -24,22 +24,25 @@ void Micro_Delay(int us); typedef struct { - int ticks; /* timer code decrements this */ - int id; /* unqiue id for this timer even */ - timerCallback callBack; /* Queue to wakeup on timer expire */ - int origTicks; + int ticks; /* timer code decrements this */ + int id; /* unqiue id for this timer even */ + timerCallback callBack; /* Queue to wakeup on timer expire */ + void * cb_arg; /* Argument to add to callback */ + int origTicks; + } timerEvent; -int Start_Timer_Secs(int seconds, timerCallback cb); -int Start_Timer_MSecs(int msecs, timerCallback cb); -int Start_Timer(int ticks, timerCallback); +int Start_Timer_Secs(int seconds, timerCallback cb, void * arg); +int Start_Timer_MSecs(int msecs, timerCallback cb, void * arg); +int Start_Timer(int ticks, timerCallback, void * arg); double Get_Remaining_Timer_Secs(int id); int Get_Remaining_Timer_MSecs(int id); int Get_Remaining_Timer_Ticks(int id); int Cancel_Timer(int id); - void Micro_Delay(int us); +unsigned long clock_time(void); //return elipsed millisecs + #endif /* GEEKOS_TIMER_H */