Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/cobalt Use common mips generic software interrupt r...



details:   https://anonhg.NetBSD.org/src/rev/0ff12e8a2e97
branches:  trunk
changeset: 551827:0ff12e8a2e97
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Sep 12 17:55:40 2003 +0000

description:
Use common mips generic software interrupt routines.

diffstat:

 sys/arch/cobalt/cobalt/autoconf.c       |   7 ++-
 sys/arch/cobalt/cobalt/locore_machdep.S |   7 +--
 sys/arch/cobalt/cobalt/machdep.c        |  52 +++++++++++-----------
 sys/arch/cobalt/conf/files.cobalt       |   4 +-
 sys/arch/cobalt/conf/std.cobalt         |   4 +-
 sys/arch/cobalt/dev/com_mainbus.c       |   5 +-
 sys/arch/cobalt/include/intr.h          |  73 +++++++++++++++++++++-----------
 sys/arch/cobalt/include/intr_machdep.h  |  39 -----------------
 sys/arch/cobalt/include/types.h         |   3 +-
 sys/arch/cobalt/pci/pci_machdep.c       |   5 +-
 sys/arch/cobalt/pci/pcib.c              |  25 +++++-----
 sys/arch/cobalt/pci/pciide_machdep.c    |   6 +-
 12 files changed, 104 insertions(+), 126 deletions(-)

diffs (truncated from 519 to 300 lines):

diff -r abb1571855de -r 0ff12e8a2e97 sys/arch/cobalt/cobalt/autoconf.c
--- a/sys/arch/cobalt/cobalt/autoconf.c Fri Sep 12 17:32:29 2003 +0000
+++ b/sys/arch/cobalt/cobalt/autoconf.c Fri Sep 12 17:55:40 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.10 2003/07/15 01:29:21 lukem Exp $      */
+/*     $NetBSD: autoconf.c,v 1.11 2003/09/12 17:55:44 tsutsui Exp $    */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.10 2003/07/15 01:29:21 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.11 2003/09/12 17:55:44 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -49,6 +49,9 @@
 void
 cpu_configure()
 {
+
+       softintr_init();
+
        (void)splhigh();
 
        if (config_rootfound("mainbus", "mainbus") == NULL)
diff -r abb1571855de -r 0ff12e8a2e97 sys/arch/cobalt/cobalt/locore_machdep.S
--- a/sys/arch/cobalt/cobalt/locore_machdep.S   Fri Sep 12 17:32:29 2003 +0000
+++ b/sys/arch/cobalt/cobalt/locore_machdep.S   Fri Sep 12 17:55:40 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_machdep.S,v 1.3 2000/03/31 14:51:49 soren Exp $ */
+/*     $NetBSD: locore_machdep.S,v 1.4 2003/09/12 17:55:44 tsutsui Exp $       */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -37,12 +37,7 @@
        .globl _C_LABEL(eintrnames)
 
 _C_LABEL(intrnames):
-       .asciiz "softclock"
-       .asciiz "softnet"
-
 _C_LABEL(eintrnames):
-       .align  2
 _C_LABEL(intrcnt):
-       .word   0,0
 _C_LABEL(eintrcnt):
        .word   0
diff -r abb1571855de -r 0ff12e8a2e97 sys/arch/cobalt/cobalt/machdep.c
--- a/sys/arch/cobalt/cobalt/machdep.c  Fri Sep 12 17:32:29 2003 +0000
+++ b/sys/arch/cobalt/cobalt/machdep.c  Fri Sep 12 17:55:40 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.46 2003/09/12 15:29:48 tsutsui Exp $     */
+/*     $NetBSD: machdep.c,v 1.47 2003/09/12 17:55:45 tsutsui Exp $     */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.46 2003/09/12 15:29:48 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.47 2003/09/12 17:55:45 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -61,7 +61,6 @@
 #include <machine/pte.h>
 #include <machine/autoconf.h>
 #include <machine/intr.h>
-#include <machine/intr_machdep.h>
 #include <mips/locore.h>
 
 #include <machine/nvram.h>
@@ -422,7 +421,14 @@
 
 #define NINTR  6
 
-static struct cobalt_intr intrtab[NINTR];
+static struct cobalt_intrhand intrtab[NINTR];
+
+const u_int32_t mips_ipl_si_to_sr[_IPL_NSOFT] = {
+       MIPS_SOFT_INT_MASK_0,                   /* IPL_SOFT */
+       MIPS_SOFT_INT_MASK_0,                   /* IPL_SOFTCLOCK */
+       MIPS_SOFT_INT_MASK_1,                   /* IPL_SOFTNET */
+       MIPS_SOFT_INT_MASK_1,                   /* IPL_SOFTSERIAL */
+};
 
 void *
 cpu_intr_establish(level, ipl, func, arg)
@@ -434,12 +440,12 @@
        if (level < 0 || level >= NINTR)
                panic("invalid interrupt level");
 
-       if (intrtab[level].func != NULL)
+       if (intrtab[level].ih_func != NULL)
                panic("cannot share CPU interrupts");
 
        intrtab[level].cookie_type = COBALT_COOKIE_TYPE_CPU;
-       intrtab[level].func = func;
-       intrtab[level].arg = arg;
+       intrtab[level].ih_func = func;
+       intrtab[level].ih_arg = arg;
 
        return &intrtab[level];
 }
@@ -448,11 +454,11 @@
 cpu_intr_disestablish(cookie)
        void *cookie;
 {
-       struct cobalt_intr *p = cookie;
+       struct cobalt_intrhand *ih = cookie;
 
-       if (p->cookie_type == COBALT_COOKIE_TYPE_CPU) {
-               p->func = NULL;
-               p->arg = NULL;
+       if (ih->cookie_type == COBALT_COOKIE_TYPE_CPU) {
+               ih->ih_func = NULL;
+               ih->ih_arg = NULL;
        }
 }
 
@@ -486,8 +492,8 @@
 
        for (i = 0; i < 5; i++) {
                if (ipending & (MIPS_INT_MASK_0 << i))
-                       if (intrtab[i].func != NULL)
-                               if ((*intrtab[i].func)(intrtab[i].arg))
+                       if (intrtab[i].ih_func != NULL)
+                               if ((*intrtab[i].ih_func)(intrtab[i].ih_arg))
                                        cause &= ~(MIPS_INT_MASK_0 << i);
        }
 
@@ -506,20 +512,14 @@
 
        _splset((status & ~cause & MIPS_HARD_INT_MASK) | MIPS_SR_INT_IE);
 
-       /* 'softnet' interrupt */
-       if (ipending & MIPS_SOFT_INT_MASK_1) {
-               clearsoftnet();
-               uvmexp.softs++;
-               netintr();
-       }
+       /* software interrupt */
+       ipending &= (MIPS_SOFT_INT_MASK_1|MIPS_SOFT_INT_MASK_0);
+       if (ipending == 0)
+               return;
 
-       /* 'softclock' interrupt */
-       if (ipending & MIPS_SOFT_INT_MASK_0) {
-               clearsoftclock();
-               uvmexp.softs++;
-               intrcnt[SOFTCLOCK_INTR]++;
-               softclock(NULL);
-       }
+       _clrsoftintr(ipending);
+
+       softintr_dispatch(ipending);
 }
 
 
diff -r abb1571855de -r 0ff12e8a2e97 sys/arch/cobalt/conf/files.cobalt
--- a/sys/arch/cobalt/conf/files.cobalt Fri Sep 12 17:32:29 2003 +0000
+++ b/sys/arch/cobalt/conf/files.cobalt Fri Sep 12 17:55:40 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.cobalt,v 1.16 2003/07/27 01:19:25 thorpej Exp $
+#      $NetBSD: files.cobalt,v 1.17 2003/09/12 17:55:47 tsutsui Exp $
 
 maxpartitions 16
 
@@ -30,6 +30,8 @@
 file arch/cobalt/cobalt/disksubr.c
 file arch/cobalt/cobalt/machdep.c
 
+file arch/mips/mips/softintr.c
+
 file dev/md_root.c                     memory_disk_hooks
 
 file dev/cons.c
diff -r abb1571855de -r 0ff12e8a2e97 sys/arch/cobalt/conf/std.cobalt
--- a/sys/arch/cobalt/conf/std.cobalt   Fri Sep 12 17:32:29 2003 +0000
+++ b/sys/arch/cobalt/conf/std.cobalt   Fri Sep 12 17:55:40 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.cobalt,v 1.7 2003/08/30 22:44:39 chs Exp $
+#      $NetBSD: std.cobalt,v 1.8 2003/09/12 17:55:48 tsutsui Exp $
 
 machine cobalt mips
 makeoptions    MACHINE_ARCH="mipsel"
@@ -10,6 +10,4 @@
 options        EXEC_ELF32      # exec ELF32 binaries
 options        EXEC_SCRIPT     # exec #! scripts
 
-options        __NO_SOFT_SERIAL_INTERRUPT
-
 makeoptions    DEFTEXTADDR="0x80001000"
diff -r abb1571855de -r 0ff12e8a2e97 sys/arch/cobalt/dev/com_mainbus.c
--- a/sys/arch/cobalt/dev/com_mainbus.c Fri Sep 12 17:32:29 2003 +0000
+++ b/sys/arch/cobalt/dev/com_mainbus.c Fri Sep 12 17:55:40 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_mainbus.c,v 1.6 2003/07/15 01:29:23 lukem Exp $    */
+/*     $NetBSD: com_mainbus.c,v 1.7 2003/09/12 17:55:50 tsutsui Exp $  */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.6 2003/07/15 01:29:23 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.7 2003/09/12 17:55:50 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,7 +45,6 @@
 
 #include <machine/autoconf.h>
 #include <machine/intr.h>
-#include <machine/intr_machdep.h>
 #include <machine/bus.h>
 
 #include <dev/ic/comreg.h>
diff -r abb1571855de -r 0ff12e8a2e97 sys/arch/cobalt/include/intr.h
--- a/sys/arch/cobalt/include/intr.h    Fri Sep 12 17:32:29 2003 +0000
+++ b/sys/arch/cobalt/include/intr.h    Fri Sep 12 17:55:40 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.14 2003/09/12 15:03:24 tsutsui Exp $        */
+/*     $NetBSD: intr.h,v 1.15 2003/09/12 17:55:42 tsutsui Exp $        */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -32,6 +32,7 @@
 #define        IPL_BIO         1       /* Disable block I/O interrupts. */
 #define        IPL_NET         2       /* Disable network interrupts. */
 #define        IPL_TTY         3       /* Disable terminal interrupts. */
+#define        IPL_SERIAL      3       /* Disable serial hardware interrupts. */
 #define        IPL_VM          4       /* Memory allocation */
 #define        IPL_CLOCK       5       /* Disable clock interrupts. */
 #define        IPL_STATCLOCK   6       /* Disable profiling interrupts. */
@@ -44,12 +45,19 @@
 #define IST_EDGE       2       /* edge-triggered */
 #define IST_LEVEL      3       /* level-triggered */
 
-/* Soft interrupt masks. */
-#define SIR_CLOCK      31
-#define SIR_NET                30
-#define SIR_CLOCKMASK  ((1 << SIR_CLOCK))
-#define SIR_NETMASK    ((1 << SIR_NET) | SIR_CLOCKMASK)
-#define SIR_ALLMASK    (SIR_CLOCKMASK | SIR_NETMASK)
+/* Soft interrupt numbers. */
+#define        IPL_SOFT        0       /* generic software interrupts */
+#define        IPL_SOFTSERIAL  1       /* serial software interrupts */
+#define        IPL_SOFTNET     2       /* network software interrupts */
+#define        IPL_SOFTCLOCK   3       /* clock software interrupts */
+#define        _IPL_NSOFT      4
+
+#define        IPL_SOFTNAMES {                                                 \
+       "misc",                                                         \
+       "serial",                                                       \
+       "net",                                                          \
+       "clock",                                                        \
+}
 
 #ifdef _KERNEL
 #ifndef _LOCORE
@@ -64,35 +72,48 @@
 extern void            _setsoftintr(int);
 extern void            _clrsoftintr(int);
 
-#define setsoftclock() _setsoftintr(MIPS_SOFT_INT_MASK_0)
-#define setsoftnet()   _setsoftintr(MIPS_SOFT_INT_MASK_1)
-#define clearsoftclock() _clrsoftintr(MIPS_SOFT_INT_MASK_0)
-#define clearsoftnet() _clrsoftintr(MIPS_SOFT_INT_MASK_1)
-
 #define splhigh()       _splraise(MIPS_INT_MASK)
 #define spl0()          (void)_spllower(0)
 #define splx(s)         (void)_splset(s)
-#define SPLSOFT                MIPS_SOFT_INT_MASK_0 | MIPS_SOFT_INT_MASK_1
-#define SPLBIO         SPLSOFT | MIPS_INT_MASK_4
-#define SPLNET         SPLBIO | MIPS_INT_MASK_1 | MIPS_INT_MASK_2
-#define SPLTTY         SPLNET | MIPS_INT_MASK_3
-#define SPLCLOCK       SPLTTY | MIPS_INT_MASK_0 | MIPS_INT_MASK_5
-#define splbio()        _splraise(SPLBIO)
-#define splnet()        _splraise(SPLNET)
-#define spltty()        _splraise(SPLTTY)
-#define splclock()      _splraise(SPLCLOCK)
+#define SPLSOFT                (MIPS_SOFT_INT_MASK_0 | MIPS_SOFT_INT_MASK_1)
+#define SPLBIO         (SPLSOFT | MIPS_INT_MASK_4)
+#define SPLNET         (SPLBIO | MIPS_INT_MASK_1 | MIPS_INT_MASK_2)
+#define SPLTTY         (SPLNET | MIPS_INT_MASK_3)
+#define SPLCLOCK       (SPLTTY | MIPS_INT_MASK_0 | MIPS_INT_MASK_5)
+#define splbio()       _splraise(SPLBIO)
+#define splnet()       _splraise(SPLNET)
+#define spltty()       _splraise(SPLTTY)
+#define splserial()    _splraise(SPLTTY)
+#define splclock()     _splraise(SPLCLOCK)
 #define splvm()                splclock()
-#define splstatclock()  splclock()
-#define splsoftclock() _splraise(MIPS_SOFT_INT_MASK_0)



Home | Main Index | Thread Index | Old Index