Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc bus_intr_establish() now takes an optional `f...



details:   https://anonhg.NetBSD.org/src/rev/b0e7f648fd9b
branches:  trunk
changeset: 540340:b0e7f648fd9b
user:      pk <pk%NetBSD.org@localhost>
date:      Tue Dec 10 12:16:25 2002 +0000

description:
bus_intr_establish() now takes an optional `fast trap' handler argument.
BUS_INTR_ESTABLISH_FASTTRAP and BUS_INTR_ESTABLISH_SOFTINTR are no longer used.

diffstat:

 sys/arch/sparc/dev/sbus.c        |  19 ++++++++-----------
 sys/arch/sparc/dev/vme_machdep.c |   4 ++--
 sys/arch/sparc/include/bus.h     |  33 ++++++++++++++++++++++++++-------
 sys/arch/sparc/sparc/machdep.c   |  16 ++++++++--------
 4 files changed, 44 insertions(+), 28 deletions(-)

diffs (196 lines):

diff -r 20129aadc400 -r b0e7f648fd9b sys/arch/sparc/dev/sbus.c
--- a/sys/arch/sparc/dev/sbus.c Tue Dec 10 12:13:24 2002 +0000
+++ b/sys/arch/sparc/dev/sbus.c Tue Dec 10 12:16:25 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.53 2002/12/06 16:04:11 pk Exp $ */
+/*     $NetBSD: sbus.c,v 1.54 2002/12/10 12:16:25 pk Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -109,9 +109,10 @@
                bus_space_tag_t,
                int,                    /*Sbus interrupt level*/
                int,                    /*`device class' priority*/
-               int,                    /*flags*/
+               int,
                int (*) __P((void *)),  /*handler*/
-               void *));               /*handler arg*/
+               void *,                 /*handler arg*/
+               void (*) __P((void)))); /*fast handler*/
 
 
 /* autoconfiguration driver */
@@ -662,13 +663,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));
 {
        struct sbus_softc *sc = t->cookie;
        struct intrhand *ih;
@@ -682,19 +684,14 @@
        /*
         * Translate Sbus interrupt priority to CPU interrupt level
         */
-       if ((flags & BUS_INTR_ESTABLISH_SOFTINTR) != 0)
-               pil = pri;
-       else if ((pri & SBUS_INTR_COMPAT) != 0)
+       if ((pri & SBUS_INTR_COMPAT) != 0)
                pil = pri & ~SBUS_INTR_COMPAT;
        else
                pil = sc->sc_intr2ipl[pri];
 
        ih->ih_fun = handler;
        ih->ih_arg = arg;
-       if ((flags & BUS_INTR_ESTABLISH_FASTTRAP) != 0)
-               intr_fasttrap(pil, (void (*)__P((void)))handler);
-       else
-               intr_establish(pil, level, ih);
+       intr_establish(pil, level, ih, fastvec);
        return (ih);
 }
 
diff -r 20129aadc400 -r b0e7f648fd9b sys/arch/sparc/dev/vme_machdep.c
--- a/sys/arch/sparc/dev/vme_machdep.c  Tue Dec 10 12:13:24 2002 +0000
+++ b/sys/arch/sparc/dev/vme_machdep.c  Tue Dec 10 12:16:25 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vme_machdep.c,v 1.40 2002/12/06 16:04:11 pk Exp $      */
+/*     $NetBSD: vme_machdep.c,v 1.41 2002/12/10 12:16:25 pk Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -834,7 +834,7 @@
                bzero(ih, sizeof *ih);
                ih->ih_fun = sc->sc_vmeintr;
                ih->ih_arg = vih;
-               intr_establish(pil, 0, ih);
+               intr_establish(pil, 0, ih, NULL);
        } else {
                svih->next = (vme_intr_handle_t)ih->ih_arg;
                ih->ih_arg = vih;
diff -r 20129aadc400 -r b0e7f648fd9b sys/arch/sparc/include/bus.h
--- a/sys/arch/sparc/include/bus.h      Tue Dec 10 12:13:24 2002 +0000
+++ b/sys/arch/sparc/include/bus.h      Tue Dec 10 12:16:25 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.33 2002/08/25 17:55:00 thorpej Exp $ */
+/*     $NetBSD: bus.h,v 1.34 2002/12/10 12:16:27 pk Exp $      */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -142,7 +142,8 @@
                                                          see machine/intr.h*/
                                int,                    /*flags*/
                                int (*) __P((void *)),  /*handler*/
-                               void *));               /*handler arg*/
+                               void *,                 /*handler arg*/
+                               void (*)(void)));       /*optional fast vector*/
 
 };
 
@@ -211,6 +212,15 @@
                                int,                    /*flags*/
                                int (*) __P((void *)),  /*handler*/
                                void *));               /*handler arg*/
+static void    *bus_intr_establish2 __P((
+                               bus_space_tag_t,
+                               int,                    /*bus-specific intr*/
+                               int,                    /*device class level,
+                                                         see machine/intr.h*/
+                               int,                    /*flags*/
+                               int (*) __P((void *)),  /*handler*/
+                               void *,                 /*handler arg*/
+                               void (*)(void)));       /*optional fast vector*/
 
 
 /* This macro finds the first "upstream" implementation of method `f' */
@@ -282,7 +292,20 @@
        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);
+}
+
+static __inline__ void *
+bus_intr_establish2(t, p, l, f, h, a, v)
+       bus_space_tag_t t;
+       int     p;
+       int     l;
+       int     f;
+       int     (*h)__P((void *));
+       void    *a;
+       void    (*v)__P((void));
+{
+       _BS_CALL(t, sparc_intr_establish)(t, p, l, f, h, a, v);
 }
 
 static __inline__ void
@@ -318,10 +341,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 20129aadc400 -r b0e7f648fd9b sys/arch/sparc/sparc/machdep.c
--- a/sys/arch/sparc/sparc/machdep.c    Tue Dec 10 12:13:24 2002 +0000
+++ b/sys/arch/sparc/sparc/machdep.c    Tue Dec 10 12:16:25 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.206 2002/12/06 16:04:13 pk Exp $ */
+/*     $NetBSD: machdep.c,v 1.207 2002/12/10 12:16:27 pk Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -1781,8 +1781,10 @@
 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 *));
+                                                  int,
+                                                  int (*) __P((void *)),
+                                                  void *,
+                                                  void (*) __P((void)) ));
 static void     sparc_bus_barrier __P(( bus_space_tag_t, bus_space_handle_t,
                                        bus_size_t, bus_size_t, int));
 
@@ -1953,13 +1955,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));
 {
        struct intrhand *ih;
 
@@ -1970,10 +1973,7 @@
 
        ih->ih_fun = handler;
        ih->ih_arg = arg;
-       if ((flags & BUS_INTR_ESTABLISH_FASTTRAP) != 0)
-               intr_fasttrap(pil, (void (*)__P((void)))handler);
-       else
-               intr_establish(pil, level, ih);
+       intr_establish(pil, level, ih, fastvec);
        return (ih);
 }
 



Home | Main Index | Thread Index | Old Index