aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/oprofile/op_model_power4.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@evo.osdl.org>2005-09-06 08:16:24 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-06 08:16:24 -0400
commit4706df3d3c42af802597d82c8b1542c3d52eab23 (patch)
tree4c11ca2a72158cacce93ef6d2976af3a11ed314f /arch/ppc64/oprofile/op_model_power4.c
parent5bcaa155797ab62ed363932ec0f02fbcb5db1ef1 (diff)
parentcebb2b156319990fc2fba615bbfeac81be62a86a (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/ppc64-2.6
Diffstat (limited to 'arch/ppc64/oprofile/op_model_power4.c')
-rw-r--r--arch/ppc64/oprofile/op_model_power4.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/ppc64/oprofile/op_model_power4.c b/arch/ppc64/oprofile/op_model_power4.c
index 3d103d66870..32b2bb5625f 100644
--- a/arch/ppc64/oprofile/op_model_power4.c
+++ b/arch/ppc64/oprofile/op_model_power4.c
@@ -16,14 +16,12 @@
16#include <asm/cputable.h> 16#include <asm/cputable.h>
17#include <asm/systemcfg.h> 17#include <asm/systemcfg.h>
18#include <asm/rtas.h> 18#include <asm/rtas.h>
19#include <asm/oprofile_impl.h>
19 20
20#define dbg(args...) 21#define dbg(args...)
21 22
22#include "op_impl.h"
23
24static unsigned long reset_value[OP_MAX_COUNTER]; 23static unsigned long reset_value[OP_MAX_COUNTER];
25 24
26static int num_counters;
27static int oprofile_running; 25static int oprofile_running;
28static int mmcra_has_sihv; 26static int mmcra_has_sihv;
29 27
@@ -45,8 +43,6 @@ static void power4_reg_setup(struct op_counter_config *ctr,
45{ 43{
46 int i; 44 int i;
47 45
48 num_counters = num_ctrs;
49
50 /* 46 /*
51 * SIHV / SIPR bits are only implemented on POWER4+ (GQ) and above. 47 * SIHV / SIPR bits are only implemented on POWER4+ (GQ) and above.
52 * However we disable it on all POWER4 until we verify it works 48 * However we disable it on all POWER4 until we verify it works
@@ -68,7 +64,7 @@ static void power4_reg_setup(struct op_counter_config *ctr,
68 64
69 backtrace_spinlocks = sys->backtrace_spinlocks; 65 backtrace_spinlocks = sys->backtrace_spinlocks;
70 66
71 for (i = 0; i < num_counters; ++i) 67 for (i = 0; i < cur_cpu_spec->num_pmcs; ++i)
72 reset_value[i] = 0x80000000UL - ctr[i].count; 68 reset_value[i] = 0x80000000UL - ctr[i].count;
73 69
74 /* setup user and kernel profiling */ 70 /* setup user and kernel profiling */
@@ -121,7 +117,7 @@ static void power4_start(struct op_counter_config *ctr)
121 /* set the PMM bit (see comment below) */ 117 /* set the PMM bit (see comment below) */
122 mtmsrd(mfmsr() | MSR_PMM); 118 mtmsrd(mfmsr() | MSR_PMM);
123 119
124 for (i = 0; i < num_counters; ++i) { 120 for (i = 0; i < cur_cpu_spec->num_pmcs; ++i) {
125 if (ctr[i].enabled) { 121 if (ctr[i].enabled) {
126 ctr_write(i, reset_value[i]); 122 ctr_write(i, reset_value[i]);
127 } else { 123 } else {
@@ -272,7 +268,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
272 /* set the PMM bit (see comment below) */ 268 /* set the PMM bit (see comment below) */
273 mtmsrd(mfmsr() | MSR_PMM); 269 mtmsrd(mfmsr() | MSR_PMM);
274 270
275 for (i = 0; i < num_counters; ++i) { 271 for (i = 0; i < cur_cpu_spec->num_pmcs; ++i) {
276 val = ctr_read(i); 272 val = ctr_read(i);
277 if (val < 0) { 273 if (val < 0) {
278 if (oprofile_running && ctr[i].enabled) { 274 if (oprofile_running && ctr[i].enabled) {