15 #define RM9K_COUNTER1_EVENT(event) ((event) << 0)
16 #define RM9K_COUNTER1_SUPERVISOR (1ULL << 7)
17 #define RM9K_COUNTER1_KERNEL (1ULL << 8)
18 #define RM9K_COUNTER1_USER (1ULL << 9)
19 #define RM9K_COUNTER1_ENABLE (1ULL << 10)
20 #define RM9K_COUNTER1_OVERFLOW (1ULL << 15)
22 #define RM9K_COUNTER2_EVENT(event) ((event) << 16)
23 #define RM9K_COUNTER2_SUPERVISOR (1ULL << 23)
24 #define RM9K_COUNTER2_KERNEL (1ULL << 24)
25 #define RM9K_COUNTER2_USER (1ULL << 25)
26 #define RM9K_COUNTER2_ENABLE (1ULL << 26)
27 #define RM9K_COUNTER2_OVERFLOW (1ULL << 31)
31 static struct rm9k_register_config {
33 unsigned int reset_counter1;
34 unsigned int reset_counter2;
57 reg.reset_counter1 = 0x80000000 - ctr[0].
count;
58 reg.reset_counter2 = 0x80000000 - ctr[1].
count;
63 static void rm9000_cpu_setup(
void *args)
67 perfcount = ((
uint64_t)
reg.reset_counter2 << 32) |
reg.reset_counter1;
71 static void rm9000_cpu_start(
void *args)
77 static void rm9000_cpu_stop(
void *args)
100 counter2 = counters >> 32;
104 counter1 =
reg.reset_counter1;
108 counter2 =
reg.reset_counter2;
111 counters = ((
uint64_t)counter2 << 32) | counter1;
118 static int __init rm9000_init(
void)
121 0,
"Perfcounter",
NULL);
124 static void rm9000_exit(
void)
130 .reg_setup = rm9000_reg_setup,
131 .cpu_setup = rm9000_cpu_setup,
134 .cpu_start = rm9000_cpu_start,
135 .cpu_stop = rm9000_cpu_stop,
136 .cpu_type =
"mips/rm9000",