ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-arm / arch-shark / time.h
1 /*
2  * linux/include/asm-arm/arch-shark/time.h
3  *
4  * by Alexander Schulz
5  *
6  * derived from include/asm-arm/arch-ebsa110/time.h
7  * Copyright (c) 1996,1997,1998 Russell King.
8  */
9
10 #include <asm/leds.h>
11 #include <asm/param.h>
12
13 #define IRQ_TIMER 0
14 #define HZ_TIME ((1193180 + HZ/2) / HZ)
15
16 static irqreturn_t
17 timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
18 {
19         do_leds();
20         do_timer(regs);
21         do_profile(regs);
22
23         return IRQ_HANDLED;
24 }
25
26 /*
27  * Set up timer interrupt, and return the current time in seconds.
28  */
29 void __init time_init(void)
30 {
31         unsigned long flags;
32
33         outb(0x34, 0x43);               /* binary, mode 0, LSB/MSB, Ch 0 */
34         outb(HZ_TIME & 0xff, 0x40);     /* LSB of count */
35         outb(HZ_TIME >> 8, 0x40);
36
37         timer_irq.handler = timer_interrupt;
38         setup_irq(IRQ_TIMER, &timer_irq);
39 }