Module Name: src
Committed By: skrll
Date: Thu Apr 5 21:00:30 UTC 2012
Modified Files:
src/sys/arch/hp700/dev: cpu.c
src/sys/arch/hp700/include: cpu.h intr.h
Added Files:
src/sys/arch/hp700/include: intrdefs.h
src/sys/arch/hppa/hppa: cpuvar.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/cpu.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/hp700/include/cpu.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp700/include/intr.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp700/include/intrdefs.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/hppa/hppa/cpuvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.21 src/sys/arch/hp700/dev/cpu.c:1.22
--- src/sys/arch/hp700/dev/cpu.c:1.21 Tue Apr 3 11:44:32 2012
+++ src/sys/arch/hp700/dev/cpu.c Thu Apr 5 21:00:29 2012
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.21
#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 @@ cpuattach(device_t parent, device_t self
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
Index: src/sys/arch/hp700/include/cpu.h
diff -u src/sys/arch/hp700/include/cpu.h:1.68 src/sys/arch/hp700/include/cpu.h:1.69
--- src/sys/arch/hp700/include/cpu.h:1.68 Fri Jan 20 06:51:19 2012
+++ src/sys/arch/hp700/include/cpu.h Thu Apr 5 21:00:29 2012
@@ -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 @@ struct cpu_info {
#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 */
Index: src/sys/arch/hp700/include/intr.h
diff -u src/sys/arch/hp700/include/intr.h:1.20 src/sys/arch/hp700/include/intr.h:1.21
--- src/sys/arch/hp700/include/intr.h:1.20 Thu Apr 5 20:17:24 2012
+++ src/sys/arch/hp700/include/intr.h Thu Apr 5 21:00:29 2012
@@ -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 @@ splraiseipl(ipl_cookie_t icookie)
#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);
Added files:
Index: src/sys/arch/hp700/include/intrdefs.h
diff -u /dev/null src/sys/arch/hp700/include/intrdefs.h:1.1
--- /dev/null Thu Apr 5 21:00:30 2012
+++ src/sys/arch/hp700/include/intrdefs.h Thu Apr 5 21:00:29 2012
@@ -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
Index: src/sys/arch/hppa/hppa/cpuvar.h
diff -u /dev/null src/sys/arch/hppa/hppa/cpuvar.h:1.1
--- /dev/null Thu Apr 5 21:00:30 2012
+++ src/sys/arch/hppa/hppa/cpuvar.h Thu Apr 5 21:00:30 2012
@@ -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
+};