Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_arm64.c
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | arm64_allocate_pmc(int cpu, int ri, struct pmc *pm, | ||||
pac = arm64_pcpu[cpu]; | pac = arm64_pcpu[cpu]; | ||||
caps = a->pm_caps; | caps = a->pm_caps; | ||||
if (a->pm_class != PMC_CLASS_ARMV8) { | if (a->pm_class != PMC_CLASS_ARMV8) { | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
pe = a->pm_ev; | pe = a->pm_ev; | ||||
config = (pe & EVENT_ID_MASK); | config = (uint32_t)pe - PMC_EV_ARMV8_FIRST; | ||||
if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST)) | |||||
return (EINVAL); | |||||
pm->pm_md.pm_arm64.pm_arm64_evsel = config; | pm->pm_md.pm_arm64.pm_arm64_evsel = config; | ||||
PMCDBG2(MDP, ALL, 2, "arm64-allocate ri=%d -> config=0x%x", ri, config); | PMCDBG2(MDP, ALL, 2, "arm64-allocate ri=%d -> config=0x%x", ri, config); | ||||
return 0; | return 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 386 Lines • Show Last 20 Lines |