13 #include <asm/ptrace.h>
29 int cbox1_ofs,
int cbox2_ofs)
47 for (i = 0; i < 3; ++
i) {
48 unsigned long event = ctr[
i].
event;
56 else if (
event == 2+41)
66 ctl |= (
event - 24) << 4;
68 ctl |= (
event - 40) << cbox1_ofs | 15 << 4;
72 ctl |= (
event - 64) << cbox2_ofs | 15;
90 ctl = reset = need_reset = 0;
91 for (i = 0; i < 3; ++
i) {
97 count = 256, hilo = 3, max = 256;
99 max = (i == 2 ? 16384 : 65536);
106 ctl |= hilo << (8 - i*2);
107 reset |= (max -
count) << (48 - 16*i);
109 need_reset |= 1 <<
i;
121 common_reg_setup(reg, ctr, sys, 19, 22);
129 common_reg_setup(reg, ctr, sys, 8, 11);
135 ev5_cpu_setup (
void *
x)
141 wrperfmon(4, reg->
freq);
162 mask = (ctr == 0 ? 0xfffful << 48
163 : ctr == 1 ? 0xfffful << 32
166 not_pk = 1 << 9 | 1 << 8;
170 if ((reg->
proc_mode & not_pk) == not_pk) {
171 values = wrperfmon(5, 0);
172 values = (reset_values &
mask) | (values & ~mask & -2);
173 wrperfmon(6, values);
176 values = wrperfmon(5, 0);
177 values = (reset_values &
mask) | (values & ~mask & -2);
178 wrperfmon(6, values);
179 wrperfmon(1, reg->
enable);
184 ev5_handle_interrupt(
unsigned long which,
struct pt_regs *
regs,
193 .reg_setup = ev5_reg_setup,
194 .cpu_setup = ev5_cpu_setup,
195 .reset_ctr = ev5_reset_ctr,
196 .handle_interrupt = ev5_handle_interrupt,
197 .cpu_type =
"alpha/ev5",
199 .can_set_proc_mode = 1,
203 .reg_setup = pca56_reg_setup,
204 .cpu_setup = ev5_cpu_setup,
205 .reset_ctr = ev5_reset_ctr,
206 .handle_interrupt = ev5_handle_interrupt,
207 .cpu_type =
"alpha/pca56",
209 .can_set_proc_mode = 1,