Lines Matching full:pmc
18 #define PM_PMC_SH 20 /* PMC number (1-based) for direct events */
139 int pmc, psel, ptype; in power6_marked_instr_event() local
143 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in power6_marked_instr_event()
145 if (pmc >= 5) in power6_marked_instr_event()
151 if (pmc == 0 || !(ptype & (1 << (pmc - 1)))) in power6_marked_instr_event()
159 bit = ptype ^ (pmc - 1); in power6_marked_instr_event()
173 * Assign PMC numbers and compute MMCR1 value for a set of events
181 unsigned int pmc, ev, b, u, s, psel; in p6_compute_mmcr() local
188 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; in p6_compute_mmcr()
189 if (pmc) { in p6_compute_mmcr()
190 if (pmc_inuse & (1 << (pmc - 1))) in p6_compute_mmcr()
192 pmc_inuse |= 1 << (pmc - 1); in p6_compute_mmcr()
197 pmc = (ev >> PM_PMC_SH) & PM_PMC_MSK; in p6_compute_mmcr()
198 if (pmc) { in p6_compute_mmcr()
199 --pmc; in p6_compute_mmcr()
201 /* can go on any PMC; find a free one */ in p6_compute_mmcr()
202 for (pmc = 0; pmc < 4; ++pmc) in p6_compute_mmcr()
203 if (!(pmc_inuse & (1 << pmc))) in p6_compute_mmcr()
205 if (pmc >= 4) in p6_compute_mmcr()
207 pmc_inuse |= 1 << pmc; in p6_compute_mmcr()
209 hwc[i] = pmc; in p6_compute_mmcr()
232 mmcr1 |= MMCR1_PMC1_ADDR_SEL >> pmc; in p6_compute_mmcr()
235 if (pmc >= 2 && (psel & 0x90) == 0x80) in p6_compute_mmcr()
239 mmcr1 |= MMCR1_PMC1_LLA >> pmc; in p6_compute_mmcr()
241 mmcr1 |= MMCR1_PMC1_LLA_VALUE >> pmc; in p6_compute_mmcr()
245 if (pmc < 4) in p6_compute_mmcr()
246 mmcr1 |= (unsigned long)psel << MMCR1_PMCSEL_SH(pmc); in p6_compute_mmcr()
271 int pmc, byte, sh, subunit; in p6_get_constraint() local
274 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in p6_get_constraint()
275 if (pmc) { in p6_get_constraint()
276 if (pmc > 4 && !(event == 0x500009 || event == 0x600005)) in p6_get_constraint()
278 sh = (pmc - 1) * 2; in p6_get_constraint()
293 if (pmc <= 4) { in p6_get_constraint()
304 int pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in p6_limited_pmc_event() local
306 return pmc == 5 || pmc == 6; in p6_limited_pmc_event()
363 unsigned int psel, pmc; in p6_get_alternatives() local
387 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; in p6_get_alternatives()
388 if (pmc && (psel == 0x32 || psel == 0x34)) in p6_get_alternatives()
390 ((5 - pmc) << PM_PMC_SH); in p6_get_alternatives()
393 if (pmc && (psel == 0x38 || psel == 0x3a)) in p6_get_alternatives()
395 ((pmc > 2? pmc - 2: pmc + 2) << PM_PMC_SH); in p6_get_alternatives()
438 /* remove the limited PMC events */ in p6_get_alternatives()
448 /* remove all but the limited PMC events */ in p6_get_alternatives()
462 static void p6_disable_pmc(unsigned int pmc, struct mmcr_regs *mmcr) in p6_disable_pmc() argument
465 if (pmc <= 3) in p6_disable_pmc()
466 mmcr->mmcr1 &= ~(0xffUL << MMCR1_PMCSEL_SH(pmc)); in p6_disable_pmc()