X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Ftimer.h;h=9b087135c12eca324a6c456adf5826a19621767b;hb=f662be2b6bac1f62c457b663598bfde135f48f50;hp=768a31b19ebe00f7f8097c28330c3366c784e857;hpb=101529b6eae500272347287df43ec51aa003d0aa;p=palacios.releases.git diff --git a/palacios/include/geekos/timer.h b/palacios/include/geekos/timer.h index 768a31b..9b08713 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,14 +24,21 @@ 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(int ticks, timerCallback); -int Get_Remaing_Timer_Ticks(int id); +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);