Lines Matching refs:cpu
96 soft_allocate_pmc(int cpu, int ri, struct pmc *pm, in soft_allocate_pmc() argument
102 (void) cpu; in soft_allocate_pmc()
104 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_allocate_pmc()
105 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_allocate_pmc()
135 soft_config_pmc(int cpu, int ri, struct pmc *pm) in soft_config_pmc() argument
139 PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); in soft_config_pmc()
141 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_config_pmc()
142 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_config_pmc()
146 phw = &soft_pcpu[cpu]->soft_hw[ri]; in soft_config_pmc()
158 soft_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) in soft_describe() argument
165 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_describe()
166 ("[soft,%d] illegal CPU %d", __LINE__, cpu)); in soft_describe()
170 phw = &soft_pcpu[cpu]->soft_hw[ri]; in soft_describe()
191 soft_get_config(int cpu, int ri, struct pmc **ppm) in soft_get_config() argument
195 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_get_config()
196 ("[soft,%d] illegal CPU %d", __LINE__, cpu)); in soft_get_config()
200 *ppm = soft_pcpu[cpu]->soft_hw[ri].phw_pmc; in soft_get_config()
205 soft_pcpu_fini(struct pmc_mdep *md, int cpu) in soft_pcpu_fini() argument
210 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_pcpu_fini()
211 ("[soft,%d] illegal cpu %d", __LINE__, cpu)); in soft_pcpu_fini()
212 KASSERT(soft_pcpu[cpu] != NULL, ("[soft,%d] null pcpu", __LINE__)); in soft_pcpu_fini()
214 free(soft_pcpu[cpu], M_PMC); in soft_pcpu_fini()
215 soft_pcpu[cpu] = NULL; in soft_pcpu_fini()
222 pc = pmc_pcpu[cpu]; in soft_pcpu_fini()
229 soft_pcpu_init(struct pmc_mdep *md, int cpu) in soft_pcpu_init() argument
237 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_pcpu_init()
238 ("[soft,%d] illegal cpu %d", __LINE__, cpu)); in soft_pcpu_init()
240 KASSERT(soft_pcpu[cpu] == NULL, ("[soft,%d] non-null per-cpu", in soft_pcpu_init()
244 pc = pmc_pcpu[cpu]; in soft_pcpu_init()
246 KASSERT(pc != NULL, ("[soft,%d] cpu %d null per-cpu", __LINE__, cpu)); in soft_pcpu_init()
248 soft_pcpu[cpu] = soft_pc; in soft_pcpu_init()
254 PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(n); in soft_pcpu_init()
263 soft_read_pmc(int cpu, int ri, pmc_value_t *v) in soft_read_pmc() argument
268 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_read_pmc()
269 ("[soft,%d] illegal CPU value %d", __LINE__, cpu)); in soft_read_pmc()
273 phw = &soft_pcpu[cpu]->soft_hw[ri]; in soft_read_pmc()
277 ("[soft,%d] no owner for PHW [cpu%d,pmc%d]", __LINE__, cpu, ri)); in soft_read_pmc()
281 *v = soft_pcpu[cpu]->soft_values[ri]; in soft_read_pmc()
287 soft_write_pmc(int cpu, int ri, pmc_value_t v) in soft_write_pmc() argument
292 KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), in soft_write_pmc()
293 ("[soft,%d] illegal cpu value %d", __LINE__, cpu)); in soft_write_pmc()
297 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()