aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/oprofile_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/oprofile_impl.h')
-rw-r--r--include/asm-powerpc/oprofile_impl.h89
1 files changed, 2 insertions, 87 deletions
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 71043bf3641f..94c0ad2bff96 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -58,10 +58,8 @@ extern struct op_powerpc_model op_model_power4;
58extern struct op_powerpc_model op_model_7450; 58extern struct op_powerpc_model op_model_7450;
59extern struct op_powerpc_model op_model_cell; 59extern struct op_powerpc_model op_model_cell;
60 60
61#ifndef CONFIG_FSL_BOOKE
62
63/* All the classic PPC parts use these */ 61/* All the classic PPC parts use these */
64static inline unsigned int ctr_read(unsigned int i) 62static inline unsigned int classic_ctr_read(unsigned int i)
65{ 63{
66 switch(i) { 64 switch(i) {
67 case 0: 65 case 0:
@@ -89,7 +87,7 @@ static inline unsigned int ctr_read(unsigned int i)
89 } 87 }
90} 88}
91 89
92static inline void ctr_write(unsigned int i, unsigned int val) 90static inline void classic_ctr_write(unsigned int i, unsigned int val)
93{ 91{
94 switch(i) { 92 switch(i) {
95 case 0: 93 case 0:
@@ -124,89 +122,6 @@ static inline void ctr_write(unsigned int i, unsigned int val)
124 break; 122 break;
125 } 123 }
126} 124}
127#else /* CONFIG_FSL_BOOKE */
128static inline u32 get_pmlca(int ctr)
129{
130 u32 pmlca;
131
132 switch (ctr) {
133 case 0:
134 pmlca = mfpmr(PMRN_PMLCA0);
135 break;
136 case 1:
137 pmlca = mfpmr(PMRN_PMLCA1);
138 break;
139 case 2:
140 pmlca = mfpmr(PMRN_PMLCA2);
141 break;
142 case 3:
143 pmlca = mfpmr(PMRN_PMLCA3);
144 break;
145 default:
146 panic("Bad ctr number\n");
147 }
148
149 return pmlca;
150}
151
152static inline void set_pmlca(int ctr, u32 pmlca)
153{
154 switch (ctr) {
155 case 0:
156 mtpmr(PMRN_PMLCA0, pmlca);
157 break;
158 case 1:
159 mtpmr(PMRN_PMLCA1, pmlca);
160 break;
161 case 2:
162 mtpmr(PMRN_PMLCA2, pmlca);
163 break;
164 case 3:
165 mtpmr(PMRN_PMLCA3, pmlca);
166 break;
167 default:
168 panic("Bad ctr number\n");
169 }
170}
171
172static inline unsigned int ctr_read(unsigned int i)
173{
174 switch(i) {
175 case 0:
176 return mfpmr(PMRN_PMC0);
177 case 1:
178 return mfpmr(PMRN_PMC1);
179 case 2:
180 return mfpmr(PMRN_PMC2);
181 case 3:
182 return mfpmr(PMRN_PMC3);
183 default:
184 return 0;
185 }
186}
187
188static inline void ctr_write(unsigned int i, unsigned int val)
189{
190 switch(i) {
191 case 0:
192 mtpmr(PMRN_PMC0, val);
193 break;
194 case 1:
195 mtpmr(PMRN_PMC1, val);
196 break;
197 case 2:
198 mtpmr(PMRN_PMC2, val);
199 break;
200 case 3:
201 mtpmr(PMRN_PMC3, val);
202 break;
203 default:
204 break;
205 }
206}
207
208
209#endif /* CONFIG_FSL_BOOKE */
210 125
211 126
212extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); 127extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth);