]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Sun-3 vectored interrupts
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 3 Nov 2002 07:56:03 +0000 (23:56 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Sun, 3 Nov 2002 07:56:03 +0000 (23:56 -0800)
Sun-3 vectored interrupts update:
  - Add define for SUN3_INT_VECS
  - Let show_sun3_interrupts() report vectored ints on machines which have them

arch/m68k/sun3/sun3ints.c
include/asm-m68k/sun3ints.h

index f4270ca8589ec51ece542dd805bfc01bc6fb085d..b2f31c048ec120f068e291ca014f607690e05341 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/seq_file.h>
 
 extern void sun3_leds (unsigned char);
+static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp);
 
 void sun3_disable_interrupts(void)
 {
@@ -63,11 +64,6 @@ inline void sun3_do_irq(int irq, struct pt_regs *fp)
        *sun3_intreg |=  (1<<irq);
 }
 
-int show_sun3_interrupts(struct seq_file *p, void *v)
-{
-       return 0;
-}
-
 static void sun3_int7(int irq, void *dev_id, struct pt_regs *fp)
 {
        sun3_do_irq(irq,fp);
@@ -94,13 +90,38 @@ static void sun3_int5(int irq, void *dev_id, struct pt_regs *fp)
 
 /* handle requested ints, excepting 5 and 7, which always do the same
    thing */
+void (*sun3_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
+       sun3_inthandle, sun3_inthandle, sun3_inthandle, sun3_inthandle,
+       sun3_inthandle, sun3_int5, sun3_inthandle, sun3_int7
+};
+
+static const char *dev_names[SYS_IRQS] = { NULL, NULL, NULL, NULL, 
+                                    NULL, "timer", NULL, "int7 handler" };
 static void *dev_ids[SYS_IRQS];
 static void (*sun3_inthandler[SYS_IRQS])(int, void *, struct pt_regs *) = {
        NULL, NULL, NULL, NULL, NULL, sun3_int5, NULL, sun3_int7
 };
-static void (*sun3_vechandler[192])(int, void *, struct pt_regs *);
-static void *vec_ids[192];
-static char *vec_names[192];
+static void (*sun3_vechandler[SUN3_INT_VECS])(int, void *, struct pt_regs *);
+static void *vec_ids[SUN3_INT_VECS];
+static const char *vec_names[SUN3_INT_VECS];
+static int vec_ints[SUN3_INT_VECS];
+
+
+int show_sun3_interrupts(struct seq_file *p, void *v)
+{
+       int i;
+
+       for(i = 0; i < (SUN3_INT_VECS-1); i++) {
+               if(sun3_vechandler[i] != NULL) {
+                       seq_printf(p, "vec %3d: %10u %s\n", i+64, 
+                                  vec_ints[i],
+                                  (vec_names[i]) ? vec_names[i] :
+                                  "sun3_vechandler");
+               }
+       }
+
+       return 0;
+}
 
 static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp)
 {
@@ -118,14 +139,6 @@ static void sun3_vec255(int irq, void *dev_id, struct pt_regs *fp)
 //     intersil_clear();
 }
 
-void (*sun3_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
-       sun3_inthandle, sun3_inthandle, sun3_inthandle, sun3_inthandle,
-       sun3_inthandle, sun3_int5, sun3_inthandle, sun3_int7
-};
-
-static char *dev_names[SYS_IRQS] = { NULL, NULL, NULL, NULL, 
-                                    NULL, "timer", NULL, NULL };
-
 void sun3_init_IRQ(void)
 {
        int i;
@@ -176,6 +189,7 @@ int sun3_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_re
                        sun3_vechandler[vec] = handler;
                        vec_ids[vec] = dev_id;
                        vec_names[vec] = devname;
+                       vec_ints[vec] = 0;
                        
                        return 0;
                }
@@ -222,7 +236,8 @@ void sun3_process_int(int irq, struct pt_regs *regs)
                vec = irq - 64;
                if(sun3_vechandler[vec] == NULL) 
                        panic ("bad interrupt vector %d received\n",irq);
-                       
+
+               vec_ints[vec]++;
                sun3_vechandler[vec](irq, vec_ids[vec], regs);
                return;
        } else {
index 408f33f9b440ed6538313028ab012b042969aa6b..1da84dfcd6d0b6cd034ec7fbd36bd1a90d4f5fe6 100644 (file)
@@ -21,6 +21,8 @@
 #include <asm/intersil.h>
 #include <asm/oplib.h>
 
+#define SUN3_INT_VECS 192
+
 void sun3_enable_irq(unsigned int irq);
 void sun3_disable_irq(unsigned int irq);
 int sun3_request_irq(unsigned int irq,