patch-2.2.8 linux/include/asm-arm/arch-nexuspci/time.h
Next file: linux/include/asm-arm/arch-rpc/a.out.h
Previous file: linux/include/asm-arm/arch-nexuspci/processor.h
Back to the patch index
Back to the overall index
- Lines: 60
- Date:
Sat May 8 11:06:57 1999
- Orig file:
v2.2.7/linux/include/asm-arm/arch-nexuspci/time.h
- Orig date:
Tue Jul 21 00:15:32 1998
diff -u --recursive --new-file v2.2.7/linux/include/asm-arm/arch-nexuspci/time.h linux/include/asm-arm/arch-nexuspci/time.h
@@ -17,37 +17,53 @@
return 0;
}
-extern __inline__ int reset_timer (void)
+static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
static int count = 50;
+
writeb(0x90, UART_BASE + 8);
- if (--count == 0)
- {
+
+ if (--count == 0) {
static int state = 1;
state ^= 1;
writeb(0x1a + state, INTCONT);
count = 50;
}
+
readb(UART_BASE + 0x14);
readb(UART_BASE + 0x14);
readb(UART_BASE + 0x14);
readb(UART_BASE + 0x14);
readb(UART_BASE + 0x14);
readb(UART_BASE + 0x14);
- return 1;
+
+ do_timer(regs);
}
-extern __inline__ unsigned long setup_timer (void)
+static struct irqaction timerirq = {
+ timer_interrupt,
+ 0,
+ 0,
+ "timer",
+ NULL,
+ NULL
+};
+
+extern __inline__ void setup_timer(void)
{
int tick = 3686400 / 16 / 2 / 100;
+
writeb(tick & 0xff, UART_BASE + 0x1c);
writeb(tick >> 8, UART_BASE + 0x18);
writeb(0x80, UART_BASE + 8);
writeb(0x10, UART_BASE + 0x14);
+
/*
* Default the date to 1 Jan 1970 0:0:0
* You will have to run a time daemon to set the
* clock correctly at bootup
*/
- return mktime(1970, 1, 1, 0, 0, 0);
+ xtime.tv_sec = mktime(1970, 1, 1, 0, 0, 0);
+
+ setup_arm_irq(IRQ_TIMER, &timerirq);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)