patch-2.4.10 linux/arch/mips/ite-boards/generic/irq.c

Next file: linux/arch/mips/ite-boards/generic/it8172_cir.c
Previous file: linux/arch/mips/ite-boards/generic/dbg_io.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/arch/mips/ite-boards/generic/irq.c linux/arch/mips/ite-boards/generic/irq.c
@@ -5,7 +5,7 @@
  *
  * Copyright 2000,2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or support@mvista.com
+ *         	ppopov@mvista.com or source@mvista.com
  *
  * Part of this file was derived from Carsten Langgaard's 
  * arch/mips/mips-boards/atlas/atlas_int.c.
@@ -33,7 +33,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
@@ -76,12 +75,13 @@
 extern void set_debug_traps(void);
 extern void mips_timer_interrupt(int irq, struct pt_regs *regs);
 extern asmlinkage void it8172_IRQ(void);
-irq_cpustat_t irq_stat [NR_CPUS];
 unsigned int local_bh_count[NR_CPUS];
 unsigned int local_irq_count[NR_CPUS];
 unsigned long spurious_count = 0;
 irq_desc_t irq_desc[NR_IRQS];
 irq_desc_t *irq_desc_base=&irq_desc[0];
+void disable_it8172_irq(unsigned int irq_nr);
+void enable_it8172_irq(unsigned int irq_nr);
 
 struct it8172_intc_regs volatile *it8172_hw0_icregs
 	= (struct it8172_intc_regs volatile *)(KSEG1ADDR(IT8172_PCI_IO_BASE + IT_INTC_BASE));
@@ -110,7 +110,7 @@
         unsigned long flags;
 
         save_and_cli(flags);
-        mask_irq(irq_nr);
+	disable_it8172_irq(irq_nr);
         restore_flags(flags);
 }
 
@@ -119,15 +119,13 @@
 	unsigned long flags;
 
         save_and_cli(flags);
-        unmask_irq(irq_nr);
+	enable_it8172_irq(irq_nr);
         restore_flags(flags);
 }
 
 
 void disable_it8172_irq(unsigned int irq_nr)
 {
-	unsigned short mask;
-
 	DPRINTK("disable_it8172_irq %d\n", irq_nr);
 
 	if ( (irq_nr >= IT8172_LPC_IRQ_BASE) && (irq_nr <= IT8172_SERIRQ_15)) {
@@ -290,7 +288,6 @@
 		printk("Unhandled interrupt %d, cause %x, disabled\n", 
 				(unsigned)irq, (unsigned)regs->cp0_cause);
 		disable_it8172_irq(irq);
-		//disable_irq(1<<irq);
 	}
 	irq_exit(cpu, irq);
 }
@@ -325,7 +322,6 @@
                         cli();
                         *p = action->next;
 			disable_it8172_irq(irq);
-                        //disable_irq(1<<irq);
                         restore_flags(flags);
                         kfree(action);
                         return 0;
@@ -378,7 +374,11 @@
 
 void enable_cpu_timer(void)
 {
-	enable_irq(1<<EXT_IRQ5_TO_IP); /* timer interrupt */
+        unsigned long flags;
+
+        save_and_cli(flags);
+	unmask_irq(1<<EXT_IRQ5_TO_IP); /* timer interrupt */
+        restore_flags(flags);
 }
 
 unsigned long probe_irq_on (void)
@@ -395,6 +395,8 @@
 void __init init_IRQ(void)
 {
 	int i;
+        unsigned long flags;
+
 
         memset(irq_desc, 0, sizeof(irq_desc));
         set_except_vector(0, it8172_IRQ);
@@ -440,8 +442,9 @@
 	 * Enable external int line 2
 	 * All ITE interrupts are masked for now.
 	 */
-	enable_irq(1<<EXT_IRQ0_TO_IP);
-	//change_cp0_status(ST0_IM, IE_IRQ2);
+        save_and_cli(flags);
+	unmask_irq(1<<EXT_IRQ0_TO_IP);
+        restore_flags(flags);
 
 #ifdef CONFIG_REMOTE_DEBUG
 	/* If local serial I/O used for debug port, enter kgdb at once */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)