/* * linux/include/asm-arm/arch-shark/time.h * * by Alexander Schulz * * Uses the real time clock because you can't run * the timer with level triggered interrupts and * you can't run the shark with edge triggered * inetrrupts (loses ints and hangs). * * derived from linux/drivers/char/rtc.c and: * linux/include/asm-arm/arch-ebsa110/time.h * Copyright (c) 1996,1997,1998 Russell King. */ #include #include #define IRQ_TIMER 8 extern void get_rtc_time(struct rtc_time *rtc_tm); extern void set_rtc_irq_bit(unsigned char bit); extern unsigned long epoch; static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { CMOS_READ(RTC_INTR_FLAGS); do_leds(); { #ifdef DIVISOR static unsigned int divisor; if (divisor-- == 0) { divisor = DIVISOR - 1; #else { #endif do_timer(regs); } } } /* * Set up timer interrupt, and return the current time in seconds. */ static inline void setup_timer(void) { struct rtc_time r_time; unsigned long flags; int tmp = 0; unsigned char val; /* * Set the clock to 128 Hz, we already have a valid * vector now: */ while (HZ > (1<