aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile/op_model_ppro.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-05-25 12:11:52 -0400
committerRobert Richter <robert.richter@amd.com>2009-06-11 13:42:15 -0400
commitdea3766ca052a4f572b16a23a322553c064d75af (patch)
tree64d2a14629b8bfdfeccce1d722080ffa332cfc4e /arch/x86/oprofile/op_model_ppro.c
parent42399adb239d4f1413899cc618ecf640779e79df (diff)
x86/oprofile: replace CTRL_SET_*ACTIVE macros
The patch replaces all CTRL_SET_*ACTIVE macros. 64 bit MSR functions and 64 bit counter values are used now. The code uses bit masks from <asm/intel_arch_perfmon.h>. Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile/op_model_ppro.c')
-rw-r--r--arch/x86/oprofile/op_model_ppro.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index 82db396dc3ef..566b43f0b6c6 100644
--- a/arch/x86/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
@@ -145,16 +145,16 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
145 145
146static void ppro_start(struct op_msrs const * const msrs) 146static void ppro_start(struct op_msrs const * const msrs)
147{ 147{
148 unsigned int low, high; 148 u64 val;
149 int i; 149 int i;
150 150
151 if (!reset_value) 151 if (!reset_value)
152 return; 152 return;
153 for (i = 0; i < num_counters; ++i) { 153 for (i = 0; i < num_counters; ++i) {
154 if (reset_value[i]) { 154 if (reset_value[i]) {
155 rdmsr(msrs->controls[i].addr, low, high); 155 rdmsrl(msrs->controls[i].addr, val);
156 CTRL_SET_ACTIVE(low); 156 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
157 wrmsr(msrs->controls[i].addr, low, high); 157 wrmsrl(msrs->controls[i].addr, val);
158 } 158 }
159 } 159 }
160} 160}
@@ -162,7 +162,7 @@ static void ppro_start(struct op_msrs const * const msrs)
162 162
163static void ppro_stop(struct op_msrs const * const msrs) 163static void ppro_stop(struct op_msrs const * const msrs)
164{ 164{
165 unsigned int low, high; 165 u64 val;
166 int i; 166 int i;
167 167
168 if (!reset_value) 168 if (!reset_value)
@@ -170,9 +170,9 @@ static void ppro_stop(struct op_msrs const * const msrs)
170 for (i = 0; i < num_counters; ++i) { 170 for (i = 0; i < num_counters; ++i) {
171 if (!reset_value[i]) 171 if (!reset_value[i])
172 continue; 172 continue;
173 rdmsr(msrs->controls[i].addr, low, high); 173 rdmsrl(msrs->controls[i].addr, val);
174 CTRL_SET_INACTIVE(low); 174 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
175 wrmsr(msrs->controls[i].addr, low, high); 175 wrmsrl(msrs->controls[i].addr, val);
176 } 176 }
177} 177}
178 178