X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Ftimer.h;h=9b087135c12eca324a6c456adf5826a19621767b;hb=734dfbecdb21f61f344ca092b99a957b58e49e52;hp=bf09464f27c8e6c4b8116fc7cae1b7afdd7b9957;hpb=eb7dda8d4a92a2e8d0c8f867c65317d756ca6c11;p=palacios.releases.git diff --git a/palacios/include/geekos/timer.h b/palacios/include/geekos/timer.h index bf09464..9b08713 100644 --- a/palacios/include/geekos/timer.h +++ b/palacios/include/geekos/timer.h @@ -1,6 +1,8 @@ /* * GeekOS timer interrupt support * Copyright (c) 2001, David H. Hovemeyer + * Copyright (c) 2008, Jack Lange + * (c) 2008, The V3VEE Project * $Revision: 1.2 $ * * This is free software. You are permitted to use, @@ -14,7 +16,7 @@ extern volatile ulong_t g_numTicks; -typedef void (*timerCallback)(int); +typedef void (*timerCallback)(int, void*); void Init_Timer(void); @@ -22,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);