X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Ftimer.h;h=da3141526c33f1516f29c804c6bd9d11b7e9f83e;hb=f032dd8f6f03c414f9d1f208845464ff76050b6c;hp=6b123aa758ce2b1f91c23d0d7558d24ef0ff6a41;hpb=3cfd36ea8e68ec218ae1aa3ac3c793037aa5c694;p=palacios.releases.git diff --git a/palacios/include/geekos/timer.h b/palacios/include/geekos/timer.h index 6b123aa..da31415 100644 --- a/palacios/include/geekos/timer.h +++ b/palacios/include/geekos/timer.h @@ -16,7 +16,7 @@ extern volatile ulong_t g_numTicks; -typedef void (*timerCallback)(int); +typedef void (*timerCallback)(int, void*); void Init_Timer(void); @@ -24,15 +24,17 @@ 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); @@ -41,4 +43,6 @@ int Cancel_Timer(int id); void Micro_Delay(int us); +ulong_t clock_time(void); //return elipsed millisecs + #endif /* GEEKOS_TIMER_H */