All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add dispatch_i8259_irq() to i8259.c
@ 2002-12-13 23:08 Jun Sun
  2002-12-14  0:55 ` Maciej W. Rozycki
  0 siblings, 1 reply; 17+ messages in thread
From: Jun Sun @ 2002-12-13 23:08 UTC (permalink / raw)
  To: linux-mips; +Cc: jsun

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]


If a machine uses i8259 as part of its interrupt routing subsystem,
it typically has two ways to figure out which i8259 interrupt has 
happened.

1) through PCI interrupt ack cycle to directly read the IRQ number
2) read i8259 interrupt status registers and figure which one has
   happened.

This patch adds support for those sorry boards which only have
option 2) available.

While I am here, I also promoted do_IRQ() declaration to a 
header file, as it is needed by all C-level interrupt dispatching
code.

Any feedbacks? 

Jun

[-- Attachment #2: junk --]
[-- Type: text/plain, Size: 1281 bytes --]

--- ./arch/mips64/kernel/i8259.c.orig	Mon Aug  5 16:53:33 2002
+++ ./arch/mips64/kernel/i8259.c	Fri Dec 13 14:54:09 2002
@@ -14,6 +14,7 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
+#include <linux/bitops.h>
 
 #include <asm/io.h>
 
@@ -219,6 +220,26 @@
 	}
 }
 
+asmlinkage void dispatch_i8259_irq(struct pt_regs *regs)
+{
+	int isr, irq=-1;
+
+	isr = ~(int)inb(0x20) | cached_21;
+	if (isr != -1) 
+		irq = ffz (isr);
+	if (irq == 2) {
+		isr = ~(int)inb(0xa0) | cached_A1;
+		if (isr != -1) 
+			irq = 8 + ffz(isr);
+	}
+	if (irq == -1) {
+		printk("We got a spurious i8259 interrupt\n");
+		atomic_inc(&irq_err_count);
+	} else {
+		do_IRQ(irq,regs);
+	}
+}
+
 void __init init_8259A(int auto_eoi)
 {
 	unsigned long flags;
diff -Nru ./include/asm-mips64/irq.h.orig ./include/asm-mips/irq.h
--- ./include/asm-mips64/irq.h.orig	Fri Dec 13 10:51:25 2002
+++ ./include/asm-mips64/irq.h	Fri Dec 13 14:50:46 2002
@@ -12,6 +12,7 @@
 #define _ASM_IRQ_H
 
 #include <linux/config.h>
+#include <linux/linkage.h>
 
 #define NR_IRQS 128		/* Largest number of ints of all machines.  */
 
@@ -36,4 +37,6 @@
 
 extern void init_generic_irq(void);
 
+extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs);
+
 #endif /* _ASM_IRQ_H */

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2002-12-18 19:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-13 23:08 [PATCH] add dispatch_i8259_irq() to i8259.c Jun Sun
2002-12-14  0:55 ` Maciej W. Rozycki
2002-12-14  4:18   ` Ralf Baechle
2002-12-16 13:44     ` Maciej W. Rozycki
2002-12-16 20:40       ` Jun Sun
2002-12-17 13:39         ` Maciej W. Rozycki
2002-12-17 14:35           ` Dominic Sweetman
2002-12-17 18:23             ` Ralf Baechle
2002-12-17 18:33               ` Maciej W. Rozycki
2002-12-17 18:27             ` Maciej W. Rozycki
2002-12-17 19:54             ` Jun Sun
2002-12-17 21:40           ` Jun Sun
2002-12-18 16:14             ` Maciej W. Rozycki
2002-12-18 17:48               ` Jun Sun
2002-12-18 18:14                 ` Maciej W. Rozycki
2002-12-18 18:51                   ` Jun Sun
2002-12-18 19:26                     ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.