aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/oprofile/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc64/oprofile/common.c')
-rw-r--r--arch/ppc64/oprofile/common.c58
1 files changed, 8 insertions, 50 deletions
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c
index 4acd1a424933..e5f572710aa0 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/ppc64/oprofile/common.c
@@ -16,11 +16,9 @@
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/pmc.h> 18#include <asm/pmc.h>
19#include <asm/cputable.h>
20#include <asm/oprofile_impl.h>
19 21
20#include "op_impl.h"
21
22extern struct op_ppc64_model op_model_rs64;
23extern struct op_ppc64_model op_model_power4;
24static struct op_ppc64_model *model; 22static struct op_ppc64_model *model;
25 23
26static struct op_counter_config ctr[OP_MAX_COUNTER]; 24static struct op_counter_config ctr[OP_MAX_COUNTER];
@@ -123,53 +121,13 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root)
123 121
124int __init oprofile_arch_init(struct oprofile_operations *ops) 122int __init oprofile_arch_init(struct oprofile_operations *ops)
125{ 123{
126 unsigned int pvr; 124 if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type)
127 125 return -ENODEV;
128 pvr = mfspr(SPRN_PVR); 126
129 127 model = cur_cpu_spec->oprofile_model;
130 switch (PVR_VER(pvr)) { 128 model->num_counters = cur_cpu_spec->num_pmcs;
131 case PV_630:
132 case PV_630p:
133 model = &op_model_rs64;
134 model->num_counters = 8;
135 ops->cpu_type = "ppc64/power3";
136 break;
137
138 case PV_NORTHSTAR:
139 case PV_PULSAR:
140 case PV_ICESTAR:
141 case PV_SSTAR:
142 model = &op_model_rs64;
143 model->num_counters = 8;
144 ops->cpu_type = "ppc64/rs64";
145 break;
146
147 case PV_POWER4:
148 case PV_POWER4p:
149 model = &op_model_power4;
150 model->num_counters = 8;
151 ops->cpu_type = "ppc64/power4";
152 break;
153
154 case PV_970:
155 case PV_970FX:
156 case PV_970MP:
157 model = &op_model_power4;
158 model->num_counters = 8;
159 ops->cpu_type = "ppc64/970";
160 break;
161
162 case PV_POWER5:
163 case PV_POWER5p:
164 model = &op_model_power4;
165 model->num_counters = 6;
166 ops->cpu_type = "ppc64/power5";
167 break;
168
169 default:
170 return -ENODEV;
171 }
172 129
130 ops->cpu_type = cur_cpu_spec->oprofile_cpu_type;
173 ops->create_files = op_ppc64_create_files; 131 ops->create_files = op_ppc64_create_files;
174 ops->setup = op_ppc64_setup; 132 ops->setup = op_ppc64_setup;
175 ops->shutdown = op_ppc64_shutdown; 133 ops->shutdown = op_ppc64_shutdown;