Lines Matching defs:cpu

36 #include <machine/cpu.h>
164 arm64_allocate_pmc(int cpu, int ri, struct pmc *pm,
170 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
171 ("[arm64,%d] illegal CPU value %d", __LINE__, cpu));
225 arm64_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v)
231 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
232 ("[arm64,%d] illegal CPU value %d", __LINE__, cpu));
245 pm->pm_pcpu_state[cpu].pps_overflowcnt++;
250 tmp += 0x100000000llu * pm->pm_pcpu_state[cpu].pps_overflowcnt;
271 arm64_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v)
274 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
275 ("[arm64,%d] illegal CPU value %d", __LINE__, cpu));
282 PMCDBG3(MDP, WRI, 1, "arm64-write cpu=%d ri=%d v=%jx", cpu, ri, v);
284 pm->pm_pcpu_state[cpu].pps_overflowcnt = v >> 32;
291 arm64_config_pmc(int cpu, int ri, struct pmc *pm)
295 PMCDBG3(MDP, CFG, 1, "cpu=%d ri=%d pm=%p", cpu, ri, pm);
297 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
298 ("[arm64,%d] illegal CPU value %d", __LINE__, cpu));
302 phw = &arm64_pcpu[cpu]->pc_arm64pmcs[ri];
314 arm64_start_pmc(int cpu, int ri, struct pmc *pm)
338 arm64_stop_pmc(int cpu, int ri, struct pmc *pm __unused)
350 arm64_release_pmc(int cpu, int ri, struct pmc *pmc)
354 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
355 ("[arm64,%d] illegal CPU value %d", __LINE__, cpu));
359 phw = &arm64_pcpu[cpu]->pc_arm64pmcs[ri];
372 int reg, cpu;
374 cpu = curcpu;
375 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
376 ("[arm64,%d] CPU %d out of range", __LINE__, cpu));
378 PMCDBG3(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *)tf,
384 pm = arm64_pcpu[cpu]->pc_arm64pmcs[ri].phw_pmc;
398 pm->pm_pcpu_state[cpu].pps_overflowcnt += 1;
408 arm64_stop_pmc(cpu, ri, pm);
411 arm64_write_pmc(cpu, ri, pm, pm->pm_sc.pm_reloadcount);
418 arm64_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc)
422 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
423 ("[arm64,%d], illegal CPU %d", __LINE__, cpu));
427 phw = &arm64_pcpu[cpu]->pc_arm64pmcs[ri];
444 arm64_get_config(int cpu, int ri, struct pmc **ppm)
447 *ppm = arm64_pcpu[cpu]->pc_arm64pmcs[ri].phw_pmc;
453 arm64_pcpu_init(struct pmc_mdep *md, int cpu)
462 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
463 ("[arm64,%d] wrong cpu number %d", __LINE__, cpu));
466 arm64_pcpu[cpu] = pac = malloc(sizeof(struct arm64_cpu), M_PMC,
471 pc = pmc_pcpu[cpu];
473 KASSERT(pc != NULL, ("[arm64,%d] NULL per-cpu pointer", __LINE__));
477 PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(i);
501 arm64_pcpu_fini(struct pmc_mdep *md, int cpu)
511 free(arm64_pcpu[cpu]->pc_arm64pmcs, M_PMC);
512 free(arm64_pcpu[cpu], M_PMC);
513 arm64_pcpu[cpu] = NULL;
629 ("[arm64,%d] non-null pcpu cpu %d", __LINE__, i));