X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Ftimer.h;h=6b123aa758ce2b1f91c23d0d7558d24ef0ff6a41;hb=3cfd36ea8e68ec218ae1aa3ac3c793037aa5c694;hp=37dda144eae0fbc0a55c62377843c24cd19e993d;hpb=626595465a2c6987606a6bc697df65130ad8c2d3;p=palacios.releases.git diff --git a/palacios/include/geekos/timer.h b/palacios/include/geekos/timer.h index 37dda14..6b123aa 100644 --- a/palacios/include/geekos/timer.h +++ b/palacios/include/geekos/timer.h @@ -1,7 +1,9 @@ /* * GeekOS timer interrupt support * Copyright (c) 2001, David H. Hovemeyer - * $Revision: 1.1 $ + * Copyright (c) 2008, Jack Lange + * (c) 2008, The V3VEE Project + * $Revision: 1.2 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -14,11 +16,29 @@ extern volatile ulong_t g_numTicks; +typedef void (*timerCallback)(int); + void Init_Timer(void); 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; +} timerEvent; + +int Start_Timer_Secs(int seconds, timerCallback cb); +int Start_Timer_MSecs(int msecs, timerCallback cb); +int Start_Timer(int ticks, timerCallback); + +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); #endif /* GEEKOS_TIMER_H */