Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys pull up sparc/sparc64 bus_intr_establish() changes, ...



details:   https://anonhg.NetBSD.org/src/rev/911052c9de10
branches:  netbsd-1-5
changeset: 488576:911052c9de10
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Jul 19 02:53:03 2000 +0000

description:
pull up sparc/sparc64 bus_intr_establish() changes, necessary for sparc64
(originally done by pk, approved by thorpej):

>Add a `device class' interrupt level argument (from machine/intr.h)
>to bus_interrupt_establish().
>
>It's currently only used in sparc64/dev/psycho.c to assign a CPU interrupt
>level to devices in PCI slots.

diffstat:

 sys/arch/sparc/dev/am7930_sparc.c |  10 +++++-----
 sys/arch/sparc/dev/audioamd.c     |  10 +++++-----
 sys/arch/sparc/dev/com_obio.c     |   7 ++++---
 sys/arch/sparc/dev/esp_obio.c     |   7 ++++---
 sys/arch/sparc/dev/fd.c           |  10 +++++-----
 sys/arch/sparc/dev/if_ie_obio.c   |   7 ++++---
 sys/arch/sparc/dev/if_le_obio.c   |   7 ++++---
 sys/arch/sparc/dev/sbus.c         |  25 +++++++++++++++----------
 sys/arch/sparc/dev/si.c           |   4 ++--
 sys/arch/sparc/dev/tctrl.c        |   6 +++---
 sys/arch/sparc/dev/tcx.c          |   7 ++++---
 sys/arch/sparc/dev/zs.c           |  13 ++++++++-----
 sys/arch/sparc/include/bus.h      |  15 ++++++++++-----
 sys/arch/sparc/sparc/machdep.c    |  11 ++++++-----
 sys/dev/sbus/be.c                 |   7 ++++---
 sys/dev/sbus/bpp.c                |   9 +++++----
 sys/dev/sbus/cs4231_sbus.c        |  10 ++++++----
 sys/dev/sbus/dma_sbus.c           |  13 ++++++++-----
 sys/dev/sbus/esp_sbus.c           |   7 +++----
 sys/dev/sbus/if_en.c              |  15 ++++-----------
 sys/dev/sbus/if_hme_sbus.c        |   7 ++++---
 sys/dev/sbus/if_le.c              |   9 +++++----
 sys/dev/sbus/if_le_lebuffer.c     |   9 +++++----
 sys/dev/sbus/if_le_ledma.c        |   8 ++++----
 sys/dev/sbus/isp_sbus.c           |   9 ++++-----
 sys/dev/sbus/magma.c              |  13 ++++++++-----
 sys/dev/sbus/qe.c                 |   8 ++++----
 sys/dev/sbus/qec.c                |  23 +++++++++++++----------
 sys/dev/sbus/stp4020.c            |   8 ++++----
 29 files changed, 160 insertions(+), 134 deletions(-)

diffs (truncated from 1038 to 300 lines):

diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/am7930_sparc.c
--- a/sys/arch/sparc/dev/am7930_sparc.c Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/am7930_sparc.c Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: am7930_sparc.c,v 1.46 2000/06/04 19:15:00 cgd Exp $    */
+/*     $NetBSD: am7930_sparc.c,v 1.46.2.1 2000/07/19 02:53:09 mrg Exp $        */
 
 /*
  * Copyright (c) 1995 Rolf Grossmann
@@ -39,8 +39,8 @@
 #include <sys/device.h>
 
 #include <machine/bus.h>
+#include <machine/intr.h>
 #include <machine/autoconf.h>
-#include <machine/cpu.h>
 
 #include <sys/audioio.h>
 #include <dev/audio_if.h>
@@ -235,14 +235,14 @@
 
 #ifndef AUDIO_C_HANDLER
        auiop = &sc->sc_au;
-       (void)bus_intr_establish(sc->sc_bustag, pri,
+       (void)bus_intr_establish(sc->sc_bustag, pri, IPL_AUDIO,
                                 BUS_INTR_ESTABLISH_FASTTRAP,
                                 (int (*) __P((void *)))amd7930_trap, NULL);
 #else
-       (void)bus_intr_establish(sc->sc_bustag, pri, 0,
+       (void)bus_intr_establish(sc->sc_bustag, pri, IPL_AUDIO, 0,
                                 am7930hwintr, &sc->sc_au);
 #endif
-       (void)bus_intr_establish(sc->sc_bustag, PIL_AUSOFT,
+       (void)bus_intr_establish(sc->sc_bustag, PIL_AUSOFT, IPL_AUDIO,
                                 BUS_INTR_ESTABLISH_SOFTINTR,
                                 am7930swintr, sc);
 
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/audioamd.c
--- a/sys/arch/sparc/dev/audioamd.c     Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/audioamd.c     Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audioamd.c,v 1.5 2000/06/06 22:34:34 gmcgarry Exp $    */
+/*     $NetBSD: audioamd.c,v 1.5.2.1 2000/07/19 02:53:10 mrg Exp $     */
 /*     NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp  */
 
 /*
@@ -40,8 +40,8 @@
 #include <sys/device.h>
 
 #include <machine/bus.h>
+#include <machine/intr.h>
 #include <machine/autoconf.h>
-#include <machine/cpu.h>
 
 #include <sys/audioio.h>
 #include <dev/audio_if.h>
@@ -284,14 +284,14 @@
 
 #ifndef AUDIO_C_HANDLER
        auiop = &sc->sc_au;
-       (void)bus_intr_establish(sc->sc_bt, pri,
+       (void)bus_intr_establish(sc->sc_bt, pri, IPL_AUDIO,
                                 BUS_INTR_ESTABLISH_FASTTRAP,
                                 (int (*) __P((void *)))amd7930_trap, NULL);
 #else
-       (void)bus_intr_establish(sc->sc_bt, pri, 0,
+       (void)bus_intr_establish(sc->sc_bt, pri, IPL_AUDIO, 0,
                                 am7930hwintr, sc);
 #endif
-       (void)bus_intr_establish(sc->sc_bt, PIL_AUSOFT,
+       (void)bus_intr_establish(sc->sc_bt, PIL_AUSOFT, IPL_AUDIO,
                                 BUS_INTR_ESTABLISH_SOFTINTR,
                                 am7930swintr, sc);
 
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/com_obio.c
--- a/sys/arch/sparc/dev/com_obio.c     Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/com_obio.c     Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_obio.c,v 1.5 2000/06/04 19:15:01 cgd Exp $ */
+/*     $NetBSD: com_obio.c,v 1.5.2.1 2000/07/19 02:53:10 mrg Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -86,8 +86,9 @@
 #include <sys/types.h>
 #include <sys/device.h>
 
+#include <machine/bus.h>
 #include <machine/autoconf.h>
-#include <machine/cpu.h>
+#include <machine/intr.h>
 
 #include <dev/ic/comreg.h>
 #include <dev/ic/comvar.h>
@@ -186,7 +187,7 @@
        com_attach_subr(sc);
 
        if (sa->sa_nintr != 0) {
-               (void)bus_intr_establish(sc->sc_iot, sa->sa_pri,
+               (void)bus_intr_establish(sc->sc_iot, sa->sa_pri, IPL_SERIAL,
                                         0, comintr, sc);
                evcnt_attach_dynamic(&osc->osc_intrcnt, EVCNT_TYPE_INTR, NULL,
                    osc->osc_com.sc_dev.dv_xname, "intr");
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/esp_obio.c
--- a/sys/arch/sparc/dev/esp_obio.c     Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/esp_obio.c     Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: esp_obio.c,v 1.7 2000/06/05 07:59:53 nisimura Exp $    */
+/*     $NetBSD: esp_obio.c,v 1.7.2.1 2000/07/19 02:53:10 mrg Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
 
 #include <machine/bus.h>
 #include <machine/autoconf.h>
-#include <machine/cpu.h>
+#include <machine/intr.h>
 
 #include <dev/ic/lsi64854reg.h>
 #include <dev/ic/lsi64854var.h>
@@ -254,7 +254,8 @@
        }
 
        /* Establish interrupt channel */
-       bus_intr_establish(esc->sc_bustag, oba->oba_pri, 0, ncr53c9x_intr, sc);
+       bus_intr_establish(esc->sc_bustag, oba->oba_pri, IPL_BIO, 0,
+                          ncr53c9x_intr, sc);
 
        /* register interrupt stats */
        evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/fd.c
--- a/sys/arch/sparc/dev/fd.c   Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/fd.c   Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.82 2000/06/04 19:15:02 cgd Exp $      */
+/*     $NetBSD: fd.c,v 1.82.2.1 2000/07/19 02:53:11 mrg Exp $  */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -105,8 +105,8 @@
 
 #include <uvm/uvm_extern.h>
 
-#include <machine/cpu.h>
 #include <machine/autoconf.h>
+#include <machine/intr.h>
 #include <machine/conf.h>
 
 #include <sparc/sparc/auxreg.h>
@@ -643,15 +643,15 @@
        }
 
 #ifdef FDC_C_HANDLER
-       (void)bus_intr_establish(fdc->sc_bustag, pri, 0,
+       (void)bus_intr_establish(fdc->sc_bustag, pri, IPL_BIO, 0,
                                 fdc_c_hwintr, fdc);
 #else
        fdciop = &fdc->sc_io;
-       (void)bus_intr_establish(fdc->sc_bustag, pri,
+       (void)bus_intr_establish(fdc->sc_bustag, pri, IPL_BIO,
                                 BUS_INTR_ESTABLISH_FASTTRAP,
                                 (int (*) __P((void *)))fdchwintr, NULL);
 #endif
-       (void)bus_intr_establish(fdc->sc_bustag, PIL_FDSOFT,
+       (void)bus_intr_establish(fdc->sc_bustag, PIL_FDSOFT, IPL_BIO,
                                 BUS_INTR_ESTABLISH_SOFTINTR,
                                 fdcswintr, fdc);
 
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/if_ie_obio.c
--- a/sys/arch/sparc/dev/if_ie_obio.c   Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/if_ie_obio.c   Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ie_obio.c,v 1.15 2000/06/15 12:12:05 pk Exp $       */
+/*     $NetBSD: if_ie_obio.c,v 1.15.2.1 2000/07/19 02:53:12 mrg Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -100,10 +100,11 @@
 
 #include <vm/vm.h>
 
-#include <machine/autoconf.h>
 #include <machine/cpu.h>
 #include <machine/pmap.h>
 #include <machine/bus.h>
+#include <machine/intr.h>
+#include <machine/autoconf.h>
 
 #include <dev/ic/i82586reg.h>
 #include <dev/ic/i82586var.h>
@@ -421,6 +422,6 @@
 
        /* Establish interrupt channel */
        ih = bus_intr_establish(oba->oba_bustag,
-                               oba->oba_pri, 0,
+                               oba->oba_pri, IPL_NET, 0,
                                i82586_intr, sc);
 }
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/if_le_obio.c
--- a/sys/arch/sparc/dev/if_le_obio.c   Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/if_le_obio.c   Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le_obio.c,v 1.7 2000/05/09 22:42:08 pk Exp $        */
+/*     $NetBSD: if_le_obio.c,v 1.7.4.1 2000/07/19 02:53:12 mrg Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -50,8 +50,9 @@
 #include <net/if_ether.h>
 #include <net/if_media.h>
 
+#include <machine/bus.h>
+#include <machine/intr.h>
 #include <machine/autoconf.h>
-#include <machine/cpu.h>
 
 #include <dev/ic/lancereg.h>
 #include <dev/ic/lancevar.h>
@@ -233,6 +234,6 @@
        am7990_config(&lesc->sc_am7990);
 
        /* Install interrupt */
-       (void)bus_intr_establish(lesc->sc_bustag, oba->oba_pri, 0,
+       (void)bus_intr_establish(lesc->sc_bustag, oba->oba_pri, IPL_NET, 0,
                                 am7990_intr, sc);
 }
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/sbus.c
--- a/sys/arch/sparc/dev/sbus.c Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/sbus.c Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.36 2000/01/11 12:59:46 pk Exp $ */
+/*     $NetBSD: sbus.c,v 1.36.4.1 2000/07/19 02:53:12 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -117,7 +117,8 @@
                bus_space_handle_t *));
 static void *sbus_intr_establish __P((
                bus_space_tag_t,
-               int,                    /*level*/
+               int,                    /*Sbus interrupt level*/
+               int,                    /*`device class' priority*/
                int,                    /*flags*/
                int (*) __P((void *)),  /*handler*/
                void *));               /*handler arg*/
@@ -718,8 +719,9 @@
  * Install an interrupt handler for an Sbus device.
  */
 void *
-sbus_intr_establish(t, level, flags, handler, arg)
+sbus_intr_establish(t, pri, level, flags, handler, arg)
        bus_space_tag_t t;
+       int pri;
        int level;
        int flags;
        int (*handler) __P((void *));
@@ -727,26 +729,29 @@
 {
        struct sbus_softc *sc = t->cookie;
        struct intrhand *ih;
-       int ipl;
+       int pil;
 
        ih = (struct intrhand *)
                malloc(sizeof(struct intrhand), M_DEVBUF, M_NOWAIT);
        if (ih == NULL)
                return (NULL);
 
+       /*
+        * Translate Sbus interrupt priority to CPU interrupt level
+        */
        if ((flags & BUS_INTR_ESTABLISH_SOFTINTR) != 0)
-               ipl = level;
-       else if ((level & SBUS_INTR_COMPAT) != 0)
-               ipl = level & ~SBUS_INTR_COMPAT;
+               pil = pri;
+       else if ((pri & SBUS_INTR_COMPAT) != 0)
+               pil = pri & ~SBUS_INTR_COMPAT;
        else
-               ipl = sc->sc_intr2ipl[level];
+               pil = sc->sc_intr2ipl[pri];
 
        ih->ih_fun = handler;
        ih->ih_arg = arg;
        if ((flags & BUS_INTR_ESTABLISH_FASTTRAP) != 0)
-               intr_fasttrap(ipl, (void (*)__P((void)))handler);
+               intr_fasttrap(pil, (void (*)__P((void)))handler);
        else
-               intr_establish(ipl, ih);
+               intr_establish(pil, ih);
        return (ih);
 }
 
diff -r 4cb3367e7ec2 -r 911052c9de10 sys/arch/sparc/dev/si.c
--- a/sys/arch/sparc/dev/si.c   Wed Jul 19 00:25:25 2000 +0000
+++ b/sys/arch/sparc/dev/si.c   Wed Jul 19 02:53:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: si.c,v 1.60 2000/06/18 19:19:53 pk Exp $       */
+/*     $NetBSD: si.c,v 1.60.2.1 2000/07/19 02:53:12 mrg Exp $  */



Home | Main Index | Thread Index | Old Index