diff options
Diffstat (limited to 'uisimulator/sdl/kernel-sdl.c')
-rw-r--r-- | uisimulator/sdl/kernel-sdl.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/uisimulator/sdl/kernel-sdl.c b/uisimulator/sdl/kernel-sdl.c index 3a1d82bf24..2ff18b33ee 100644 --- a/uisimulator/sdl/kernel-sdl.c +++ b/uisimulator/sdl/kernel-sdl.c | |||
@@ -42,8 +42,6 @@ static int interrupt_level = HIGHEST_IRQ_LEVEL; | |||
42 | static int handlers_pending = 0; | 42 | static int handlers_pending = 0; |
43 | static int status_reg = 0; | 43 | static int status_reg = 0; |
44 | 44 | ||
45 | extern void (*tick_funcs[MAX_NUM_TICK_TASKS])(void); | ||
46 | |||
47 | /* Nescessary logic: | 45 | /* Nescessary logic: |
48 | * 1) All threads must pass unblocked | 46 | * 1) All threads must pass unblocked |
49 | * 2) Current handler must always pass unblocked | 47 | * 2) Current handler must always pass unblocked |
@@ -129,26 +127,16 @@ Uint32 tick_timer(Uint32 interval, void *param) | |||
129 | 127 | ||
130 | if(new_tick != current_tick) | 128 | if(new_tick != current_tick) |
131 | { | 129 | { |
132 | long t; | 130 | while(current_tick < new_tick) |
133 | for(t = new_tick - current_tick; t > 0; t--) | ||
134 | { | 131 | { |
135 | int i; | ||
136 | |||
137 | sim_enter_irq_handler(); | 132 | sim_enter_irq_handler(); |
138 | 133 | ||
139 | /* Run through the list of tick tasks */ | 134 | /* Run through the list of tick tasks - increments tick |
140 | for(i = 0;i < MAX_NUM_TICK_TASKS;i++) | 135 | * on each iteration. */ |
141 | { | 136 | call_tick_tasks(); |
142 | if(tick_funcs[i]) | ||
143 | { | ||
144 | tick_funcs[i](); | ||
145 | } | ||
146 | } | ||
147 | 137 | ||
148 | sim_exit_irq_handler(); | 138 | sim_exit_irq_handler(); |
149 | } | 139 | } |
150 | |||
151 | current_tick = new_tick; | ||
152 | } | 140 | } |
153 | 141 | ||
154 | return 1; | 142 | return 1; |