12 #include <linux/errno.h>
16 #include <linux/sched.h>
17 #include <linux/types.h>
21 #define AVR32_PERFCTR_IRQ_GROUP 0
22 #define AVR32_PERFCTR_IRQ_LINE 1
53 static void avr32_perf_counter_reset(
void)
100 static int avr32_perf_counter_create_files(
struct super_block *
sb,
108 snprintf(filename,
sizeof(filename),
"%u", i);
124 &counter[i].unit_mask);
130 static int avr32_perf_counter_setup(
void)
137 pr_debug(
"avr32_perf_counter_setup\n");
141 "oprofile: setup: perf counter already enabled\n");
147 "oprofile", counter);
151 avr32_perf_counter_reset();
159 pr_debug(
"enabling counter %d...\n", i);
179 pr_debug(
"oprofile: writing 0x%x to PCCR...\n", pccr);
186 static void avr32_perf_counter_shutdown(
void)
188 pr_debug(
"avr32_perf_counter_shutdown\n");
190 avr32_perf_counter_reset();
194 static int avr32_perf_counter_start(
void)
196 pr_debug(
"avr32_perf_counter_start\n");
203 static void avr32_perf_counter_stop(
void)
205 pr_debug(
"avr32_perf_counter_stop\n");
211 .create_files = avr32_perf_counter_create_files,
212 .setup = avr32_perf_counter_setup,
213 .shutdown = avr32_perf_counter_shutdown,
214 .start = avr32_perf_counter_start,
215 .stop = avr32_perf_counter_stop,
224 memcpy(ops, &avr32_perf_counter_ops,