Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/e23472eb800e
branches:  trunk
changeset: 762370:e23472eb800e
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Feb 20 07:58:13 2011 +0000

description:
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
(XXX don't know how to deal with use of spllower in sleep/pause code so
hpcmips kernel will fail to compile).

diffstat:

 sys/arch/hpcmips/conf/std.hpcmips         |   4 +-
 sys/arch/hpcmips/conf/std.lcard           |   4 +-
 sys/arch/hpcmips/hpcmips/autoconf.c       |   6 +-
 sys/arch/hpcmips/hpcmips/bus_dma.c        |  14 +--
 sys/arch/hpcmips/hpcmips/bus_space.c      |   6 +-
 sys/arch/hpcmips/hpcmips/cpu.c            |  23 ++++--
 sys/arch/hpcmips/hpcmips/hpcapm_machdep.c |  56 ++++++++--------
 sys/arch/hpcmips/hpcmips/interrupt.c      |  18 ++---
 sys/arch/hpcmips/hpcmips/machdep.c        |  35 +---------
 sys/arch/hpcmips/hpcmips/mainbus.c        |  22 +++---
 sys/arch/hpcmips/include/intr.h           |  57 +----------------
 sys/arch/hpcmips/include/sysconf.h        |   4 +-
 sys/arch/hpcmips/tx/tx39.c                |  18 ++--
 sys/arch/hpcmips/tx/tx39icu.c             |  12 ++-
 sys/arch/hpcmips/vr/vr.c                  |  98 ++++++++++++------------------
 sys/arch/hpcmips/vr/vrdcu.c               |   9 +-
 16 files changed, 148 insertions(+), 238 deletions(-)

diffs (truncated from 880 to 300 lines):

diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/conf/std.hpcmips
--- a/sys/arch/hpcmips/conf/std.hpcmips Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/conf/std.hpcmips Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.hpcmips,v 1.19 2005/12/11 12:17:33 christos Exp $
+#      $NetBSD: std.hpcmips,v 1.20 2011/02/20 07:58:13 matt Exp $
 # standard, required hpcmips info
 
 machine hpcmips mips
@@ -6,7 +6,7 @@
 makeoptions    MACHINE_ARCH="mipsel"
 
 options        NOFPU                   # No FPU
-options        SOFTFLOAT               # emulate FPU insn
+options        FPEMUL                  # emulate FPU insn
 
 mainbus0 at root
 cpu* at mainbus0
diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/conf/std.lcard
--- a/sys/arch/hpcmips/conf/std.lcard   Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/conf/std.lcard   Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.lcard,v 1.7 2006/09/16 02:14:56 gdamore Exp $
+#      $NetBSD: std.lcard,v 1.8 2011/02/20 07:58:13 matt Exp $
 # standard, required hpcmips info
 
 machine hpcmips mips
@@ -6,7 +6,7 @@
 makeoptions    MACHINE_ARCH="mipsel"
 
 options        NOFPU                   # No FPU
-options        SOFTFLOAT               # emulate FPU insn
+options        FPEMUL                  # emulate FPU insn
 
 options        MIPS3                   # R4000/R4400/R4600 CPUs
 options        MIPS3_4100              # VR4100 core
diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/hpcmips/autoconf.c
--- a/sys/arch/hpcmips/hpcmips/autoconf.c       Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/hpcmips/autoconf.c       Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.23 2011/02/08 20:20:14 rmind Exp $      */
+/*     $NetBSD: autoconf.c,v 1.24 2011/02/20 07:58:13 matt Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.23 2011/02/08 20:20:14 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2011/02/20 07:58:13 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -76,7 +76,7 @@
                panic("no mainbus found");
 
        /* Configuration is finished, turn on interrupts. */
-       _splnone();     /* enable all source forcing SOFT_INTs cleared */
+       spl0();         /* enable all source forcing SOFT_INTs cleared */
 }
 
 void
diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/hpcmips/bus_dma.c
--- a/sys/arch/hpcmips/hpcmips/bus_dma.c        Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/hpcmips/bus_dma.c        Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.35 2009/12/14 00:46:03 matt Exp $        */
+/*     $NetBSD: bus_dma.c,v 1.36 2011/02/20 07:58:13 matt Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.35 2009/12/14 00:46:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.36 2011/02/20 07:58:13 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -516,13 +516,12 @@
     bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs,
     int flags)
 {
-       extern paddr_t avail_start, avail_end;          /* XXX */
        psize_t high;
 
-       high = avail_end - PAGE_SIZE;
+       high = mips_avail_end - PAGE_SIZE;
 
        return (_hpcmips_bd_mem_alloc_range(t, size, alignment, boundary,
-           segs, nsegs, rsegs, flags, avail_start, high));
+           segs, nsegs, rsegs, flags, mips_avail_start, high));
 }
 
 /*
@@ -536,10 +535,9 @@
     int flags, paddr_t low, paddr_t high)
 {
 #ifdef DIAGNOSTIC
-       extern paddr_t avail_start, avail_end;          /* XXX */
 
-       high = high<(avail_end - PAGE_SIZE)? high: (avail_end - PAGE_SIZE);
-       low = low>avail_start? low: avail_start;
+       high = high<(mips_avail_end - PAGE_SIZE)? high: (mips_avail_end - PAGE_SIZE);
+       low = low>mips_avail_start? low: mips_avail_start;
 #endif
 
        return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/hpcmips/bus_space.c
--- a/sys/arch/hpcmips/hpcmips/bus_space.c      Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/hpcmips/bus_space.c      Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_space.c,v 1.28 2009/11/07 07:27:43 cegger Exp $    */
+/*     $NetBSD: bus_space.c,v 1.29 2011/02/20 07:58:14 matt Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.28 2009/11/07 07:27:43 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.29 2011/02/20 07:58:14 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -250,7 +250,7 @@
                        /*
                         * Update the same virtual address entry.
                         */
-                       MachTLBUpdate(va, opte);
+                       tlb_update(va, opte);
                }
                return (bpa);
        }
diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/hpcmips/cpu.c
--- a/sys/arch/hpcmips/hpcmips/cpu.c    Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/hpcmips/cpu.c    Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.16 2009/12/14 00:46:04 matt Exp $    */
+/*     $NetBSD: cpu.c,v 1.17 2011/02/20 07:58:14 matt Exp $    */
 /*-
  * Copyright (c) 1999 Shin Takemura, All rights reserved.
  * Copyright (c) 1999-2001 SATO Kazumi, All rights reserved.
@@ -56,27 +56,28 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.16 2009/12/14 00:46:04 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.17 2011/02/20 07:58:14 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
+#include <sys/cpu.h>
 #include <sys/bus.h>
 
 #include <machine/sysconf.h>
 #include <machine/autoconf.h>
 
 /* Definition of the driver for autoconfig. */
-static int     cpumatch(struct device *, struct cfdata *, void *);
-static void    cpuattach(struct device *, struct device *, void *);
+static int     cpumatch(device_t, cfdata_t, void *);
+static void    cpuattach(device_t, device_t, void *);
 
-CFATTACH_DECL(cpu, sizeof (struct device),
+CFATTACH_DECL_NEW(cpu, 0,
     cpumatch, cpuattach, NULL, NULL);
 
 extern struct cfdriver cpu_cd;
 
 static int
-cpumatch(struct device *parent, struct cfdata *cf, void *aux)
+cpumatch(device_t parent, cfdata_t cf, void *aux)
 {
        struct mainbus_attach_args *ma = aux;
 
@@ -85,12 +86,16 @@
 }
 
 static void
-cpuattach(struct device *parent, struct device *dev, void *aux)
+cpuattach(device_t parent, device_t self, void *aux)
 {
+       struct cpu_info * const ci = curcpu();
 
-       printf(": ");
+       ci->ci_dev = self;
+       self->dv_private = ci;
 
-       cpu_identify();
+       aprint_normal(": ");
+
+       cpu_identify(self);
 
        /* install CPU specific idle routine if any. */
        if (platform.cpu_idle != NULL)
diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/hpcmips/hpcapm_machdep.c
--- a/sys/arch/hpcmips/hpcmips/hpcapm_machdep.c Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/hpcmips/hpcapm_machdep.c Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpcapm_machdep.c,v 1.3 2009/03/18 10:22:29 cegger Exp $        */
+/*     $NetBSD: hpcapm_machdep.c,v 1.4 2011/02/20 07:58:14 matt Exp $  */
 
 /*
  * Copyright (c) 2000 Takemura Shin
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpcapm_machdep.c,v 1.3 2009/03/18 10:22:29 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcapm_machdep.c,v 1.4 2011/02/20 07:58:14 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -91,35 +91,35 @@
 machine_sleep(void)
 {
 #if NVRIP_COMMON > 0
-        if (platid_match(&platid, &platid_mask_CPU_MIPS_VR_41XX)) {
-                /*
-                 * disable all interrupts except PIU interrupt
-                 */
-                vrip_intr_suspend();
-                _spllower(~MIPS_INT_MASK_0);
+       if (platid_match(&platid, &platid_mask_CPU_MIPS_VR_41XX)) {
+               /*
+                * disable all interrupts except PIU interrupt
+                */
+               vrip_intr_suspend();
+               _spllower(~MIPS_INT_MASK_0);
 
-                /*
-                 * SUSPEND instruction puts the CPU into power saveing
-                 * state until some interrupt occuer.
-                 * It sleeps until you push the power button.
-                 */
-                __asm(".set noreorder");
-                __asm(".word   " ___STRING(VR_OPCODE_SUSPEND));
-                __asm("nop");
-                __asm("nop");
-                __asm("nop");
-                __asm("nop");
-                __asm("nop");
-                __asm(".set reorder");
+               /*
+                * SUSPEND instruction puts the CPU into power saveing
+                * state until some interrupt occuer.
+                * It sleeps until you push the power button.
+                */
+               __asm(".set noreorder");
+               __asm(".word    " ___STRING(VR_OPCODE_SUSPEND));
+               __asm("nop");
+               __asm("nop");
+               __asm("nop");
+               __asm("nop");
+               __asm("nop");
+               __asm(".set reorder");
 
-                splhigh();
-                vrip_intr_resume();
-                delay(1000); /* 1msec */
-        }
+               splhigh();
+               vrip_intr_resume();
+               delay(1000); /* 1msec */
+       }
 #endif /* NVRIP_COMMON > 0 */
 #ifdef TX39XX
-        if (platid_match(&platid, &platid_mask_CPU_MIPS_TX)) {
-                tx39power_suspend_cpu();
-        }
+       if (platid_match(&platid, &platid_mask_CPU_MIPS_TX)) {
+               tx39power_suspend_cpu();
+       }
 #endif
 }
diff -r 1f8525e8310a -r e23472eb800e sys/arch/hpcmips/hpcmips/interrupt.c
--- a/sys/arch/hpcmips/hpcmips/interrupt.c      Sun Feb 20 07:55:20 2011 +0000
+++ b/sys/arch/hpcmips/hpcmips/interrupt.c      Sun Feb 20 07:58:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interrupt.c,v 1.17 2010/12/20 00:25:34 matt Exp $      */
+/*     $NetBSD: interrupt.c,v 1.18 2011/02/20 07:58:14 matt Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,26 +30,24 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.17 2010/12/20 00:25:34 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.18 2011/02/20 07:58:14 matt Exp $");
 
 #include "opt_vr41xx.h"
 #include "opt_tx39xx.h"
 
+#define __INTR_PRIVATE



Home | Main Index | Thread Index | Old Index