summaryrefslogtreecommitdiff
path: root/firmware/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r--firmware/kernel.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c
index a353c4bdc9..b30a3bb12b 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -358,6 +358,41 @@ void tick_start(unsigned int interval_in_ms)
358#endif 358#endif
359} 359}
360 360
361#elif CONFIG_CPU == PNX0101
362
363void timer_handler(void)
364{
365 int i;
366
367 /* Run through the list of tick tasks */
368 for(i = 0;i < MAX_NUM_TICK_TASKS;i++)
369 {
370 if(tick_funcs[i])
371 tick_funcs[i]();
372 }
373
374 current_tick++;
375 wake_up_thread();
376
377 TIMERR0C = 1;
378}
379
380void tick_start(unsigned int interval_in_ms)
381{
382 TIMERR08 &= ~0x80;
383 TIMERR0C = 1;
384 TIMERR08 &= ~0x80;
385 TIMERR08 |= 0x40;
386 TIMERR00 = 3000000 * interval_in_ms / 1000;
387 TIMERR08 &= ~0xc;
388 TIMERR0C = 1;
389
390 irq_set_int_handler(4, timer_handler);
391 irq_enable_int(4);
392
393 TIMERR08 |= 0x80;
394}
395
361#endif 396#endif
362 397
363int tick_add_task(void (*f)(void)) 398int tick_add_task(void (*f)(void))