# HG changeset patch # User Michael Spacefalcon # Date 1403758013 0 # Node ID d5cf423dad3a962ae3d7c0df3227707ff415a7ae # Parent 14d2a7f473c393771a7845a822b655dec25cb033 os_tim_ir.c: os_Timeout() fixed diff -r 14d2a7f473c3 -r d5cf423dad3a gsm-fw/gpf/osl/os_tim_ir.c --- a/gsm-fw/gpf/osl/os_tim_ir.c Thu Jun 26 03:23:29 2014 +0000 +++ b/gsm-fw/gpf/osl/os_tim_ir.c Thu Jun 26 04:46:53 2014 +0000 @@ -38,17 +38,17 @@ * The code passes gcc, but some polish is still likely needed. */ -/* FIXME: t_handle is unused?! */ -void os_Timeout(UNSIGNED t_handle) +void +os_Timeout(UNSIGNED t_handle) /* argument is unused */ { - UNSIGNED s_ticks; - OS_HANDLE task_handle; - OS_HANDLE e_handle; - int t_index, i, done; + ULONG s_ticks; + OS_HANDLE task_handle, e_handle; + USHORT t_index; + int i, done; T_OS_TIMER_TABLE_ENTRY **t_r4; T_OS_TIMER_TABLE_ENTRY *timer; void (*timeout_func) (OS_HANDLE, OS_HANDLE, USHORT); - OS_TIME InitialTime; + OS_TIME resched_time; if (t_list_access) { t_start_ticks++; @@ -59,7 +59,7 @@ t_list_access = 1; timer = t_running; - if (t_running) { + if (timer) { s_ticks = 0; done = 0; i = 0; @@ -79,12 +79,12 @@ timer->next->prev = timer->prev; if (timer->next->r_ticks) { t_running = timer->next; - s_ticks = timer->r_ticks; + s_ticks = timer->next->r_ticks; done = 1; } else timer = timer->next; } - /* FIXME: IND$CALL() ? */ + timeout_func(task_handle, e_handle, t_index); } while (!done); @@ -96,9 +96,9 @@ } for (t_r4 = p_list; *t_r4; t_r4++) { timer = *t_r4; - InitialTime = SYSTEM_TICKS_TO_TIME(timer->p_ticks); + resched_time = SYSTEM_TICKS_TO_TIME(timer->p_ticks); os_StartTimer(timer->entity_handle, timer->t_handle, - timer->t_index, InitialTime, InitialTime); + timer->t_index, resched_time, resched_time); *t_r4 = NULL; }