Lines Matching defs:index

188 static u64 m1_pmu_read_hw_counter(unsigned int index)
190 switch (index) {
206 static void m1_pmu_write_hw_counter(u64 val, unsigned int index)
208 switch (index) {
224 #define get_bit_offset(index, mask) (__ffs(mask) + (index))
226 static void __m1_pmu_enable_counter(unsigned int index, bool en)
230 switch (index) {
232 bit = BIT(get_bit_offset(index, PMCR0_CNT_ENABLE_0_7));
235 bit = BIT(get_bit_offset(index - 8, PMCR0_CNT_ENABLE_8_9));
251 static void m1_pmu_enable_counter(unsigned int index)
253 __m1_pmu_enable_counter(index, true);
256 static void m1_pmu_disable_counter(unsigned int index)
258 __m1_pmu_enable_counter(index, false);
261 static void __m1_pmu_enable_counter_interrupt(unsigned int index, bool en)
265 switch (index) {
267 bit = BIT(get_bit_offset(index, PMCR0_PMI_ENABLE_0_7));
270 bit = BIT(get_bit_offset(index - 8, PMCR0_PMI_ENABLE_8_9));
286 static void m1_pmu_enable_counter_interrupt(unsigned int index)
288 __m1_pmu_enable_counter_interrupt(index, true);
291 static void m1_pmu_disable_counter_interrupt(unsigned int index)
293 __m1_pmu_enable_counter_interrupt(index, false);
296 static void m1_pmu_configure_counter(unsigned int index, u8 event,
302 switch (index) {
304 user_bit = BIT(get_bit_offset(index, PMCR1_COUNT_A64_EL0_0_7));
305 kernel_bit = BIT(get_bit_offset(index, PMCR1_COUNT_A64_EL1_0_7));
308 user_bit = BIT(get_bit_offset(index - 8, PMCR1_COUNT_A64_EL0_8_9));
309 kernel_bit = BIT(get_bit_offset(index - 8, PMCR1_COUNT_A64_EL1_8_9));
335 switch (index) {
339 shift = (index - 2) * 8;
346 shift = (index - 6) * 8;