Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Merge forward matt-nb5-mips64



details:   https://anonhg.NetBSD.org/src/rev/1f8525e8310a
branches:  trunk
changeset: 762369:1f8525e8310a
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Feb 20 07:55:20 2011 +0000

description:
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework

diffstat:

 sys/arch/ews4800mips/conf/files.ews4800mips  |    3 +-
 sys/arch/ews4800mips/ews4800mips/autoconf.c  |    7 +-
 sys/arch/ews4800mips/ews4800mips/bus_dma.c   |   27 +-
 sys/arch/ews4800mips/ews4800mips/cpu.c       |   16 +-
 sys/arch/ews4800mips/ews4800mips/interrupt.c |   26 +--
 sys/arch/ews4800mips/ews4800mips/machdep.c   |   15 +-
 sys/arch/ews4800mips/ews4800mips/mainbus.c   |    6 +-
 sys/arch/ews4800mips/ews4800mips/tr2.c       |   11 +-
 sys/arch/ews4800mips/ews4800mips/tr2_intr.c  |  217 +++++++++++-----------
 sys/arch/ews4800mips/ews4800mips/tr2a.c      |   11 +-
 sys/arch/ews4800mips/ews4800mips/tr2a_intr.c |  248 ++++++++++++--------------
 sys/arch/ews4800mips/include/intr.h          |   61 +-----
 sys/arch/ews4800mips/include/sbdvar.h        |    9 +-
 sys/arch/mipsco/include/intr.h               |   81 +-------
 sys/arch/mipsco/include/sysconf.h            |    4 +-
 sys/arch/mipsco/mipsco/autoconf.c            |    5 +-
 sys/arch/mipsco/mipsco/bus_dma.c             |   10 +-
 sys/arch/mipsco/mipsco/cpu.c                 |   26 +-
 sys/arch/mipsco/mipsco/interrupt.c           |   42 +--
 sys/arch/mipsco/mipsco/machdep.c             |   41 +--
 sys/arch/mipsco/mipsco/mainbus.c             |   32 +--
 sys/arch/mipsco/mipsco/mips_3x30.c           |   57 ++---
 sys/arch/newsmips/apbus/apbus.c              |   15 +-
 sys/arch/newsmips/apbus/if_snvar.h           |   10 +-
 sys/arch/newsmips/apbus/if_tlp_ap.c          |   12 +-
 sys/arch/newsmips/conf/files.newsmips        |    4 +-
 sys/arch/newsmips/dev/hb.c                   |    7 +-
 sys/arch/newsmips/dev/scsi_1185.c            |    6 +-
 sys/arch/newsmips/include/intr.h             |   61 +-----
 sys/arch/newsmips/newsmips/autoconf.c        |   13 +-
 sys/arch/newsmips/newsmips/bus.c             |   13 +-
 sys/arch/newsmips/newsmips/clock.c           |   10 +-
 sys/arch/newsmips/newsmips/cpu.c             |   24 +-
 sys/arch/newsmips/newsmips/locore_machdep.S  |   12 +-
 sys/arch/newsmips/newsmips/machdep.c         |   78 +++-----
 sys/arch/newsmips/newsmips/news3400.c        |  116 +++++------
 sys/arch/newsmips/newsmips/news5000.c        |  165 ++++++++---------
 37 files changed, 629 insertions(+), 872 deletions(-)

diffs (truncated from 2785 to 300 lines):

diff -r 0c09404e73b0 -r 1f8525e8310a sys/arch/ews4800mips/conf/files.ews4800mips
--- a/sys/arch/ews4800mips/conf/files.ews4800mips       Sun Feb 20 07:54:10 2011 +0000
+++ b/sys/arch/ews4800mips/conf/files.ews4800mips       Sun Feb 20 07:55:20 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.ews4800mips,v 1.4 2009/08/21 03:53:18 thorpej Exp $
+#      $NetBSD: files.ews4800mips,v 1.5 2011/02/20 07:55:20 matt Exp $
 
 maxpartitions 16
 
@@ -6,7 +6,6 @@
 
 include "arch/ews4800mips/conf/majors.ews4800mips"
 
-file arch/mips/mips/softintr.c
 file arch/mips/mips/mips3_clock.c
 
 file arch/ews4800mips/ews4800mips/autoconf.c
diff -r 0c09404e73b0 -r 1f8525e8310a sys/arch/ews4800mips/ews4800mips/autoconf.c
--- a/sys/arch/ews4800mips/ews4800mips/autoconf.c       Sun Feb 20 07:54:10 2011 +0000
+++ b/sys/arch/ews4800mips/ews4800mips/autoconf.c       Sun Feb 20 07:55:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.7 2008/04/28 20:23:18 martin Exp $      */
+/*     $NetBSD: autoconf.c,v 1.8 2011/02/20 07:55:20 matt Exp $        */
 
 /*-
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.7 2008/04/28 20:23:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.8 2011/02/20 07:55:20 matt Exp $");
 
 #include "opt_sbd.h"
 
@@ -35,6 +35,7 @@
 #include <sys/systm.h>
 #include <sys/conf.h>
 #include <sys/device.h>
+#include <sys/intr.h>
 
 #include <machine/sbdvar.h>
 #include <machine/disklabel.h>
@@ -50,7 +51,7 @@
        splhigh();
        if (config_rootfound("mainbus", NULL) == NULL)
                panic("no mainbus found");
-       _splnone();
+       spl0();
 }
 
 void
diff -r 0c09404e73b0 -r 1f8525e8310a sys/arch/ews4800mips/ews4800mips/bus_dma.c
--- a/sys/arch/ews4800mips/ews4800mips/bus_dma.c        Sun Feb 20 07:54:10 2011 +0000
+++ b/sys/arch/ews4800mips/ews4800mips/bus_dma.c        Sun Feb 20 07:55:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.10 2009/08/21 03:53:18 thorpej Exp $     */
+/*     $NetBSD: bus_dma.c,v 1.11 2011/02/20 07:55:20 matt Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.10 2009/08/21 03:53:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.11 2011/02/20 07:55:20 matt Exp $");
 
 /* #define     BUS_DMA_DEBUG */
 #include <sys/param.h>
@@ -502,22 +502,24 @@
                        mips_dcache_wbinv_range(start, minlen);
                        break;
 
-               case BUS_DMASYNC_PREREAD:
+               case BUS_DMASYNC_PREREAD: {
+                       const struct mips_cache_info * const mci = &mips_cache_info;
                        end = start + minlen;
-                       preboundary = start & ~mips_dcache_align_mask;
-                       firstboundary = (start + mips_dcache_align_mask)
-                           & ~mips_dcache_align_mask;
-                       lastboundary = end & ~mips_dcache_align_mask;
+                       preboundary = start & ~mci->mci_dcache_align_mask;
+                       firstboundary = (start + mci->mci_dcache_align_mask)
+                           & ~mci->mci_dcache_align_mask;
+                       lastboundary = end & ~mci->mci_dcache_align_mask;
                        if (preboundary < start && preboundary < lastboundary)
                                mips_dcache_wbinv_range(preboundary,
-                                   mips_dcache_align);
+                                   mci->mci_dcache_align);
                        if (firstboundary < lastboundary)
                                mips_dcache_inv_range(firstboundary,
                                    lastboundary - firstboundary);
                        if (lastboundary < end)
                                mips_dcache_wbinv_range(lastboundary,
-                                   mips_dcache_align);
+                                   mci->mci_dcache_align);
                        break;
+               }
 
                case BUS_DMASYNC_PREWRITE:
                        mips_dcache_wb_range(start, minlen);
@@ -540,12 +542,11 @@
     bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs,
     int flags)
 {
-       extern paddr_t avail_start, avail_end;
+       extern paddr_t mips_avail_start, mips_avail_end;
 
        return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
-                                              segs, nsegs, rsegs, flags,
-                                              avail_start /*low*/,
-                                              avail_end - PAGE_SIZE /*high*/));
+           segs, nsegs, rsegs, flags,
+           mips_avail_start /*low*/, mips_avail_end - PAGE_SIZE /*high*/));
 }
 
 /*
diff -r 0c09404e73b0 -r 1f8525e8310a sys/arch/ews4800mips/ews4800mips/cpu.c
--- a/sys/arch/ews4800mips/ews4800mips/cpu.c    Sun Feb 20 07:54:10 2011 +0000
+++ b/sys/arch/ews4800mips/ews4800mips/cpu.c    Sun Feb 20 07:55:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.3 2008/04/04 16:33:05 tsutsui Exp $  */
+/*     $NetBSD: cpu.c,v 1.4 2011/02/20 07:55:20 matt Exp $     */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,18 +26,19 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.3 2008/04/04 16:33:05 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.4 2011/02/20 07:55:20 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
+#include <sys/cpu.h>
 
 #include <machine/autoconf.h>
 
 #include "ioconf.h"
 
-int cpumatch(device_t, cfdata_t, void *);
-void cpuattach(device_t, device_t, void *);
+static int cpumatch(device_t, cfdata_t, void *);
+static void cpuattach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(cpu, 0,
     cpumatch, cpuattach, NULL, NULL);
@@ -60,8 +61,13 @@
 cpuattach(device_t parent, device_t self, void *aux)
 {
 
+       struct cpu_info * const ci = curcpu();
+
+       ci->ci_dev = self;
+       self->dv_private = ci;
+
        aprint_normal(": ");
        cpu_attached = 1;
 
-       cpu_identify();
+       cpu_identify(self);
 }
diff -r 0c09404e73b0 -r 1f8525e8310a sys/arch/ews4800mips/ews4800mips/interrupt.c
--- a/sys/arch/ews4800mips/ews4800mips/interrupt.c      Sun Feb 20 07:54:10 2011 +0000
+++ b/sys/arch/ews4800mips/ews4800mips/interrupt.c      Sun Feb 20 07:55:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interrupt.c,v 1.7 2010/12/20 00:25:33 matt Exp $       */
+/*     $NetBSD: interrupt.c,v 1.8 2011/02/20 07:55:20 matt Exp $       */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.7 2010/12/20 00:25:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.8 2011/02/20 07:55:20 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/intr.h>
@@ -38,8 +38,7 @@
 
 #include <machine/sbdvar.h>
 
-const uint32_t *ipl_sr_bits;
-static void (*platform_intr)(uint32_t, uint32_t, vaddr_t, uint32_t);
+static void (*platform_intr)(int, vaddr_t, uint32_t);
 
 void
 intr_init(void)
@@ -64,22 +63,9 @@
 }
 
 void
-cpu_intr(uint32_t status, uint32_t cause, vaddr_t pc, uint32_t ipending)
+cpu_intr(int ppl, vaddr_t pc, uint32_t status)
 {
-       struct cpu_info *ci;
-
-       ci = curcpu();
-       ci->ci_data.cpu_nintr++;
+       curcpu()->ci_data.cpu_nintr++;
 
-       ci->ci_idepth++;
-       (*platform_intr)(status, cause, pc, ipending);
-       ci->ci_idepth--;
-
-#ifdef __HAVE_FAST_SOFTINTS
-       ipending &= (MIPS_SOFT_INT_MASK_1 | MIPS_SOFT_INT_MASK_0);
-       if (ipending == 0)
-               return;
-       _clrsoftintr(ipending);
-       softintr_dispatch(ipending);
-#endif
+       (*platform_intr)(ppl, pc, status);
 }
diff -r 0c09404e73b0 -r 1f8525e8310a sys/arch/ews4800mips/ews4800mips/machdep.c
--- a/sys/arch/ews4800mips/ews4800mips/machdep.c        Sun Feb 20 07:54:10 2011 +0000
+++ b/sys/arch/ews4800mips/ews4800mips/machdep.c        Sun Feb 20 07:55:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.23 2010/05/04 15:32:31 tsutsui Exp $     */
+/*     $NetBSD: machdep.c,v 1.24 2011/02/20 07:55:20 matt Exp $        */
 
 /*-
  * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.23 2010/05/04 15:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.24 2011/02/20 07:55:20 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -88,7 +88,7 @@
 mach_init(int argc, char *argv[], struct bootinfo *bi)
 {
        extern char kernel_text[], edata[], end[];
-       vaddr_t v;
+       void *v;
        int i;
 
        /* Clear BSS */
@@ -115,7 +115,7 @@
        sbd_init();
 
        __asm volatile("move %0, $29" : "=r"(v));
-       printf("kernel_text=%p edata=%p end=%p sp=%" PRIxVADDR "\n",
+       printf("kernel_text=%p edata=%p end=%p sp=%p\n",
            kernel_text, edata, end, v);
 
        option(argc, argv, bi);
@@ -133,7 +133,7 @@
         */
        cn_tab = NULL;
 
-       mips_vector_init();
+       mips_vector_init(NULL, false);
 
        memcpy((void *)0x80000200, ews4800mips_nmi_vec, 32); /* NMI */
        mips_dcache_wbinv_all();
@@ -143,7 +143,7 @@
        curcpu()->ci_cycles_per_hz = (curcpu()->ci_cpu_freq + hz / 2) / hz;
        curcpu()->ci_divisor_delay =
            ((curcpu()->ci_cpu_freq + 500000) / 1000000);
-       if (mips_cpu_flags & CPU_MIPS_DOUBLE_COUNT) {
+       if (mips_options.mips_cpu_flags & CPU_MIPS_DOUBLE_COUNT) {
                curcpu()->ci_cycles_per_hz /= 2;
                curcpu()->ci_divisor_delay /= 2;
        }
@@ -254,8 +254,7 @@
        static int waittime = -1;
 
        /* Take a snapshot before clobbering any registers. */
-       if (curlwp)
-               savectx(curpcb);
+       savectx(curpcb);
 
        if (cold) {
                howto |= RB_HALT;
diff -r 0c09404e73b0 -r 1f8525e8310a sys/arch/ews4800mips/ews4800mips/mainbus.c
--- a/sys/arch/ews4800mips/ews4800mips/mainbus.c        Sun Feb 20 07:54:10 2011 +0000
+++ b/sys/arch/ews4800mips/ews4800mips/mainbus.c        Sun Feb 20 07:55:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.4 2008/04/28 20:23:18 martin Exp $       */
+/*     $NetBSD: mainbus.c,v 1.5 2011/02/20 07:55:20 matt Exp $ */
 
 /*-
  * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2008/04/28 20:23:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.5 2011/02/20 07:55:20 matt Exp $");
 
 #include <sys/param.h>



Home | Main Index | Thread Index | Old Index