linux-mips
[Top] [All Lists]

[PATCH] Let Malta and its friends use common timer interrupt code

To: linux-mips@oss.sgi.com, Ralf Baechle <ralf@uni-koblenz.de>
Subject: [PATCH] Let Malta and its friends use common timer interrupt code
From: Jun Sun <jsun@mvista.com>
Date: Fri, 19 Jul 2002 14:14:30 -0700
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408

This patch let Malta and other MIPS boards use the common timer interrupt code. Not only it reduces maintainance, but also it lets Malta benefit from common improvement (such as Preemptible kernel).

Jun

diff -Nru linux/arch/mips/mips-boards/generic/time.c.orig 
linux/arch/mips/mips-boards/generic/time.c
--- linux/arch/mips/mips-boards/generic/time.c.orig     Tue May  7 20:05:01 2002
+++ linux/arch/mips/mips-boards/generic/time.c  Fri Jul 19 13:55:42 2002
@@ -35,6 +35,7 @@
 #include <asm/hardirq.h>
 #include <asm/div64.h>
 #include <asm/cpu.h>
+#include <asm/time.h>
 
 #include <linux/interrupt.h>
 #include <linux/mc146818rtc.h>
@@ -46,8 +47,6 @@
 static unsigned int r4k_offset; /* Amount to increment compare reg each time */
 static unsigned int r4k_cur;    /* What counter should be at next timer irq */
 
-extern unsigned int mips_counter_frequency;
-
 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
 
 #if defined(CONFIG_MIPS_ATLAS)
@@ -71,13 +70,6 @@
 
 void mips_timer_interrupt(struct pt_regs *regs)
 {
-       int cpu = smp_processor_id();
-       int irq = MIPS_CPU_TIMER_IRQ;
-
-       irq_enter(cpu, irq);
-       kstat.irqs[cpu][irq]++;
-       timer_interrupt(irq, NULL, regs);
-
        if ((timer_tick_count++ % HZ) == 0) {
                mips_display_message(&display_string[display_count++]);
                if (display_count == MAX_DISPLAY_COUNT)
@@ -85,10 +77,7 @@
 
        }
 
-       irq_exit(cpu, irq);
-
-       if (softirq_pending(cpu))
-               do_softirq();
+       ll_timer_interrupt(MIPS_CPU_TIMER_IRQ, regs);
 }
 
 /* 
<Prev in Thread] Current Thread [Next in Thread>