summaryrefslogtreecommitdiff
path: root/arch/x86/machine/pmu_amd.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/machine/pmu_amd.c')
-rw-r--r--arch/x86/machine/pmu_amd.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/arch/x86/machine/pmu_amd.c b/arch/x86/machine/pmu_amd.c
index 105ba50..34df620 100644
--- a/arch/x86/machine/pmu_amd.c
+++ b/arch/x86/machine/pmu_amd.c
@@ -237,18 +237,12 @@ pmu_amd_handle_of_intr_v1(void)
}
}
-static uint8_t
-pmu_amd_get_pmc_width(void)
-{
- return PMU_AMD_PMC_WIDTH;
-}
-
static int __init
pmu_amd_setup(void)
{
const struct cpu *cpu;
struct pmu_amd *pmu;
- struct perfmon_pmu_ops pmu_driver;
+ struct perfmon_pmu_driver pmu_driver;
cpu = cpu_current();
@@ -264,16 +258,17 @@ pmu_amd_setup(void)
pmu = pmu_amd_get();
pmu->pmc_bm = (1U << PMU_AMD_NR_PMCS) - 1;
- pmu_driver.info = pmu_amd_info;
- pmu_driver.translate = pmu_amd_translate;
- pmu_driver.alloc = pmu_amd_alloc;
- pmu_driver.free = pmu_amd_free;
- pmu_driver.start = pmu_amd_start;
- pmu_driver.stop = pmu_amd_stop;
- pmu_driver.read = pmu_amd_read;
- pmu_driver.write = pmu_amd_write;
- pmu_driver.get_pmc_width = pmu_amd_get_pmc_width;
- pmu_driver.handle_of_intr = pmu_amd_handle_of_intr_v1;
+ pmu_driver.pmc_width = PMU_AMD_PMC_WIDTH;
+ pmu_driver.of_max_ticks = 1UL << (pmu_driver.pmc_width - 1);
+
+ pmu_driver.ops.info = pmu_amd_info;
+ pmu_driver.ops.translate = pmu_amd_translate;
+ pmu_driver.ops.alloc = pmu_amd_alloc;
+ pmu_driver.ops.free = pmu_amd_free;
+ pmu_driver.ops.start = pmu_amd_start;
+ pmu_driver.ops.stop = pmu_amd_stop;
+ pmu_driver.ops.read = pmu_amd_read;
+ pmu_driver.ops.write = pmu_amd_write;
return perfmon_pmu_register(&pmu_driver);
}