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.c42
1 files changed, 5 insertions, 37 deletions
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c
index 3e8daabf1021..e5f572710aa0 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/ppc64/oprofile/common.c
@@ -121,45 +121,13 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root)
121 121
122int __init oprofile_arch_init(struct oprofile_operations *ops) 122int __init oprofile_arch_init(struct oprofile_operations *ops)
123{ 123{
124 unsigned int pvr; 124 if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type)
125 125 return -ENODEV;
126 pvr = mfspr(SPRN_PVR);
127
128 switch (PVR_VER(pvr)) {
129 case PV_630:
130 case PV_630p:
131 model = &op_model_rs64;
132 break;
133
134 case PV_NORTHSTAR:
135 case PV_PULSAR:
136 case PV_ICESTAR:
137 case PV_SSTAR:
138 model = &op_model_rs64;
139 break;
140
141 case PV_POWER4:
142 case PV_POWER4p:
143 model = &op_model_power4;
144 break;
145
146 case PV_970:
147 case PV_970FX:
148 case PV_970MP:
149 model = &op_model_power4;
150 break;
151
152 case PV_POWER5:
153 case PV_POWER5p:
154 model = &op_model_power4;
155 break;
156
157 default:
158 return -ENODEV;
159 }
160 126
161 ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; 127 model = cur_cpu_spec->oprofile_model;
162 model->num_counters = cur_cpu_spec->num_pmcs; 128 model->num_counters = cur_cpu_spec->num_pmcs;
129
130 ops->cpu_type = cur_cpu_spec->oprofile_cpu_type;
163 ops->create_files = op_ppc64_create_files; 131 ops->create_files = op_ppc64_create_files;
164 ops->setup = op_ppc64_setup; 132 ops->setup = op_ppc64_setup;
165 ops->shutdown = op_ppc64_shutdown; 133 ops->shutdown = op_ppc64_shutdown;