Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/pmax NetBSD/pmax now has GENERIC_SOFT_INTERRUPTS.



details:   https://anonhg.NetBSD.org/src/rev/81512af77974
branches:  trunk
changeset: 514085:81512af77974
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Wed Aug 22 06:59:38 2001 +0000

description:
NetBSD/pmax now has GENERIC_SOFT_INTERRUPTS.

diffstat:

 sys/arch/pmax/conf/files.pmax     |    3 +-
 sys/arch/pmax/include/intr.h      |  121 ++++++++++++++++++---
 sys/arch/pmax/include/types.h     |    3 +-
 sys/arch/pmax/pmax/autoconf.c     |    9 +-
 sys/arch/pmax/pmax/dec_3100.c     |    4 +-
 sys/arch/pmax/pmax/dec_3max.c     |    6 +-
 sys/arch/pmax/pmax/dec_3maxplus.c |    6 +-
 sys/arch/pmax/pmax/dec_3min.c     |    6 +-
 sys/arch/pmax/pmax/dec_5100.c     |    6 +-
 sys/arch/pmax/pmax/dec_maxine.c   |   14 +-
 sys/arch/pmax/pmax/interrupt.c    |  216 ++++++++++++++++++++++++++++++++++++++
 sys/arch/pmax/pmax/machdep.c      |   67 +-----------
 12 files changed, 349 insertions(+), 112 deletions(-)

diffs (truncated from 700 to 300 lines):

diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/conf/files.pmax
--- a/sys/arch/pmax/conf/files.pmax     Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/conf/files.pmax     Wed Aug 22 06:59:38 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.pmax,v 1.92 2001/01/17 00:07:33 fvdl Exp $
+#      $NetBSD: files.pmax,v 1.93 2001/08/22 06:59:44 nisimura Exp $
 # DECstation-specific configuration info
 
 # maxpartitions must be first item in files.${ARCH}.
@@ -224,6 +224,7 @@
 file   arch/pmax/pmax/disksubr.c
 file   arch/pmax/pmax/machdep.c
 file   arch/pmax/pmax/mainbus.c
+file   arch/pmax/pmax/interrupt.c
 file   arch/pmax/pmax/procfs_machdep.c procfs
 file   arch/pmax/pmax/promcall.c
 file   arch/pmax/pmax/sysconf.c
diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/include/intr.h
--- a/sys/arch/pmax/include/intr.h      Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/include/intr.h      Wed Aug 22 06:59:38 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.20 2001/04/13 23:30:03 thorpej Exp $        */
+/*     $NetBSD: intr.h,v 1.21 2001/08/22 06:59:44 nisimura Exp $       */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -33,19 +33,45 @@
 #ifndef _PMAX_INTR_H_
 #define _PMAX_INTR_H_
 
+#include <sys/device.h>
+#include <sys/lock.h>
+#include <sys/queue.h>
+
 #define        IPL_NONE        0       /* disable only this interrupt */
-#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_CLOCK       4       /* disable clock interrupts */
-#define        IPL_STATCLOCK   5       /* disable profiling interrupts */
-#define        IPL_SERIAL      6       /* disable serial hardware interrupts */
-#define        IPL_DMA         7       /* disable DMA reload interrupts */
+
+#define        IPL_SOFT        1       /* generic software interrupts (SI 0) */
+#define        IPL_SOFTCLOCK   2       /* clock software interrupts (SI 0) */
+#define        IPL_SOFTNET     3       /* network software interrupts (SI 1) */
+#define        IPL_SOFTSERIAL  4       /* serial software interrupts (SI 1) */
+
+#define        IPL_BIO         5       /* disable block I/O interrupts */
+#define        IPL_NET         6       /* disable network interrupts */
+#define        IPL_TTY         7       /* disable terminal interrupts */
+#define        IPL_SERIAL      7       /* disable serial interrupts */
+#define        IPL_CLOCK       8       /* disable clock interrupts */
 #define        IPL_HIGH        8       /* disable all interrupts */
 
+#define        _IPL_NSOFT      4
+#define        _IPL_N          9
+
+#define        _IPL_SI0_FIRST  IPL_SOFT
+#define        _IPL_SI0_LAST   IPL_SOFTCLOCK
+
+#define        _IPL_SI1_FIRST  IPL_SOFTNET
+#define        _IPL_SI1_LAST   IPL_SOFTSERIAL
+
+#define        IPL_SOFTNAMES {                                                 \
+       "misc",                                                         \
+       "clock",                                                        \
+       "net",                                                          \
+       "serial",                                                       \
+}
+
 #ifdef _KERNEL
 #ifndef _LOCORE
 
+extern const u_int32_t ipl_si_to_sr[_IPL_NSOFT];
+
 #include <mips/cpuregs.h>
 
 int    _splraise __P((int));
@@ -98,6 +124,7 @@
  */
 extern u_long intrcnt[];
 
+#if 0
 #define        SOFTCLOCK_INTR  0
 #define        SOFTNET_INTR    1
 #define        SERIAL0_INTR    2
@@ -114,6 +141,20 @@
 #define        ISDN_INTR       13
 #define        FLOPPY_INTR     14
 #define        STRAY_INTR      15
+#else
+#define        SERIAL0_INTR    0
+#define        SERIAL1_INTR    1
+#define        LANCE_INTR      2
+#define        SCSI_INTR       3
+#define        ERROR_INTR      4
+#define        SLOT0_INTR      5
+#define        SLOT1_INTR      6
+#define        SLOT2_INTR      7
+#define        DTOP_INTR       8
+#define        ISDN_INTR       9
+#define        FLOPPY_INTR     10
+#define        STRAY_INTR      11
+#endif
 
 struct intrhand {
        int     (*ih_func) __P((void *));
@@ -132,20 +173,64 @@
 #define SYS_DEV_OPT1   SLOT1_INTR
 #define SYS_DEV_OPT2   SLOT2_INTR
 #define SYS_DEV_BOGUS  -1
-#define MAX_DEV_NCOOKIES 16
+#define MAX_DEV_NCOOKIES 12
+
+struct pmax_intrhand {
+       LIST_ENTRY(pmax_intrhand) ih_q;
+       int (*ih_func)(void *);
+       void *ih_arg;
+};
 
-/*
- * software simulated interrupt
- */
-extern unsigned ssir;
+#define        setsoft(x)                                                      \
+do {                                                                   \
+       _setsoftintr(ipl_si_to_sr[(x) - IPL_SOFT]);                     \
+} while (0)
+
+struct pmax_soft_intrhand {
+       TAILQ_ENTRY(pmax_soft_intrhand)
+               sih_q;
+       struct pmax_soft_intr *sih_intrhead;
+       void    (*sih_fn)(void *);
+       void    *sih_arg;
+       int     sih_pending;
+};
 
-#define SIR_NET                0x1
+struct pmax_soft_intr {
+       TAILQ_HEAD(, pmax_soft_intrhand)
+               softintr_q;
+       struct evcnt softintr_evcnt;
+       struct simplelock softintr_slock;
+       unsigned long softintr_ipl;
+};
+
+void   *softintr_establish(int, void (*)(void *), void *);
+void   softintr_disestablish(void *);
+void   softintr_init(void);
+void   softintr_dispatch(void);
 
-#define setsoftnet()   setsoft(SIR_NET)
-#define setsoft(x) \
-       do { ssir |= (x); _setsoftintr(MIPS_SOFT_INT_MASK_1); } while (0)
+#define        softintr_schedule(arg)                                          \
+do {                                                                   \
+       struct pmax_soft_intrhand *__sih = (arg);                       \
+       struct pmax_soft_intr *__si = __sih->sih_intrhead;              \
+       int __s;                                                        \
+                                                                       \
+       __s = splhigh();                                                \
+       simple_lock(&__si->softintr_slock);                             \
+       if (__sih->sih_pending == 0) {                                  \
+               TAILQ_INSERT_TAIL(&__si->softintr_q, __sih, sih_q);     \
+               __sih->sih_pending = 1;                                 \
+               setsoft(__si->softintr_ipl);                            \
+       }                                                               \
+       simple_unlock(&__si->softintr_slock);                           \
+       splx(__s);                                                      \
+} while (0)
 
-#define setsoftclock() _setsoftintr(MIPS_SOFT_INT_MASK_0)
+extern struct pmax_soft_intrhand *softnet_intrhand;
+
+#define        setsoftnet()    softintr_schedule(softnet_intrhand)
+
+extern struct evcnt pmax_clock_evcnt;
+extern struct evcnt pmax_fpu_evcnt;
 
 #endif /* !_LOCORE */
 #endif /* _KERNEL */
diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/include/types.h
--- a/sys/arch/pmax/include/types.h     Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/include/types.h     Wed Aug 22 06:59:38 2001 +0000
@@ -1,5 +1,6 @@
-/*     $NetBSD: types.h,v 1.17 2000/12/03 23:00:42 simonb Exp $        */
+/*     $NetBSD: types.h,v 1.18 2001/08/22 06:59:45 nisimura Exp $      */
 
 #include <mips/types.h>
 
 #define __HAVE_DEVICE_REGISTER
+#define __HAVE_GENERIC_SOFT_INTERRUPTS
diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/pmax/autoconf.c
--- a/sys/arch/pmax/pmax/autoconf.c     Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/pmax/autoconf.c     Wed Aug 22 06:59:38 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.58 2001/04/25 17:53:21 bouyer Exp $     */
+/*     $NetBSD: autoconf.c,v 1.59 2001/08/22 06:59:38 nisimura Exp $   */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.58 2001/04/25 17:53:21 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.59 2001/08/22 06:59:38 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,6 +86,11 @@
 {
        /* Kick off autoconfiguration. */
        (void)splhigh();
+
+       softintr_init();
+       evcnt_attach_static(&pmax_clock_evcnt);
+       evcnt_attach_static(&pmax_fpu_evcnt);
+
        if (config_rootfound("mainbus", "mainbus") == NULL)
                panic("no mainbus found");
 
diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/pmax/dec_3100.c
--- a/sys/arch/pmax/pmax/dec_3100.c     Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/pmax/dec_3100.c     Wed Aug 22 06:59:38 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3100.c,v 1.32 2001/04/12 19:24:05 thorpej Exp $ */
+/* $NetBSD: dec_3100.c,v 1.33 2001/08/22 06:59:39 nisimura Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -195,7 +195,7 @@
                cf.pc = pc;
                cf.sr = status;
                hardclock(&cf);
-               intrcnt[HARDCLOCK]++;
+               pmax_clock_evcnt.ev_count++;
 
                /* keep clock interrupts enabled when we return */
                cause &= ~MIPS_INT_MASK_3;
diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/pmax/dec_3max.c
--- a/sys/arch/pmax/pmax/dec_3max.c     Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/pmax/dec_3max.c     Wed Aug 22 06:59:38 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3max.c,v 1.32 2001/04/12 19:24:05 thorpej Exp $ */
+/* $NetBSD: dec_3max.c,v 1.33 2001/08/22 06:59:39 nisimura Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -73,7 +73,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_3max.c,v 1.32 2001/04/12 19:24:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3max.c,v 1.33 2001/08/22 06:59:39 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -265,7 +265,7 @@
                cf.pc = pc;
                cf.sr = status;
                hardclock(&cf);
-               intrcnt[HARDCLOCK]++;
+               pmax_clock_evcnt.ev_count++;
 
                /* keep clock interrupts enabled when we return */
                cause &= ~MIPS_INT_MASK_1;
diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/pmax/dec_3maxplus.c
--- a/sys/arch/pmax/pmax/dec_3maxplus.c Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/pmax/dec_3maxplus.c Wed Aug 22 06:59:38 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3maxplus.c,v 1.43 2001/04/12 19:24:05 thorpej Exp $ */
+/* $NetBSD: dec_3maxplus.c,v 1.44 2001/08/22 06:59:40 nisimura Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -73,7 +73,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_3maxplus.c,v 1.43 2001/04/12 19:24:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3maxplus.c,v 1.44 2001/08/22 06:59:40 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -303,7 +303,7 @@
                cf.pc = pc;
                cf.sr = status;
                hardclock(&cf);
-               intrcnt[HARDCLOCK]++;
+               pmax_clock_evcnt.ev_count++;
                old_buscycle = latched_cycle_cnt - old_buscycle;
                /* keep clock interrupts enabled when we return */
                cause &= ~MIPS_INT_MASK_1;
diff -r ae4d869f9790 -r 81512af77974 sys/arch/pmax/pmax/dec_3min.c
--- a/sys/arch/pmax/pmax/dec_3min.c     Wed Aug 22 05:24:37 2001 +0000
+++ b/sys/arch/pmax/pmax/dec_3min.c     Wed Aug 22 06:59:38 2001 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index