Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Allow algor kernels to be built under either algor/...



details:   https://anonhg.NetBSD.org/src/rev/86892cd613a5
branches:  trunk
changeset: 767132:86892cd613a5
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Jul 09 16:03:00 2011 +0000

description:
Allow algor kernels to be built under either algor/algor64 or
evbmips-el/evbmips64-el.  Note that MAXMAPARITITONS and majors numbers
differ between the two ports which is why two kernels are still needed.

diffstat:

 sys/arch/algor/algor/algor_intr.c            |  149 +++++++++++++++++
 sys/arch/algor/algor/algor_p4032_bus_io.c    |    6 +-
 sys/arch/algor/algor/algor_p4032_bus_locio.c |    6 +-
 sys/arch/algor/algor/algor_p4032_intr.c      |   26 +-
 sys/arch/algor/algor/algor_p5064_bus_io.c    |    6 +-
 sys/arch/algor/algor/algor_p5064_bus_mem.c   |    6 +-
 sys/arch/algor/algor/algor_p5064_intr.c      |   30 +-
 sys/arch/algor/algor/algor_p6032_bus_io.c    |    6 +-
 sys/arch/algor/algor/algor_p6032_bus_mem.c   |    6 +-
 sys/arch/algor/algor/algor_p6032_intr.c      |   26 +-
 sys/arch/algor/algor/autoconf.c              |   14 +-
 sys/arch/algor/algor/disksubr.c              |  231 ---------------------------
 sys/arch/algor/algor/interrupt.c             |  127 --------------
 sys/arch/algor/algor/led.c                   |    6 +-
 sys/arch/algor/algor/machdep.c               |   28 +-
 sys/arch/algor/conf/files.algor              |   18 +-
 sys/arch/algor/conf/std.algor                |    9 +-
 sys/arch/algor/dev/bonito_mainbus.c          |   12 +-
 sys/arch/algor/dev/com_mainbus.c             |   30 +-
 sys/arch/algor/dev/lpt_mainbus.c             |   22 +-
 sys/arch/algor/dev/mainbus.c                 |   14 +-
 sys/arch/algor/dev/mcclock_mainbus.c         |   11 +-
 sys/arch/algor/dev/vtpbc_mainbus.c           |   12 +-
 sys/arch/algor/include/autoconf.h            |    7 +-
 sys/arch/algor/include/intr.h                |    7 +-
 sys/arch/algor/pci/pcib.c                    |   64 +++---
 sys/arch/algor/pci/pciide_machdep.c          |   65 -------
 sys/arch/evbmips/conf/P4032                  |    4 +
 sys/arch/evbmips/conf/P5064                  |    4 +
 sys/arch/evbmips/conf/P5064-64               |    4 +
 sys/arch/evbmips/conf/P6032                  |    4 +
 sys/arch/evbmips/conf/files.algor            |    3 +
 sys/arch/evbmips/conf/files.malta            |    4 +-
 sys/arch/evbmips/conf/std.algor              |   16 +
 sys/arch/evbmips/include/intr.h              |    3 +-
 sys/arch/evbmips/include/pmon.h              |   40 ++++
 sys/arch/evbmips/include/vmparam.h           |    9 +-
 sys/arch/evbmips/malta/pci/pciide_machdep.c  |   65 -------
 38 files changed, 423 insertions(+), 677 deletions(-)

diffs (truncated from 1928 to 300 lines):

diff -r 77676b0b0560 -r 86892cd613a5 sys/arch/algor/algor/algor_intr.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/algor/algor/algor_intr.c Sat Jul 09 16:03:00 2011 +0000
@@ -0,0 +1,149 @@
+/*     $NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $      */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $");
+
+#define        __INTR_PRIVATE
+#include "opt_algor_p4032.h"
+#include "opt_algor_p5064.h" 
+#include "opt_algor_p6032.h"
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/intr.h>
+#include <sys/cpu.h>
+
+#include <algor/autoconf.h>
+#include <mips/locore.h>
+#include <mips/mips3_clock.h>
+
+#ifdef ALGOR_P4032
+#include <algor/algor/algor_p4032var.h>
+#endif
+
+#ifdef ALGOR_P5064
+#include <algor/algor/algor_p5064var.h>
+#endif  
+ 
+#ifdef ALGOR_P6032
+#include <algor/algor/algor_p6032var.h>
+#endif
+
+void   *(*algor_intr_establish)(int, int (*)(void *), void *);
+void   (*algor_intr_disestablish)(void *);
+
+void   (*algor_iointr)(int, vaddr_t, uint32_t);
+
+/*
+ * This is a mask of bits to clear in the SR when we go to a
+ * given interrupt priority level.
+ */
+static const struct ipl_sr_map algor_ipl_sr_map = {
+    .sr_bits = {
+       [IPL_NONE]      =       0,
+       [IPL_SOFTCLOCK] =       MIPS_SOFT_INT_MASK_0,
+       [IPL_SOFTBIO]   =       MIPS_SOFT_INT_MASK_0,
+       [IPL_SOFTNET]   =       MIPS_SOFT_INT_MASK,
+       [IPL_SOFTSERIAL] =      MIPS_SOFT_INT_MASK,
+       [IPL_VM]        =       MIPS_SOFT_INT_MASK
+                               |MIPS_INT_MASK_0|MIPS_INT_MASK_1
+                               |MIPS_INT_MASK_2|MIPS_INT_MASK_3,
+       [IPL_SCHED]     =       MIPS_INT_MASK,
+       [IPL_HIGH]      =       MIPS_INT_MASK,
+    },
+};
+
+void
+#ifdef evbmips
+evbmips_intr_init(void)
+#else
+intr_init(void)
+#endif
+{
+       ipl_sr_map = algor_ipl_sr_map;
+
+#if defined(ALGOR_P4032)
+       algor_p4032_intr_init(&p4032_configuration);
+#elif defined(ALGOR_P5064)
+       algor_p5064_intr_init(&p5064_configuration);
+#elif defined(ALGOR_P6032)
+       algor_p6032_intr_init(&p6032_configuration);
+#endif
+}
+
+#ifdef evbmips
+void
+evbmips_iointr(int ipl, vaddr_t pc, uint32_t pending)
+{
+       (*algor_iointr)(ipl, pc, pending);
+}
+
+void *
+evbmips_intr_establish(int irq, int (*func)(void *), void *arg)
+{
+       return (*algor_intr_establish)(irq, func, arg);
+}
+
+void
+evbmips_intr_disestablish(void *cookie)
+{
+       (*algor_intr_disestablish)(cookie);
+}
+#else
+void
+cpu_intr(int ppl, vaddr_t pc, uint32_t status)
+{
+       uint32_t pending;
+       int ipl;
+
+       curcpu()->ci_data.cpu_nintr++;
+
+       while (ppl < (ipl = splintr(&pending))) {
+               splx(ipl);
+               if (pending & MIPS_INT_MASK_5) {
+                       struct clockframe cf;
+
+                       cf.pc = pc;
+                       cf.sr = status;
+                       cf.intr = (curcpu()->ci_idepth > 1);
+                       mips3_clockintr(&cf);
+               }
+
+               if (pending & (MIPS_INT_MASK_0|MIPS_INT_MASK_1|MIPS_INT_MASK_2|
+                               MIPS_INT_MASK_3|MIPS_INT_MASK_4)) {
+                       /* Process I/O and error interrupts. */
+                       (*algor_iointr)(ipl, pc, pending);
+               }
+               (void)splhigh();
+       }
+}
+#endif
diff -r 77676b0b0560 -r 86892cd613a5 sys/arch/algor/algor/algor_p4032_bus_io.c
--- a/sys/arch/algor/algor/algor_p4032_bus_io.c Sat Jul 09 16:01:31 2011 +0000
+++ b/sys/arch/algor/algor/algor_p4032_bus_io.c Sat Jul 09 16:03:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: algor_p4032_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $      */
+/*     $NetBSD: algor_p4032_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -44,7 +44,7 @@
 
 #include <uvm/uvm_extern.h>
 
-#include <machine/locore.h>
+#include <mips/locore.h>
 
 #include <algor/algor/algor_p4032reg.h>
 #include <algor/algor/algor_p4032var.h>
diff -r 77676b0b0560 -r 86892cd613a5 sys/arch/algor/algor/algor_p4032_bus_locio.c
--- a/sys/arch/algor/algor/algor_p4032_bus_locio.c      Sat Jul 09 16:01:31 2011 +0000
+++ b/sys/arch/algor/algor/algor_p4032_bus_locio.c      Sat Jul 09 16:03:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: algor_p4032_bus_locio.c,v 1.5 2011/07/08 18:48:55 matt Exp $   */
+/*     $NetBSD: algor_p4032_bus_locio.c,v 1.6 2011/07/09 16:03:00 matt Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_locio.c,v 1.5 2011/07/08 18:48:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_locio.c,v 1.6 2011/07/09 16:03:00 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -44,7 +44,7 @@
 
 #include <uvm/uvm_extern.h>
 
-#include <machine/locore.h>
+#include <mips/locore.h>
 
 #include <algor/algor/algor_p4032reg.h>
 #include <algor/algor/algor_p4032var.h>
diff -r 77676b0b0560 -r 86892cd613a5 sys/arch/algor/algor/algor_p4032_intr.c
--- a/sys/arch/algor/algor/algor_p4032_intr.c   Sat Jul 09 16:01:31 2011 +0000
+++ b/sys/arch/algor/algor/algor_p4032_intr.c   Sat Jul 09 16:03:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: algor_p4032_intr.c,v 1.23 2011/07/01 18:30:36 dyoung Exp $     */
+/*     $NetBSD: algor_p4032_intr.c,v 1.24 2011/07/09 16:03:00 matt Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,22 +38,22 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: algor_p4032_intr.c,v 1.23 2011/07/01 18:30:36 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: algor_p4032_intr.c,v 1.24 2011/07/09 16:03:00 matt Exp $");
 
 #include "opt_ddb.h"
 #define        __INTR_PRIVATE
 
 #include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
 #include <sys/device.h>
+#include <sys/intr.h>
 #include <sys/kernel.h>
-#include <sys/cpu.h>
+#include <sys/malloc.h>
+#include <sys/queue.h>
+#include <sys/systm.h>
 
-#include <sys/bus.h>
-#include <machine/autoconf.h>
-#include <machine/intr.h>
+#include <algor/autoconf.h>
 
 #include <mips/locore.h>
 
@@ -201,7 +201,7 @@
 
 
 struct p4032_cpuintr {
-       LIST_HEAD(, algor_intrhand) cintr_list;
+       LIST_HEAD(, evbmips_intrhand) cintr_list;
        struct evcnt cintr_count;
 };
 
@@ -345,7 +345,7 @@
 algor_p4032_intr_establish(int irq, int (*func)(void *), void *arg)
 {
        const struct p4032_irqmap *irqmap;
-       struct algor_intrhand *ih;
+       struct evbmips_intrhand *ih;
        int s;
 
        irqmap = &p4032_irqmap[irq];
@@ -387,7 +387,7 @@
 algor_p4032_intr_disestablish(void *cookie)
 {
        const struct p4032_irqmap *irqmap;
-       struct algor_intrhand *ih = cookie;
+       struct evbmips_intrhand *ih = cookie;
        int s;
 
        irqmap = ih->ih_irqmap;
@@ -418,7 +418,7 @@
 algor_p4032_iointr(int ipl, vaddr_t pc, u_int32_t ipending)
 {
        const struct p4032_irqmap *irqmap;
-       struct algor_intrhand *ih;
+       struct evbmips_intrhand *ih;
        int level, i;
        u_int32_t irr[NIRQREG];
 
diff -r 77676b0b0560 -r 86892cd613a5 sys/arch/algor/algor/algor_p5064_bus_io.c
--- a/sys/arch/algor/algor/algor_p5064_bus_io.c Sat Jul 09 16:01:31 2011 +0000
+++ b/sys/arch/algor/algor/algor_p5064_bus_io.c Sat Jul 09 16:03:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: algor_p5064_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $      */
+/*     $NetBSD: algor_p5064_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $");
 
 #include <sys/param.h>



Home | Main Index | Thread Index | Old Index