Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Define the DONETISR macro and use netisr_dispatch.h...



details:   https://anonhg.NetBSD.org/src/rev/44ecea091f6b
branches:  trunk
changeset: 482777:44ecea091f6b
user:      erh <erh%NetBSD.org@localhost>
date:      Mon Feb 21 20:38:46 2000 +0000

description:
Define the DONETISR macro and use netisr_dispatch.h.  This is to cut down on code duplication and to standardize the available NETISRs across all ports.

diffstat:

 sys/arch/alpha/alpha/machdep.c   |  32 +---------------
 sys/arch/amiga/amiga/machdep.c   |  55 ++++++-----------------------
 sys/arch/arm32/arm32/intr.c      |  73 ++++++---------------------------------
 sys/arch/atari/atari/machdep.c   |  66 ++++++------------------------------
 sys/arch/bebox/bebox/machdep.c   |  44 ++++-------------------
 sys/arch/evbsh3/evbsh3/shb.c     |  43 ++++------------------
 sys/arch/hp300/hp300/intr.c      |  45 +++++-------------------
 sys/arch/i386/isa/icu.s          |  53 +++++++---------------------
 sys/arch/luna68k/luna68k/isr.c   |  67 +++++++-----------------------------
 sys/arch/mac68k/mac68k/intr.c    |  45 +++++-------------------
 sys/arch/macppc/macppc/machdep.c |  53 +++++-----------------------
 sys/arch/mips/mips/trap.c        |  36 +++++--------------
 sys/arch/mmeye/mmeye/shb.c       |  44 ++++-------------------
 sys/arch/mvme68k/mvme68k/isr.c   |  67 +++++++-----------------------------
 sys/arch/news68k/news68k/isr.c   |  64 +++++++---------------------------
 sys/arch/next68k/next68k/isr.c   |  63 ++++++---------------------------
 sys/arch/ofppc/ofppc/machdep.c   |  45 +++++-------------------
 sys/arch/sparc/sparc/intr.c      |  45 ++++++------------------
 sys/arch/sparc64/sparc64/intr.c  |  48 ++++++--------------------
 sys/arch/sun3/sun3/isr.c         |  44 ++++-------------------
 sys/arch/vax/vax/intvec.s        |  34 ++++-------------
 sys/arch/x68k/x68k/machdep.c     |  63 ++++++---------------------------
 22 files changed, 232 insertions(+), 897 deletions(-)

diffs (truncated from 1459 to 300 lines):

diff -r 91bc08acd08e -r 44ecea091f6b sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Mon Feb 21 20:36:14 2000 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Mon Feb 21 20:38:46 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.194 2000/02/12 20:57:12 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.195 2000/02/21 20:38:46 erh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.194 2000/02/12 20:57:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.195 2000/02/21 20:38:46 erh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1853,33 +1853,7 @@
                        fn;                                             \
        } while (0)
 
-#ifdef INET
-#if NARP > 0
-       DONETISR(NETISR_ARP, arpintr());
-#endif
-       DONETISR(NETISR_IP, ipintr());
-#endif
-#ifdef INET6
-       DONETISR(NETISR_IPV6, ip6intr());
-#endif
-#ifdef NETATALK
-       DONETISR(NETISR_ATALK, atintr());
-#endif
-#ifdef NS
-       DONETISR(NETISR_NS, nsintr());
-#endif
-#ifdef ISO
-       DONETISR(NETISR_ISO, clnlintr());
-#endif
-#ifdef CCITT
-       DONETISR(NETISR_CCITT, ccittintr());
-#endif
-#ifdef NATM
-       DONETISR(NETISR_NATM, natmintr());
-#endif
-#if NPPP > 0
-       DONETISR(NETISR_PPP, pppintr());
-#endif
+#include <net/netisr_dispatch.h>
 
 #undef DONETISR
 }
diff -r 91bc08acd08e -r 44ecea091f6b sys/arch/amiga/amiga/machdep.c
--- a/sys/arch/amiga/amiga/machdep.c    Mon Feb 21 20:36:14 2000 +0000
+++ b/sys/arch/amiga/amiga/machdep.c    Mon Feb 21 20:38:46 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.146 2000/02/09 05:48:29 shin Exp $       */
+/*     $NetBSD: machdep.c,v 1.147 2000/02/21 20:38:46 erh Exp $        */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1030,48 +1030,17 @@
 static void
 netintr()
 {
-#ifdef INET
-#if NARP > 0
-       if (netisr & (1 << NETISR_ARP)) {
-               netisr &= ~(1 << NETISR_ARP);
-               arpintr();
-       }
-#endif
-       if (netisr & (1 << NETISR_IP)) {
-               netisr &= ~(1 << NETISR_IP);
-               ipintr();
-       }
-#endif
-#ifdef INET6
-       if (netisr & (1 << NETISR_IPV6)) {
-               netisr &= ~(1 << NETISR_IPV6);
-               ip6intr();
-       }
-#endif
-#ifdef NETATALK
-       if (netisr & (1 << NETISR_ATALK)) {
-               netisr &= ~(1 << NETISR_ATALK);
-               atintr();
-       }
-#endif
-#ifdef NS
-       if (netisr & (1 << NETISR_NS)) {
-               netisr &= ~(1 << NETISR_NS);
-               nsintr();
-       }
-#endif
-#ifdef ISO
-       if (netisr & (1 << NETISR_ISO)) {
-               netisr &= ~(1 << NETISR_ISO);
-               clnlintr();
-       }
-#endif
-#if NPPP > 0
-       if (netisr & (1 << NETISR_PPP)) {
-               netisr &= ~(1 << NETISR_PPP);
-               pppintr();
-       }
-#endif
+
+#define DONETISR(bit, fn) do {         \
+       if (netisr & (1 << bit)) {      \
+               netisr &= ~(1 << bit);  \
+               fn();                   \
+       }                               \
+} while (0)
+
+#include <net/netisr_dispatch.h>
+
+#undef DONETISR
 }
 
 
diff -r 91bc08acd08e -r 44ecea091f6b sys/arch/arm32/arm32/intr.c
--- a/sys/arch/arm32/arm32/intr.c       Mon Feb 21 20:36:14 2000 +0000
+++ b/sys/arch/arm32/arm32/intr.c       Mon Feb 21 20:38:46 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.17 2000/02/09 05:48:30 shin Exp $   */
+/*     $NetBSD: intr.c,v 1.18 2000/02/21 20:38:47 erh Exp $    */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -203,66 +203,17 @@
                INC_SINTRCNT(SOFTIRQ_NET);
                clearsoftintr(SOFTIRQ_BIT(SOFTIRQ_NET));
 
-#ifdef INET
-#if NARP > 0
-               if (netisr & (1 << NETISR_ARP)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_ARP));
-                       arpintr();
-               }
-#endif
-               if (netisr & (1 << NETISR_IP)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_IP));
-                       ipintr();
-               }
-#endif
-#ifdef INET6
-               if (netisr & (1 << NETISR_IPV6)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_IPV6));
-                       ip6intr();
-               }
-#endif
-#ifdef NETATALK
-               if (netisr & (1 << NETISR_ATALK)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_ATALK));
-                       atintr();
-               }
-#endif
-#ifdef NS
-               if (netisr & (1 << NETISR_NS)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_NS));
-                       nsintr();
-               }
-#endif
-#ifdef IMP
-               if (netisr & (1 << NETISR_IMP)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_IMP));
-                       impintr();
-               }
-#endif
-#ifdef ISO
-               if (netisr & (1 << NETISR_ISO)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_ISO));
-                       clnlintr();
-               }
-#endif
-#ifdef CCITT
-               if (netisr & (1 << NETISR_CCITT)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_CCITT));
-                       ccittintr();
-               }
-#endif
-#ifdef NATM
-               if (netisr & (1 << NETISR_NATM)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_NATM));
-                       natmintr();
-               }
-#endif
-#if NPPP > 0
-               if (netisr & (1 << NETISR_PPP)) {
-                       atomic_clear_bit(&netisr, (1 << NETISR_PPP));
-                       pppintr();
-               }
-#endif
+#define DONETISR(bit, fn) do {                                 \
+               if (netisr & (1 << bit)) {                      \
+                       atomic_clear_bit(&netisr, (1 << bit));  \
+                       fn();                                   \
+               }                                               \
+} while (0)
+
+#include <net/netisr_dispatch.h>
+
+#undef DONETISR
+
                (void)splx(s);
        }
        /*
diff -r 91bc08acd08e -r 44ecea091f6b sys/arch/atari/atari/machdep.c
--- a/sys/arch/atari/atari/machdep.c    Mon Feb 21 20:36:14 2000 +0000
+++ b/sys/arch/atari/atari/machdep.c    Mon Feb 21 20:38:46 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.91 2000/01/19 20:05:33 thorpej Exp $     */
+/*     $NetBSD: machdep.c,v 1.92 2000/02/21 20:38:47 erh Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -811,60 +811,16 @@
 static void
 netintr()
 {
-#ifdef INET
-#if NARP > 0
-       if (netisr & (1 << NETISR_ARP)) {
-               netisr &= ~(1 << NETISR_ARP);
-               arpintr();
-       }
-#endif
-       if (netisr & (1 << NETISR_IP)) {
-               netisr &= ~(1 << NETISR_IP);
-               ipintr();
-       }
-#endif
-#ifdef INET6
-       if (netisr & (1 << NETISR_IPV6)) {
-               netisr &= ~(1 << NETISR_IPV6);
-               ip6intr();
-       }
-#endif
-#ifdef NETATALK
-       if (netisr & (1 << NETISR_ATALK)) {
-               netisr &= ~(1 << NETISR_ATALK);
-               atintr();
-       }
-#endif
-#ifdef NS
-       if (netisr & (1 << NETISR_NS)) {
-               netisr &= ~(1 << NETISR_NS);
-               nsintr();
-       }
-#endif
-#ifdef ISO
-       if (netisr & (1 << NETISR_ISO)) {
-               netisr &= ~(1 << NETISR_ISO);
-               clnlintr();
-       }
-#endif
-#ifdef CCITT
-       if (netisr & (1 << NETISR_CCITT)) {
-               netisr &= ~(1 << NETISR_CCITT);
-               ccittintr();
-       }
-#endif
-#ifdef NATM
-       if (netisr & (1 << NETISR_NATM)) {
-               netisr &= ~(1 << NETISR_NATM);
-               natmintr();
-       }
-#endif
-#ifdef NPPP
-       if (netisr & (1 << NETISR_PPP)) {
-               netisr &= ~(1 << NETISR_PPP);
-               pppintr();
-       }
-#endif
+#define DONETISR(bit, fn) do {                 \
+       if (netisr & (1 << bit)) {              \
+               netisr &= ~(1 << bit);          \
+               fn();                           \
+       }                                       \
+} while (0)
+
+#include <net/netisr_dispatch.h>
+
+#undef DONETISR
 }
 
 
diff -r 91bc08acd08e -r 44ecea091f6b sys/arch/bebox/bebox/machdep.c
--- a/sys/arch/bebox/bebox/machdep.c    Mon Feb 21 20:36:14 2000 +0000
+++ b/sys/arch/bebox/bebox/machdep.c    Mon Feb 21 20:38:46 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.48 2000/01/19 20:05:33 thorpej Exp $     */
+/*     $NetBSD: machdep.c,v 1.49 2000/02/21 20:38:47 erh Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -800,40 +800,14 @@
 softnet(isr)



Home | Main Index | Thread Index | Old Index