X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Ftimer.c;fp=palacios%2Fsrc%2Fgeekos%2Ftimer.c;h=7f4ab4992bc42bf0fc2407ee2589d80a9db3067e;hb=663dc1f26febeb73037e6f68ea7177927d1338ec;hp=d3d4a6a9c45ec7f1fd28d6abd581a65ab79bed6c;hpb=abffcb058993b19404622ce45cdce3b03045df54;p=palacios.releases.git diff --git a/palacios/src/geekos/timer.c b/palacios/src/geekos/timer.c index d3d4a6a..7f4ab49 100644 --- a/palacios/src/geekos/timer.c +++ b/palacios/src/geekos/timer.c @@ -338,6 +338,19 @@ void Init_Timer(void) } +int Start_Timer_Secs(int seconds, timerCallback cb) { + return Start_Timer(seconds * HZ, cb); +} + + +int Start_Timer_MSecs(int msecs, timerCallback cb) { + msecs += 10 - (msecs % 10); + + return Start_Timer(msecs * (HZ / 1000), cb); +} + + + int Start_Timer(int ticks, timerCallback cb) { int ret; @@ -358,7 +371,8 @@ int Start_Timer(int ticks, timerCallback cb) } } -int Get_Remaing_Timer_Ticks(int id) + +int Get_Remaining_Timer_Ticks(int id) { int i; @@ -372,6 +386,19 @@ int Get_Remaing_Timer_Ticks(int id) return -1; } + + +double Get_Remaining_Timer_Secs(int id) { + return (Get_Remaining_Timer_Ticks(id) / HZ); +} + + +int Get_Remaining_Timer_MSecs(int id) { + return ((Get_Remaining_Timer_Ticks(id) * 1000) / HZ); +} + + + int Cancel_Timer(int id) { int i;