Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_arm64.c
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | arm64_allocate_pmc(int cpu, int ri, struct pmc *pm, | ||||
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; | ||||
/* Adjust the config value if needed. */ | /* Adjust the config value if needed. */ | ||||
config = (uint32_t)pe; | config = a->pm_md.pm_md_config; | ||||
if ((a->pm_md.pm_md_flags & PM_MD_RAW_EVENT) == 0) { | if ((a->pm_md.pm_md_flags & PM_MD_RAW_EVENT) == 0) { | ||||
config -= PMC_EV_ARMV8_FIRST; | config = (uint32_t)pe - PMC_EV_ARMV8_FIRST; | ||||
if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST)) | if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST)) | ||||
return (EINVAL); | 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 404 Lines • Show Last 20 Lines |