Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc Move data structures to softintr.c. Remove...



details:   https://anonhg.NetBSD.org/src/rev/9b6afa4cfc6c
branches:  trunk
changeset: 559907:9b6afa4cfc6c
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Mar 25 18:46:27 2004 +0000

description:
Move data structures to softintr.c.  Remove an unneeded if.  Fix a typo.

diffstat:

 sys/arch/powerpc/include/softintr.h |  21 +++++++--------------
 sys/arch/powerpc/powerpc/softintr.c |  19 ++++++++++++++-----
 2 files changed, 21 insertions(+), 19 deletions(-)

diffs (108 lines):

diff -r 9a350723e09f -r 9b6afa4cfc6c sys/arch/powerpc/include/softintr.h
--- a/sys/arch/powerpc/include/softintr.h       Thu Mar 25 18:44:57 2004 +0000
+++ b/sys/arch/powerpc/include/softintr.h       Thu Mar 25 18:46:27 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: softintr.h,v 1.1 2004/03/24 23:39:39 matt Exp $        */
+/*     $NetBSD: softintr.h,v 1.2 2004/03/25 18:46:27 matt Exp $        */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -41,20 +41,11 @@
 #ifdef _KERNEL
 #include <sys/queue.h>
 
-SIMPLEQ_HEAD(softintr_qh, softintr);
-
-struct softintr {
-       SIMPLEQ_ENTRY(softintr) si_link;
-       void (*si_func)(void *);                /* callback */
-       void *si_arg;                           /* argument to si_func */
-       int si_ipl;                             /* IPL_SOFT* */
-       int si_refs;                            /* either 1 or 2 */
-};
-
 /*
  * Override the standard schednetisr and have one softintr per netisr.
  * Note that this allows for eventually doing dynamic registration of netisr's.
  */
+struct softintr;
 extern struct softintr *softnet_handlers[];
 #define        schednetisr(an_isr)     softintr_schedule(softnet_handlers[(an_isr)])
 
@@ -62,9 +53,11 @@
 void softintr_disestablish(void *);
 void softintr_schedule(void *);
 
-void softintr__init(void);
-void softintr__run(int);
-
+/*
+ * These are *not* part of API.
+ */
+void softintr__init(void);             /* initialize the softintr framework */
+void softintr__run(int);               /* run the softintr list for an IPL */
 #endif
 
 #endif /* __POWERPC_SOFTINTR_H_ */
diff -r 9a350723e09f -r 9b6afa4cfc6c sys/arch/powerpc/powerpc/softintr.c
--- a/sys/arch/powerpc/powerpc/softintr.c       Thu Mar 25 18:44:57 2004 +0000
+++ b/sys/arch/powerpc/powerpc/softintr.c       Thu Mar 25 18:46:27 2004 +0000
@@ -34,7 +34,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.1 2004/03/24 23:39:39 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.2 2004/03/25 18:46:27 matt Exp $");
 
 #include <sys/param.h>
 #include <lib/libkern/libkern.h>
@@ -42,6 +42,16 @@
 #include <machine/intr.h>
 #include <net/netisr.h>
 
+SIMPLEQ_HEAD(softintr_qh, softintr);
+
+struct softintr {
+       SIMPLEQ_ENTRY(softintr) si_link;
+       void (*si_func)(void *);                /* callback */
+       void *si_arg;                           /* argument to si_func */
+       int si_ipl;                             /* IPL_SOFT* */
+       int si_refs;                            /* either 1 or 2 */
+};
+
 static struct softintr_qh
 #ifdef IPL_SOFTI2C
        softintr_softi2c = SIMPLEQ_HEAD_INITIALIZER(softintr_softi2c),
@@ -50,7 +60,7 @@
      softintr_softclock = SIMPLEQ_HEAD_INITIALIZER(softintr_softclock),
     softintr_softserial = SIMPLEQ_HEAD_INITIALIZER(softintr_softserial);
 
-static struct pool softintr_pool;
+struct pool softintr_pool;
 struct softintr *softnet_handlers[32];
 
 static __inline struct softintr_qh *
@@ -138,7 +148,7 @@
        case IPL_SOFTCLOCK:     setsoftclock(); break;
        case IPL_SOFTNET:       setsoftnet(); break;
 #ifdef IPL_SOFTI2C
-       case IPL_SOFTNET:       setsofti2c(); break;
+       case IPL_SOFTI2C:       setsofti2c(); break;
 #endif
        }
        splx(s);
@@ -157,13 +167,12 @@
        s = splvm();
        si = pool_get(&softintr_pool, PR_WAITOK);
        splx(s);
-       if (si == NULL)
-               return NULL;
 
        si->si_ipl = ipl;
        si->si_func = func;
        si->si_arg = arg;
        si->si_refs = 1;
+
        return si;
 }
 



Home | Main Index | Thread Index | Old Index