summaryrefslogtreecommitdiff
path: root/firmware/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r--firmware/kernel.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c
index 2d4ccde267..b1a4e62a81 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -29,7 +29,7 @@
29volatile long current_tick NOCACHEDATA_ATTR = 0; 29volatile long current_tick NOCACHEDATA_ATTR = 0;
30#endif 30#endif
31 31
32static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void); 32void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
33 33
34/* This array holds all queues that are initiated. It is used for broadcast. */ 34/* This array holds all queues that are initiated. It is used for broadcast. */
35static struct event_queue *all_queues[32] NOCACHEBSS_ATTR; 35static struct event_queue *all_queues[32] NOCACHEBSS_ATTR;
@@ -708,40 +708,6 @@ void tick_start(unsigned int interval_in_ms)
708 708
709 TIMER0.ctrl |= 0x80; /* Enable the counter */ 709 TIMER0.ctrl |= 0x80; /* Enable the counter */
710} 710}
711#elif CONFIG_CPU == S3C2440
712void tick_start(unsigned int interval_in_ms)
713{
714 TCON &= ~(1 << 20); // stop timer 4
715 // TODO: this constant depends on dividers settings inherited from
716 // firmware. Set them explicitly somwhere.
717 TCNTB4 = 12193 * interval_in_ms / 1000;
718 TCON |= 1 << 21; // set manual bit
719 TCON &= ~(1 << 21); // reset manual bit
720 TCON |= 1 << 22; //interval mode
721 TCON |= (1 << 20); // start timer 4
722
723 INTMOD &= ~(1 << 14); // timer 4 to IRQ mode
724 INTMSK &= ~(1 << 14); // timer 4 unmask interrupts
725}
726
727void TIMER4(void)
728{
729 int i;
730
731 SRCPND = TIMER4_MASK;
732 INTPND = TIMER4_MASK;
733
734 /* Run through the list of tick tasks */
735 for(i = 0; i < MAX_NUM_TICK_TASKS; i++)
736 {
737 if(tick_funcs[i])
738 {
739 tick_funcs[i]();
740 }
741 }
742
743 current_tick++;
744}
745#endif 711#endif
746 712
747int tick_add_task(void (*f)(void)) 713int tick_add_task(void (*f)(void))