All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: linux-mips@linux-mips.org
Cc: jsun@mvista.com
Subject: [PATCH] add dispatch_i8259_irq() to i8259.c
Date: Fri, 13 Dec 2002 15:08:53 -0800	[thread overview]
Message-ID: <20021213150853.F22731@mvista.com> (raw)

[-- 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 */

             reply	other threads:[~2002-12-13 23:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-13 23:08 Jun Sun [this message]
2002-12-14  0:55 ` [PATCH] add dispatch_i8259_irq() to i8259.c 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021213150853.F22731@mvista.com \
    --to=jsun@mvista.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.