14 #include <asm/ptrace.h>
34 ctl |= (ctr[1].
event & 3) << 2;
36 if (ctr[0].
event == 0)
51 reset = need_reset = 0;
52 for (i = 0; i < 2; ++
i) {
60 reset |= (0x100000 -
count) << (i ? 6 : 28);
61 if (count != 0x100000)
71 ev67_cpu_setup (
void *
x)
133 op_add_pm(
unsigned long pc,
int kern,
unsigned long counter,
136 unsigned long fake_counter = 2 +
event;
139 if (ctr[fake_counter].enabled)
144 ev67_handle_interrupt(
unsigned long which,
struct pt_regs *
regs,
147 unsigned long pmpc, pctr_ctl;
154 unsigned overcount: 3;
155 unsigned icache_miss: 1;
156 unsigned trap_type: 4;
157 unsigned load_store: 1;
159 unsigned mispredict: 1;
166 TRAP_DTB_DOUBLE_MISS_3,
167 TRAP_DTB_DOUBLE_MISS_4,
170 TRAP_DTB_SINGLE_MISS,
182 pmpc = wrperfmon(9, 0);
188 i_stat.v = wrperfmon(8, 0);
189 if (i_stat.fields.trap) {
190 switch (i_stat.fields.trap_type) {
199 if ((pmpc & ((1 << 15) - 1)) == 581)
200 op_add_pm(regs->
pc, kern, which,
207 op_add_pm(pmpc, kern, which, ctr,
208 (i_stat.fields.load_store
211 case TRAP_DTB_DOUBLE_MISS_3:
212 case TRAP_DTB_DOUBLE_MISS_4:
213 case TRAP_DTB_SINGLE_MISS:
220 case TRAP_FP_DISABLED:
221 case TRAP_DSTREAM_FAULT:
223 case TRAP_MACHINE_CHECK:
224 case TRAP_ARITHMETIC:
235 if (i_stat.fields.mispredict) {
243 pctr_ctl = wrperfmon(5, 0);
244 if (pctr_ctl & (1
UL << 27))
245 op_add_pm(pmpc, kern, which, ctr,
PM_STALLED);
250 if (!mispredict && pctr_ctl & (1
UL << 0))
251 op_add_pm(pmpc, kern, which, ctr,
PM_TAKEN);
255 .reg_setup = ev67_reg_setup,
256 .cpu_setup = ev67_cpu_setup,
257 .reset_ctr = ev67_reset_ctr,
258 .handle_interrupt = ev67_handle_interrupt,
259 .cpu_type =
"alpha/ev67",
261 .can_set_proc_mode = 0,