From c4ba76cc4f84a25b259e9089b5e49a6edc015f1d Mon Sep 17 00:00:00 2001 From: Remy Noel Date: Mon, 30 Apr 2018 20:30:08 +0200 Subject: perfmon: register a pmu_driver in place of pmu_ops. Replace pmu_get_width with a property. Prepare the default overfow handling. --- kern/perfmon.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'kern/perfmon.h') diff --git a/kern/perfmon.h b/kern/perfmon.h index b9a3882..cd7eb3a 100644 --- a/kern/perfmon.h +++ b/kern/perfmon.h @@ -65,10 +65,23 @@ struct perfmon_pmu_ops { void (*stop)(unsigned int pmc_id); uint64_t (*read)(unsigned int pmc_id); void (*write)(unsigned int pmc_id, uint64_t value); - uint8_t (*get_pmc_width)(void); + /* If set, of_max_ticks should be set to 0. */ void (*handle_of_intr)(void); }; +/* + * Pmu device description. + */ +struct perfmon_pmu_driver { + uint8_t pmc_width; /* width in bits of a pmc */ + /* + * Maximum number of clock ticks between two overflow ckecks. + * Should be set to 0 if handle_of_intr is set. + */ + uint64_t of_max_ticks; + struct perfmon_pmu_ops ops; +}; + /* * Performance monitoring event. * @@ -226,7 +239,7 @@ void perfmon_of_intr(void); /* * Register an architecture-specific driver. */ -int perfmon_pmu_register(struct perfmon_pmu_ops *driver); +int perfmon_pmu_register(struct perfmon_pmu_driver *driver); /* * Get the last value of given pmc. -- cgit v1.2.3