Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_armv7.c
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
armv7_allocate_pmc(int cpu, int ri, struct pmc *pm, | armv7_allocate_pmc(int cpu, int ri, struct pmc *pm, | ||||
const struct pmc_op_pmcallocate *a) | const struct pmc_op_pmcallocate *a) | ||||
{ | { | ||||
struct armv7_cpu *pac; | struct armv7_cpu *pac; | ||||
enum pmc_event pe; | enum pmc_event pe; | ||||
uint32_t config; | uint32_t config; | ||||
uint32_t caps; | |||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), | KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), | ||||
("[armv7,%d] illegal CPU value %d", __LINE__, cpu)); | ("[armv7,%d] illegal CPU value %d", __LINE__, cpu)); | ||||
KASSERT(ri >= 0 && ri < armv7_npmcs, | KASSERT(ri >= 0 && ri < armv7_npmcs, | ||||
("[armv7,%d] illegal row index %d", __LINE__, ri)); | ("[armv7,%d] illegal row index %d", __LINE__, ri)); | ||||
pac = armv7_pcpu[cpu]; | pac = armv7_pcpu[cpu]; | ||||
caps = a->pm_caps; | |||||
if (a->pm_class != PMC_CLASS_ARMV7) | if (a->pm_class != PMC_CLASS_ARMV7) | ||||
return (EINVAL); | return (EINVAL); | ||||
pe = a->pm_ev; | pe = a->pm_ev; | ||||
config = (pe & EVENT_ID_MASK); | config = (pe & EVENT_ID_MASK); | ||||
pm->pm_md.pm_armv7.pm_armv7_evsel = config; | pm->pm_md.pm_armv7.pm_armv7_evsel = config; | ||||
PMCDBG2(MDP, ALL, 2, "armv7-allocate ri=%d -> config=0x%x", ri, config); | PMCDBG2(MDP, ALL, 2, "armv7-allocate ri=%d -> config=0x%x", ri, config); | ||||
▲ Show 20 Lines • Show All 408 Lines • Show Last 20 Lines |