Lines Matching full:pmc
18 #define PM_PMC_SH 20 /* PMC number (1-based) for direct events */
137 int pmc, byte, unit, sh; in power5p_get_constraint() local
141 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in power5p_get_constraint()
142 if (pmc) { in power5p_get_constraint()
143 if (pmc > 6) in power5p_get_constraint()
145 sh = (pmc - 1) * 2; in power5p_get_constraint()
148 if (pmc >= 5 && !(event == 0x500009 || event == 0x600005)) in power5p_get_constraint()
179 if (pmc < 5) { in power5p_get_constraint()
191 int pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in power5p_limited_pmc_event() local
193 return pmc == 5 || pmc == 6; in power5p_limited_pmc_event()
231 /* PMC 1 */ { 0x21, 0x23, 0x25, 0x27 },
232 /* PMC 2 */ { 0x07, 0x17, 0x0e, 0x1e },
233 /* PMC 3 */ { 0x20, 0x22, 0x24, 0x26 },
234 /* PMC 4 */ { 0x07, 0x17, 0x0e, 0x1e }
245 int pmc, altpmc, pp, j; in find_alternative_bdecode() local
247 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in find_alternative_bdecode()
248 if (pmc == 0 || pmc > 4) in find_alternative_bdecode()
250 altpmc = 5 - pmc; /* 1 <-> 4, 2 <-> 3 */ in find_alternative_bdecode()
253 if (bytedecode_alternatives[pmc - 1][j] == pp) { in find_alternative_bdecode()
261 if (pmc == 1 && (pp == 0x0d || pp == 0x0e)) in find_alternative_bdecode()
263 if (pmc == 3 && (pp == 0x2e || pp == 0x2f)) in find_alternative_bdecode()
332 /* remove the limited PMC events */ in power5p_get_alternatives()
342 /* remove all but the limited PMC events */ in power5p_get_alternatives()
358 * Indexed by PMCSEL value, bit i (LE) set if PMC i is a marked event.
405 int pmc, psel; in power5p_marked_instr_event() local
409 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in power5p_marked_instr_event()
411 if (pmc >= 5) in power5p_marked_instr_event()
416 if (direct_event_is_marked[psel] & (1 << pmc)) in power5p_marked_instr_event()
421 bit = pmc - 1; in power5p_marked_instr_event()
423 bit = 4 - pmc; in power5p_marked_instr_event()
424 else if (psel == 0x1b && (pmc == 1 || pmc == 3)) in power5p_marked_instr_event()
429 bit = pmc - 1; in power5p_marked_instr_event()
430 } else if (pmc == 3 && (psel == 0x2e || psel == 0x2f)) { in power5p_marked_instr_event()
459 unsigned int pmc, unit, byte, psel; in power5p_compute_mmcr() local
474 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; in power5p_compute_mmcr()
475 if (pmc) { in power5p_compute_mmcr()
476 if (pmc > 6) in power5p_compute_mmcr()
478 if (pmc_inuse & (1 << (pmc - 1))) in power5p_compute_mmcr()
480 pmc_inuse |= 1 << (pmc - 1); in power5p_compute_mmcr()
552 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; in power5p_compute_mmcr()
557 if (!pmc) { in power5p_compute_mmcr()
558 /* Bus event or any-PMC direct event */ in power5p_compute_mmcr()
559 for (pmc = 0; pmc < 4; ++pmc) { in power5p_compute_mmcr()
560 if (!(pmc_inuse & (1 << pmc))) in power5p_compute_mmcr()
563 if (pmc >= 4) in power5p_compute_mmcr()
565 pmc_inuse |= 1 << pmc; in power5p_compute_mmcr()
566 } else if (pmc <= 4) { in power5p_compute_mmcr()
568 --pmc; in power5p_compute_mmcr()
572 mmcr1 |= 1ul << (MMCR1_PMC1_ADDER_SEL_SH - pmc); in power5p_compute_mmcr()
575 --pmc; in power5p_compute_mmcr()
584 if ((psel & 0x58) == 0x40 && (byte & 1) != ((pmc >> 1) & 1)) in power5p_compute_mmcr()
587 if (pmc <= 3) in power5p_compute_mmcr()
588 mmcr1 |= psel << MMCR1_PMCSEL_SH(pmc); in power5p_compute_mmcr()
589 hwc[i] = pmc; in power5p_compute_mmcr()
603 static void power5p_disable_pmc(unsigned int pmc, struct mmcr_regs *mmcr) in power5p_disable_pmc() argument
605 if (pmc <= 3) in power5p_disable_pmc()
606 mmcr->mmcr1 &= ~(0x7fUL << MMCR1_PMCSEL_SH(pmc)); in power5p_disable_pmc()