Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64 bus_intr_establish() signature change.



details:   https://anonhg.NetBSD.org/src/rev/c46a3392058e
branches:  trunk
changeset: 540343:c46a3392058e
user:      pk <pk%NetBSD.org@localhost>
date:      Tue Dec 10 12:24:05 2002 +0000

description:
bus_intr_establish() signature change.
The additional `fast trap' argument is ignored in these drivers.
BUS_INTR_ESTABLISH_FASTTRAP and BUS_INTR_ESTABLISH_SOFTINTR are no longer used.

diffstat:

 sys/arch/sparc64/dev/ebus.c        |   7 +-
 sys/arch/sparc64/dev/psycho.c      |  77 ++++++++++++++++++-------------------
 sys/arch/sparc64/dev/sbus.c        |  12 ++--
 sys/arch/sparc64/include/bus.h     |  10 +---
 sys/arch/sparc64/sparc64/machdep.c |   7 +-
 5 files changed, 55 insertions(+), 58 deletions(-)

diffs (269 lines):

diff -r 5e40e0ed8b18 -r c46a3392058e sys/arch/sparc64/dev/ebus.c
--- a/sys/arch/sparc64/dev/ebus.c       Tue Dec 10 12:21:02 2002 +0000
+++ b/sys/arch/sparc64/dev/ebus.c       Tue Dec 10 12:24:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ebus.c,v 1.34 2002/10/02 16:02:18 thorpej Exp $        */
+/*     $NetBSD: ebus.c,v 1.35 2002/12/10 12:24:05 pk Exp $     */
 
 /*
  * Copyright (c) 1999, 2000, 2001 Matthew R. Green
@@ -117,7 +117,7 @@
 static int _ebus_bus_map __P((bus_space_tag_t, bus_addr_t, bus_size_t, int, 
                              vaddr_t, bus_space_handle_t *));
 static void *ebus_intr_establish __P((bus_space_tag_t, int, int, int,
-                               int (*) __P((void *)), void *));
+                               int (*) __P((void *)), void *, void(*)__P((void))));
 
 int
 ebus_match(parent, match, aux)
@@ -503,13 +503,14 @@
  * install an interrupt handler for a ebus device
  */
 void *
-ebus_intr_establish(t, pri, level, flags, handler, arg)
+ebus_intr_establish(t, pri, level, flags, handler, arg, fastvec)
        bus_space_tag_t t;
        int pri;
        int level;
        int flags;
        int (*handler) __P((void *));
        void *arg;
+       void (*fastvec) __P((void));    /* ignored */
 {
 
        return (bus_intr_establish(t->parent, pri, level, flags, handler, arg));
diff -r 5e40e0ed8b18 -r c46a3392058e sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c     Tue Dec 10 12:21:02 2002 +0000
+++ b/sys/arch/sparc64/dev/psycho.c     Tue Dec 10 12:24:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: psycho.c,v 1.55 2002/10/02 16:02:19 thorpej Exp $      */
+/*     $NetBSD: psycho.c,v 1.56 2002/12/10 12:24:05 pk Exp $   */
 
 /*
  * Copyright (c) 2001, 2002 Eduardo E. Horvath
@@ -99,7 +99,7 @@
 static int _psycho_bus_map __P((bus_space_tag_t, bus_addr_t, bus_size_t, int,
                                vaddr_t, bus_space_handle_t *));
 static void *psycho_intr_establish __P((bus_space_tag_t, int, int, int,
-                               int (*) __P((void *)), void *));
+                               int (*) __P((void *)), void *, void(*)__P((void))));
 
 static int psycho_dmamap_load __P((bus_dma_tag_t, bus_dmamap_t, void *,
                                   bus_size_t, struct proc *, int));
@@ -998,13 +998,14 @@
  * install an interrupt handler for a PCI device
  */
 void *
-psycho_intr_establish(t, ihandle, level, flags, handler, arg)
+psycho_intr_establish(t, ihandle, level, flags, handler, arg, fastvec)
        bus_space_tag_t t;
        int ihandle;
        int level;
        int flags;
        int (*handler) __P((void *));
        void *arg;
+       void (*fastvec) __P((void));    /* ignored */
 {
        struct psycho_pbm *pp = t->cookie;
        struct psycho_softc *sc = pp->pp_sc;
@@ -1042,48 +1043,46 @@
                level = 2;
        }
 
-       if ((flags & BUS_INTR_ESTABLISH_SOFTINTR) == 0) {
-
-               DPRINTF(PDB_INTR, ("\npsycho: intr %lx: %p\nHunting for IRQ...\n",
-                   (long)ino, intrlev[ino]));
+       DPRINTF(PDB_INTR, ("\npsycho: intr %lx: %p\nHunting for IRQ...\n",
+           (long)ino, intrlev[ino]));
 
-               /* Hunt thru obio first */
-               for (intrmapptr = &sc->sc_regs->scsi_int_map,
-                            intrclrptr = &sc->sc_regs->scsi_clr_int;
-                    intrmapptr < &sc->sc_regs->ffb0_int_map;
-                    intrmapptr++, intrclrptr++) {
-                       if (INTINO(*intrmapptr) == ino)
-                               goto found;
-               }
+       /* Hunt thru obio first */
+       for (intrmapptr = &sc->sc_regs->scsi_int_map,
+                    intrclrptr = &sc->sc_regs->scsi_clr_int;
+            intrmapptr < &sc->sc_regs->ffb0_int_map;
+            intrmapptr++, intrclrptr++) {
+               if (INTINO(*intrmapptr) == ino)
+                       goto found;
+       }
 
-               /* Now do PCI interrupts */
-               for (intrmapptr = &sc->sc_regs->pcia_slot0_int,
-                            intrclrptr = &sc->sc_regs->pcia0_clr_int[0];
-                    intrmapptr <= &sc->sc_regs->pcib_slot3_int;
-                    intrmapptr++, intrclrptr += 4) {
-                       if (((*intrmapptr ^ vec) & 0x3c) == 0) {
-                               intrclrptr += vec & 0x3;
-                               goto found;
-                       }
+       /* Now do PCI interrupts */
+       for (intrmapptr = &sc->sc_regs->pcia_slot0_int,
+                    intrclrptr = &sc->sc_regs->pcia0_clr_int[0];
+            intrmapptr <= &sc->sc_regs->pcib_slot3_int;
+            intrmapptr++, intrclrptr += 4) {
+               if (((*intrmapptr ^ vec) & 0x3c) == 0) {
+                       intrclrptr += vec & 0x3;
+                       goto found;
                }
+       }
 
-               /* Finally check the two FFB slots */
-               intrclrptr = NULL; /* XXX? */
-               for (intrmapptr = &sc->sc_regs->ffb0_int_map;
-                    intrmapptr <= &sc->sc_regs->ffb1_int_map;
-                    intrmapptr++) {
-                       if (INTVEC(*intrmapptr) == ino)
-                               goto found;
-               }
+       /* Finally check the two FFB slots */
+       intrclrptr = NULL; /* XXX? */
+       for (intrmapptr = &sc->sc_regs->ffb0_int_map;
+            intrmapptr <= &sc->sc_regs->ffb1_int_map;
+            intrmapptr++) {
+               if (INTVEC(*intrmapptr) == ino)
+                       goto found;
+       }
 
-               printf("Cannot find interrupt vector %lx\n", vec);
-               return (NULL);
+       printf("Cannot find interrupt vector %lx\n", vec);
+       return (NULL);
 
-       found:
-               /* Register the map and clear intr registers */
-               ih->ih_map = intrmapptr;
-               ih->ih_clr = intrclrptr;
-       }
+found:
+       /* Register the map and clear intr registers */
+       ih->ih_map = intrmapptr;
+       ih->ih_clr = intrclrptr;
+
 #ifdef NOT_DEBUG
        if (psycho_debug & PDB_INTR) {
                long i;
diff -r 5e40e0ed8b18 -r c46a3392058e sys/arch/sparc64/dev/sbus.c
--- a/sys/arch/sparc64/dev/sbus.c       Tue Dec 10 12:21:02 2002 +0000
+++ b/sys/arch/sparc64/dev/sbus.c       Tue Dec 10 12:24:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.55 2002/10/02 16:02:19 thorpej Exp $ */
+/*     $NetBSD: sbus.c,v 1.56 2002/12/10 12:24:05 pk Exp $ */
 
 /*
  * Copyright (c) 1999-2002 Eduardo Horvath
@@ -85,7 +85,8 @@
                int,                    /*`device class' priority*/
                int,                    /*flags*/
                int (*) __P((void *)),  /*handler*/
-               void *));               /*handler arg*/
+               void *,                 /*handler arg*/
+               void (*) __P((void)))); /*optional fast trap*/
 
 
 /* autoconfiguration driver */
@@ -603,13 +604,14 @@
  * Install an interrupt handler for an Sbus device.
  */
 void *
-sbus_intr_establish(t, pri, level, flags, handler, arg)
+sbus_intr_establish(t, pri, level, flags, handler, arg, fastvec)
        bus_space_tag_t t;
        int pri;
        int level;
        int flags;
        int (*handler) __P((void *));
        void *arg;
+       void (*fastvec) __P((void));    /* ignored */
 {
        struct sbus_softc *sc = t->cookie;
        struct intrhand *ih;
@@ -621,9 +623,7 @@
        if (ih == NULL)
                return (NULL);
 
-       if ((flags & BUS_INTR_ESTABLISH_SOFTINTR) != 0)
-               ipl = vec;
-       else if ((vec & SBUS_INTR_COMPAT) != 0)
+       if ((vec & SBUS_INTR_COMPAT) != 0)
                ipl = vec & ~SBUS_INTR_COMPAT;
        else {
                /* Decode and remove IPL */
diff -r 5e40e0ed8b18 -r c46a3392058e sys/arch/sparc64/include/bus.h
--- a/sys/arch/sparc64/include/bus.h    Tue Dec 10 12:21:02 2002 +0000
+++ b/sys/arch/sparc64/include/bus.h    Tue Dec 10 12:24:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.39 2002/03/21 00:43:42 eeh Exp $     */
+/*     $NetBSD: bus.h,v 1.40 2002/12/10 12:24:06 pk Exp $      */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -162,7 +162,7 @@
                int, int));
 
        void    *(*sparc_intr_establish) __P((bus_space_tag_t, int, int, int,
-               int (*) __P((void *)), void *));
+               int (*) __P((void *)), void *, void (*)__P((void))));
 
 };
 
@@ -319,7 +319,7 @@
        int     (*h)__P((void *));
        void    *a;
 {
-       _BS_CALL(t, sparc_intr_establish)(t, p, l, f, h, a);
+       _BS_CALL(t, sparc_intr_establish)(t, p, l, f, h, a, NULL);
 }
 
 /* XXXX Things get complicated if we use unmapped register accesses. */
@@ -337,10 +337,6 @@
 #define        BUS_SPACE_MAP_BUS4              0x0800
 
 
-/* flags for intr_establish() */
-#define BUS_INTR_ESTABLISH_FASTTRAP    1
-#define BUS_INTR_ESTABLISH_SOFTINTR    2
-
 /* flags for bus_space_barrier() */
 #define        BUS_SPACE_BARRIER_READ  0x01            /* force read barrier */
 #define        BUS_SPACE_BARRIER_WRITE 0x02            /* force write barrier */
diff -r 5e40e0ed8b18 -r c46a3392058e sys/arch/sparc64/sparc64/machdep.c
--- a/sys/arch/sparc64/sparc64/machdep.c        Tue Dec 10 12:21:02 2002 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c        Tue Dec 10 12:24:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.134 2002/11/27 18:00:27 pk Exp $ */
+/*     $NetBSD: machdep.c,v 1.135 2002/12/10 12:24:07 pk Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -1806,7 +1806,7 @@
 static paddr_t sparc_bus_mmap __P((bus_space_tag_t, bus_addr_t, off_t, int, int));
 static void    *sparc_mainbus_intr_establish __P((bus_space_tag_t, int, int,
                                                   int, int (*) __P((void *)),
-                                                  void *));
+                                                  void *, void (*)__P((void))));
 static int     sparc_bus_alloc __P((bus_space_tag_t, bus_addr_t, bus_addr_t,
                                     bus_size_t, bus_size_t, bus_size_t, int,
                                     bus_addr_t *, bus_space_handle_t *));
@@ -1973,13 +1973,14 @@
 
 
 void *
-sparc_mainbus_intr_establish(t, pil, level, flags, handler, arg)
+sparc_mainbus_intr_establish(t, pil, level, flags, handler, arg, fastvec)
        bus_space_tag_t t;
        int     pil;
        int     level;
        int     flags;
        int     (*handler)__P((void *));
        void    *arg;
+       void    (*fastvec)__P((void));  /* ignored */
 {
        struct intrhand *ih;
 



Home | Main Index | Thread Index | Old Index