arm64: Fix hwpmc module for OPT_ACPI isn't selected

Fixes: 59191f3573 ("Add support of ARM CMN-600 controller ...")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
This commit is contained in:
Emmanuel Vadot 2022-08-29 11:50:52 +02:00
parent 24af7808fa
commit 0a9a4d2cd6
2 changed files with 8 additions and 0 deletions

View File

@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
#include <machine/pmc_mdep.h>
#include <machine/cpu.h>
#include "opt_acpi.h"
static int arm64_npmcs;
struct arm64_event_code_map {
@ -564,11 +566,13 @@ pmc_arm64_initialize(void)
/* One AArch64 CPU class */
classes = 1;
#ifdef DEV_ACPI
/* Query presence of optional classes and set max class. */
if (pmc_cmn600_nclasses() > 0)
classes = MAX(classes, PMC_MDEP_CLASS_INDEX_CMN600);
if (pmc_dmc620_nclasses() > 0)
classes = MAX(classes, PMC_MDEP_CLASS_INDEX_DMC620_C);
#endif
pmc_mdep = pmc_mdep_alloc(classes);
@ -619,12 +623,14 @@ pmc_arm64_initialize(void)
pmc_mdep->pmd_npmc += arm64_npmcs;
#ifdef DEV_ACPI
if (pmc_cmn600_nclasses() > 0)
pmc_cmn600_initialize(pmc_mdep);
if (pmc_dmc620_nclasses() > 0) {
pmc_dmc620_initialize_cd2(pmc_mdep);
pmc_dmc620_initialize_c(pmc_mdep);
}
#endif
return (pmc_mdep);
}

View File

@ -12,9 +12,11 @@ SRCS+= vnode_if.h
.if ${MACHINE_CPUARCH} == "aarch64"
SRCS+= hwpmc_arm64.c hwpmc_arm64_md.c
.if !empty(OPT_ACPI)
SRCS+= cmn600.c hwpmc_cmn600.c
SRCS+= hwpmc_dmc620.c pmu_dmc620.c
.endif
.endif
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_tsc.c