Wed Dec 2 07:55:01 2009 UTC ()
count IPI's as interrupts, not misc counters.


(mrg)
diff -r1.87 -r1.88 src/sys/arch/sparc64/sparc64/cpu.c

cvs diff -r1.87 -r1.88 src/sys/arch/sparc64/sparc64/cpu.c (expand / switch to unified diff)

--- src/sys/arch/sparc64/sparc64/cpu.c 2009/12/01 09:26:36 1.87
+++ src/sys/arch/sparc64/sparc64/cpu.c 2009/12/02 07:55:01 1.88
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.87 2009/12/01 09:26:36 martin Exp $ */ 1/* $NetBSD: cpu.c,v 1.88 2009/12/02 07:55:01 mrg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 4 * Copyright (c) 1996
5 * The President and Fellows of Harvard College. All rights reserved. 5 * The President and Fellows of Harvard College. All rights reserved.
6 * Copyright (c) 1992, 1993 6 * Copyright (c) 1992, 1993
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 * 8 *
9 * This software was developed by the Computer Systems Engineering group 9 * This software was developed by the Computer Systems Engineering group
10 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 10 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
11 * contributed to Berkeley. 11 * contributed to Berkeley.
12 * 12 *
13 * All advertising materials mentioning features or use of this software 13 * All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement: 14 * must display the following acknowledgement:
@@ -42,27 +42,27 @@ @@ -42,27 +42,27 @@
42 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 42 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
44 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE. 48 * SUCH DAMAGE.
49 * 49 *
50 * @(#)cpu.c 8.5 (Berkeley) 11/23/93 50 * @(#)cpu.c 8.5 (Berkeley) 11/23/93
51 * 51 *
52 */ 52 */
53 53
54#include <sys/cdefs.h> 54#include <sys/cdefs.h>
55__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.87 2009/12/01 09:26:36 martin Exp $"); 55__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.88 2009/12/02 07:55:01 mrg Exp $");
56 56
57#include "opt_multiprocessor.h" 57#include "opt_multiprocessor.h"
58 58
59#include <sys/param.h> 59#include <sys/param.h>
60#include <sys/systm.h> 60#include <sys/systm.h>
61#include <sys/device.h> 61#include <sys/device.h>
62#include <sys/kernel.h> 62#include <sys/kernel.h>
63#include <sys/reboot.h> 63#include <sys/reboot.h>
64 64
65#include <uvm/uvm_extern.h> 65#include <uvm/uvm_extern.h>
66 66
67#include <machine/autoconf.h> 67#include <machine/autoconf.h>
68#include <machine/cpu.h> 68#include <machine/cpu.h>
@@ -257,30 +257,30 @@ cpu_attach(struct device *parent, struct @@ -257,30 +257,30 @@ cpu_attach(struct device *parent, struct
257 */ 257 */
258 if (ci->ci_flags & CPUF_PRIMARY) { 258 if (ci->ci_flags & CPUF_PRIMARY) {
259 fpstate_cache = pool_cache_init(sizeof(struct fpstate64), 259 fpstate_cache = pool_cache_init(sizeof(struct fpstate64),
260 BLOCK_SIZE, 0, 0, "fpstate", NULL, 260 BLOCK_SIZE, 0, 0, "fpstate", NULL,
261 IPL_NONE, NULL, NULL, NULL); 261 IPL_NONE, NULL, NULL, NULL);
262 cpu_reset_fpustate(); 262 cpu_reset_fpustate();
263 } 263 }
264#ifdef MULTIPROCESSOR 264#ifdef MULTIPROCESSOR
265 else { 265 else {
266 mi_cpu_attach(ci); 266 mi_cpu_attach(ci);
267 ci->ci_cpcb = lwp_getpcb(ci->ci_data.cpu_idlelwp); 267 ci->ci_cpcb = lwp_getpcb(ci->ci_data.cpu_idlelwp);
268 } 268 }
269 for (i = 0; i < IPI_EVCNT_NUM; ++i) 269 for (i = 0; i < IPI_EVCNT_NUM; ++i)
270 evcnt_attach_dynamic(&ci->ci_ipi_evcnt[i], EVCNT_TYPE_MISC, 270 evcnt_attach_dynamic(&ci->ci_ipi_evcnt[i], EVCNT_TYPE_INTR,
271 NULL, device_xname(dev), ipi_evcnt_names[i]); 271 NULL, device_xname(dev), ipi_evcnt_names[i]);
272#endif 272#endif
273 evcnt_attach_dynamic(&ci->ci_tick_evcnt, EVCNT_TYPE_MISC, NULL, 273 evcnt_attach_dynamic(&ci->ci_tick_evcnt, EVCNT_TYPE_INTR, NULL,
274 device_xname(dev), "timer"); 274 device_xname(dev), "timer");
275 275
276 clk = prom_getpropint(node, "clock-frequency", 0); 276 clk = prom_getpropint(node, "clock-frequency", 0);
277 if (clk == 0) { 277 if (clk == 0) {
278 /* 278 /*
279 * Try to find it in the OpenPROM root... 279 * Try to find it in the OpenPROM root...
280 */ 280 */
281 clk = prom_getpropint(findroot(), "clock-frequency", 0); 281 clk = prom_getpropint(findroot(), "clock-frequency", 0);
282 } 282 }
283 if (clk) { 283 if (clk) {
284 /* Tell OS what frequency we run on */ 284 /* Tell OS what frequency we run on */
285 ci->ci_cpu_clockrate[0] = clk; 285 ci->ci_cpu_clockrate[0] = clk;
286 ci->ci_cpu_clockrate[1] = clk / 1000000; 286 ci->ci_cpu_clockrate[1] = clk / 1000000;