Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Split out cpu_softc into cpuvar.h



details:   https://anonhg.NetBSD.org/src/rev/b7f8eeab57f5
branches:  trunk
changeset: 778584:b7f8eeab57f5
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Apr 05 21:00:29 2012 +0000

description:
Split out cpu_softc into cpuvar.h

Split out the interrupt definitions into intrdefs.h and add the IPI
definitions

Add the required field to cpu_info for the IPI functions.

Makes a MULTIPROCESSOR kernel compiles.

diffstat:

 sys/arch/hp700/dev/cpu.c          |  13 +++--------
 sys/arch/hp700/include/cpu.h      |   5 +++-
 sys/arch/hp700/include/intr.h     |  23 ++++-----------------
 sys/arch/hp700/include/intrdefs.h |  30 +++++++++++++++++++++++++++++
 sys/arch/hppa/hppa/cpuvar.h       |  40 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 83 insertions(+), 28 deletions(-)

diffs (186 lines):

diff -r 3d302248b0c4 -r b7f8eeab57f5 sys/arch/hp700/dev/cpu.c
--- a/sys/arch/hp700/dev/cpu.c  Thu Apr 05 20:25:53 2012 +0000
+++ b/sys/arch/hp700/dev/cpu.c  Thu Apr 05 21:00:29 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.21 2012/04/03 11:44:32 skrll Exp $   */
+/*     $NetBSD: cpu.c,v 1.22 2012/04/05 21:00:29 skrll Exp $   */
 
 /*     $OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $   */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.21 2012/04/03 11:44:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.22 2012/04/05 21:00:29 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -46,16 +46,11 @@
 #include <machine/iomod.h>
 #include <machine/autoconf.h>
 
+#include <hppa/hppa/cpuvar.h>
 #include <hp700/hp700/intr.h>
 #include <hp700/hp700/machdep.h>
 #include <hp700/dev/cpudevs.h>
 
-struct cpu_softc {
-       device_t sc_dev;
-       hppa_hpa_t sc_hpa;
-       void *sc_ih;
-};
-
 #ifdef MULTIPROCESSOR
 
 int hppa_ncpu;
@@ -175,7 +170,7 @@
                return;
        }
        
-       sc->sc_ih = hp700_intr_establish(IPL_CLOCK, clock_intr,
+       sc->sc_ihclk = hp700_intr_establish(IPL_CLOCK, clock_intr,
            NULL /*clockframe*/, &ir_cpu, 31);
 
 #ifdef MULTIPROCESSOR
diff -r 3d302248b0c4 -r b7f8eeab57f5 sys/arch/hp700/include/cpu.h
--- a/sys/arch/hp700/include/cpu.h      Thu Apr 05 20:25:53 2012 +0000
+++ b/sys/arch/hp700/include/cpu.h      Thu Apr 05 21:00:29 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.68 2012/01/20 06:51:19 skrll Exp $   */
+/*     $NetBSD: cpu.h,v 1.69 2012/04/05 21:00:29 skrll Exp $   */
 
 /*     $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $       */
 
@@ -280,6 +280,9 @@
 #define        CPUF_PRIMARY    0x0001          /* ... is monarch/primary */
 #define        CPUF_RUNNING    0x0002          /* ... is running. */
 
+       volatile u_long ci_ipi;         /* IPIs pending */
+
+       struct cpu_softc *ci_softc;
 #endif
 
 #endif /* !_KMEMUSER */
diff -r 3d302248b0c4 -r b7f8eeab57f5 sys/arch/hp700/include/intr.h
--- a/sys/arch/hp700/include/intr.h     Thu Apr 05 20:25:53 2012 +0000
+++ b/sys/arch/hp700/include/intr.h     Thu Apr 05 21:00:29 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.20 2012/04/05 20:17:24 skrll Exp $  */
+/*     $NetBSD: intr.h,v 1.21 2012/04/05 21:00:29 skrll Exp $  */
 /*     $OpenBSD: intr.h,v 1.26 2009/12/29 13:11:40 jsing Exp $ */
 
 /*-
@@ -34,23 +34,7 @@
 #define _HP700_INTR_H_
 
 #include <machine/psl.h>
-
-/* Interrupt priority `levels'. */
-#define        IPL_NONE        7       /* nothing */
-#define        IPL_SOFTCLOCK   6       /* timeouts */
-#define        IPL_SOFTBIO     5       /* block I/o */
-#define        IPL_SOFTNET     4       /* protocol stacks */
-#define        IPL_SOFTSERIAL  3       /* serial */
-#define        IPL_VM          2       /* memory allocation, low I/O */
-#define        IPL_SCHED       1       /* clock, medium I/O */
-#define        IPL_HIGH        0       /* everything */
-#define        NIPL            8
-
-/* Interrupt sharing types. */
-#define        IST_NONE        0       /* none */
-#define        IST_PULSE       1       /* pulsed */
-#define        IST_EDGE        2       /* edge-triggered */
-#define        IST_LEVEL       3       /* level-triggered */
+#include <machine/intrdefs.h>
 
 #ifndef _LOCORE
 
@@ -94,6 +78,9 @@
 #define        setsoftast(l)   ((l)->l_md.md_astpending = 1)
 
 #ifdef MULTIPROCESSOR
+
+struct cpu_info;
+
 void    hppa_ipi_init(struct cpu_info *);
 int     hppa_ipi_intr(void *arg);
 int     hppa_ipi_send(struct cpu_info *, u_long);
diff -r 3d302248b0c4 -r b7f8eeab57f5 sys/arch/hp700/include/intrdefs.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hp700/include/intrdefs.h Thu Apr 05 21:00:29 2012 +0000
@@ -0,0 +1,30 @@
+/*     $NetBSD: intrdefs.h,v 1.1 2012/04/05 21:00:29 skrll Exp $       */
+
+#ifndef _HPPA_INTRDEFS_H_
+#define _HPPA_INTRDEFS_H_
+
+/* Interrupt priority `levels'. */
+#define        IPL_NONE        7       /* nothing */
+#define        IPL_SOFTCLOCK   6       /* timeouts */
+#define        IPL_SOFTBIO     5       /* block I/O */
+#define        IPL_SOFTNET     4       /* protocol stacks */
+#define        IPL_SOFTSERIAL  3       /* serial */
+#define        IPL_VM          2       /* memory allocation, low I/O */
+#define        IPL_SCHED       1       /* clock, medium I/O */
+#define        IPL_HIGH        0       /* everything */
+#define        NIPL            8
+
+/* Interrupt sharing types. */
+#define        IST_NONE        0       /* none */
+#define        IST_PULSE       1       /* pulsed */
+#define        IST_EDGE        2       /* edge-triggered */
+#define        IST_LEVEL       3       /* level-triggered */
+
+#ifdef MULTIPROCESSOR
+#define        HPPA_IPI_NOP            0
+#define        HPPA_IPI_HALT           1
+#define        HPPA_IPI_XCALL          2
+#define        HPPA_NIPI               3
+#endif
+
+#endif
diff -r 3d302248b0c4 -r b7f8eeab57f5 sys/arch/hppa/hppa/cpuvar.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hppa/hppa/cpuvar.h       Thu Apr 05 21:00:29 2012 +0000
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson
+ *
+ * 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 "opt_multiprocessor.h"
+
+struct cpu_softc {
+       device_t sc_dev;
+       void *sc_ihclk;
+       void *sc_ihipi;
+#if defined(MULTIPROCESSOR)
+       struct evcnt sc_evcnt_ipi;      /* interprocessor interrupts */
+       struct evcnt sc_evcnt_which_ipi[HPPA_NIPI];
+#endif
+};



Home | Main Index | Thread Index | Old Index