Lines Matching refs:cpu

98 soft_allocate_pmc(int cpu, int ri, struct pmc *pm,  in soft_allocate_pmc()  argument
104 (void) cpu; in soft_allocate_pmc()
106 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_allocate_pmc()
107 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_allocate_pmc()
137 soft_config_pmc(int cpu, int ri, struct pmc *pm) in soft_config_pmc() argument
141 PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); in soft_config_pmc()
143 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_config_pmc()
144 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_config_pmc()
148 phw = &soft_pcpu[cpu]->soft_hw[ri]; in soft_config_pmc()
160 soft_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) in soft_describe() argument
167 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_describe()
168 ("[soft,%d] illegal CPU %d", __LINE__, cpu)); in soft_describe()
172 phw = &soft_pcpu[cpu]->soft_hw[ri]; in soft_describe()
193 soft_get_config(int cpu, int ri, struct pmc **ppm) in soft_get_config() argument
197 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_get_config()
198 ("[soft,%d] illegal CPU %d", __LINE__, cpu)); in soft_get_config()
202 *ppm = soft_pcpu[cpu]->soft_hw[ri].phw_pmc; in soft_get_config()
207 soft_pcpu_fini(struct pmc_mdep *md, int cpu) in soft_pcpu_fini() argument
212 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_pcpu_fini()
213 ("[soft,%d] illegal cpu %d", __LINE__, cpu)); in soft_pcpu_fini()
214 KASSERT(soft_pcpu[cpu] != NULL, ("[soft,%d] null pcpu", __LINE__)); in soft_pcpu_fini()
216 free(soft_pcpu[cpu], M_PMC); in soft_pcpu_fini()
217 soft_pcpu[cpu] = NULL; in soft_pcpu_fini()
224 pc = pmc_pcpu[cpu]; in soft_pcpu_fini()
231 soft_pcpu_init(struct pmc_mdep *md, int cpu) in soft_pcpu_init() argument
239 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_pcpu_init()
240 ("[soft,%d] illegal cpu %d", __LINE__, cpu)); in soft_pcpu_init()
242 KASSERT(soft_pcpu[cpu] == NULL, ("[soft,%d] non-null per-cpu", in soft_pcpu_init()
246 pc = pmc_pcpu[cpu]; in soft_pcpu_init()
248 KASSERT(pc != NULL, ("[soft,%d] cpu %d null per-cpu", __LINE__, cpu)); in soft_pcpu_init()
250 soft_pcpu[cpu] = soft_pc; in soft_pcpu_init()
256 PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(n); in soft_pcpu_init()
265 soft_read_pmc(int cpu, int ri, pmc_value_t *v) in soft_read_pmc() argument
270 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_read_pmc()
271 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_read_pmc()
275 phw = &soft_pcpu[cpu]->soft_hw[ri]; in soft_read_pmc()
279 ("[soft,%d] no owner for PHW [cpu%d,pmc%d]", __LINE__, cpu, ri)); in soft_read_pmc()
283 *v = soft_pcpu[cpu]->soft_values[ri]; in soft_read_pmc()
289 soft_write_pmc(int cpu, int ri, pmc_value_t v) in soft_write_pmc() argument
293 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_write_pmc()
294 ("[soft,%d] illegal cpu value %d", __LINE__, cpu)); in soft_write_pmc()
298 pm = soft_pcpu[cpu]->soft_hw[ri].phw_pmc; in soft_write_pmc()
301 ("[soft,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri)); in soft_write_pmc()
303 PMCDBG3(MDP,WRI,1, "soft-write cpu=%d ri=%d v=%jx", cpu, ri, v); in soft_write_pmc()
305 soft_pcpu[cpu]->soft_values[ri] = v; in soft_write_pmc()
311 soft_release_pmc(int cpu, int ri, struct pmc *pmc) in soft_release_pmc() argument
319 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_release_pmc()
320 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_release_pmc()
324 phw = &soft_pcpu[cpu]->soft_hw[ri]; in soft_release_pmc()
343 soft_start_pmc(int cpu, int ri) in soft_start_pmc() argument
349 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_start_pmc()
350 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_start_pmc()
354 pc = soft_pcpu[cpu]; in soft_start_pmc()
358 ("[soft,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri)); in soft_start_pmc()
370 soft_stop_pmc(int cpu, int ri) in soft_stop_pmc() argument
376 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_stop_pmc()
377 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_stop_pmc()
381 pc = soft_pcpu[cpu]; in soft_stop_pmc()
385 ("[soft,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri)); in soft_stop_pmc()