From 1fe8dc995566d869836d3caf37e427c28536f453 Mon Sep 17 00:00:00 2001 From: Mayuresh Chitale Date: Thu, 9 Mar 2023 18:43:51 +0530 Subject: lib: sbi_pmu: add callback for counter width This patch adds a callback to fetch the number of bits implemented for a custom firmware counter. If the callback fails or is not implemented then width defaults to 63. Signed-off-by: Mayuresh Chitale Reviewed-by: Atish Patra Reviewed-by: Anup Patel --- include/sbi/sbi_pmu.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/sbi/sbi_pmu.h b/include/sbi/sbi_pmu.h index c3652439..b3b75c1b 100644 --- a/include/sbi/sbi_pmu.h +++ b/include/sbi/sbi_pmu.h @@ -41,6 +41,11 @@ struct sbi_pmu_device { bool (*fw_counter_match_code)(uint32_t counter_index, uint32_t event_idx_code); + /** + * Fetch the max width of this counter in number of bits. + */ + int (*fw_counter_width)(void); + /** * Read value of custom firmware counter * Note: 0 <= counter_index < SBI_PMU_FW_CTR_MAX -- cgit v1.3.1