ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-arm / arch-cl7500 / time.h
1 /*
2  * linux/include/asm-arm/arch-cl7500/time.h
3  *
4  * Copyright (c) 1996-2000 Russell King.
5  *
6  * Changelog:
7  *  24-Sep-1996 RMK     Created
8  *  10-Oct-1996 RMK     Brought up to date with arch-sa110eval
9  *  04-Dec-1997 RMK     Updated for new arch/arm/time.c
10  */
11
12 extern void ioctime_init(void);
13
14 static irqreturn_t
15 timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
16 {
17         do_timer(regs);
18         do_set_rtc();
19         do_profile(regs);
20
21         {
22                 /* Twinkle the lights. */
23                 static int count, state = 0xff00;
24                 if (count-- == 0) {
25                         state ^= 0x100;
26                         count = 25;
27                         *((volatile unsigned int *)LED_ADDRESS) = state;
28                 }
29         }
30         return IRQ_HANDLED;
31 }
32
33 /*
34  * Set up timer interrupt.
35  */
36 void __init time_init(void)
37 {
38         ioctime_init();
39
40         timer_irq.handler = timer_interrupt;
41
42         setup_irq(IRQ_TIMER, &timer_irq);
43 }