Lines Matching refs:pm
135 armv7_allocate_pmc(int cpu, int ri, struct pmc *pm, in armv7_allocate_pmc() argument
151 pm->pm_md.pm_armv7.pm_armv7_evsel = config; in armv7_allocate_pmc()
160 armv7_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v) in armv7_read_pmc() argument
172 tmp = armv7_pmcn_read(ri, pm->pm_md.pm_armv7.pm_armv7_evsel); in armv7_read_pmc()
175 if (pm->pm_md.pm_armv7.pm_armv7_evsel == PMC_EV_CPU_CYCLES) in armv7_read_pmc()
183 pm->pm_pcpu_state[cpu].pps_overflowcnt++; in armv7_read_pmc()
186 tmp = armv7_pmcn_read(ri, pm->pm_md.pm_armv7.pm_armv7_evsel); in armv7_read_pmc()
188 tmp += 0x100000000llu * pm->pm_pcpu_state[cpu].pps_overflowcnt; in armv7_read_pmc()
192 if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { in armv7_read_pmc()
209 armv7_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v) in armv7_write_pmc() argument
217 if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) in armv7_write_pmc()
222 pm->pm_pcpu_state[cpu].pps_overflowcnt = v >> 32; in armv7_write_pmc()
223 if (pm->pm_md.pm_armv7.pm_armv7_evsel == PMC_EV_CPU_CYCLES) in armv7_write_pmc()
232 armv7_config_pmc(int cpu, int ri, struct pmc *pm) in armv7_config_pmc() argument
236 PMCDBG3(MDP, CFG, 1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); in armv7_config_pmc()
245 KASSERT(pm == NULL || phw->phw_pmc == NULL, in armv7_config_pmc()
247 __LINE__, pm, phw->phw_pmc)); in armv7_config_pmc()
249 phw->phw_pmc = pm; in armv7_config_pmc()
255 armv7_start_pmc(int cpu, int ri, struct pmc *pm) in armv7_start_pmc() argument
259 config = pm->pm_md.pm_armv7.pm_armv7_evsel; in armv7_start_pmc()
280 armv7_stop_pmc(int cpu, int ri, struct pmc *pm) in armv7_stop_pmc() argument
284 config = pm->pm_md.pm_armv7.pm_armv7_evsel; in armv7_stop_pmc()
318 struct pmc *pm; in armv7_intr() local
329 pm = armv7_pcpu[cpu]->pc_armv7pmcs[ri].phw_pmc; in armv7_intr()
330 if (pm == NULL) in armv7_intr()
334 if (pm->pm_md.pm_armv7.pm_armv7_evsel == PMC_EV_CPU_CYCLES) in armv7_intr()
348 pm->pm_pcpu_state[cpu].pps_overflowcnt += 1; in armv7_intr()
350 if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) in armv7_intr()
353 if (pm->pm_state != PMC_STATE_RUNNING) in armv7_intr()
356 error = pmc_process_interrupt(PMC_HR, pm, tf); in armv7_intr()
358 armv7_stop_pmc(cpu, ri, pm); in armv7_intr()
361 armv7_write_pmc(cpu, ri, pm, pm->pm_sc.pm_reloadcount); in armv7_intr()