Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_arm64.c
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | arm64_pmcn_write(unsigned int pmc, uint32_t reg) | ||||
isb(); | isb(); | ||||
} | } | ||||
static int | static int | ||||
arm64_allocate_pmc(int cpu, int ri, struct pmc *pm, | arm64_allocate_pmc(int cpu, int ri, struct pmc *pm, | ||||
const struct pmc_op_pmcallocate *a) | const struct pmc_op_pmcallocate *a) | ||||
{ | { | ||||
uint32_t caps, config; | uint32_t config; | ||||
struct arm64_cpu *pac; | struct arm64_cpu *pac; | ||||
enum pmc_event pe; | enum pmc_event pe; | ||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), | KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), | ||||
("[arm64,%d] illegal CPU value %d", __LINE__, cpu)); | ("[arm64,%d] illegal CPU value %d", __LINE__, cpu)); | ||||
KASSERT(ri >= 0 && ri < arm64_npmcs, | KASSERT(ri >= 0 && ri < arm64_npmcs, | ||||
("[arm64,%d] illegal row index %d", __LINE__, ri)); | ("[arm64,%d] illegal row index %d", __LINE__, ri)); | ||||
pac = arm64_pcpu[cpu]; | pac = arm64_pcpu[cpu]; | ||||
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 = a->pm_md.pm_md_config; | 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) { | ||||
▲ Show 20 Lines • Show All 413 Lines • Show Last 20 Lines |