summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMayuresh Chitale <mchitale@ventanamicro.com>2023-03-09 16:13:51 +0300
committerAnup Patel <anup@brainfault.org>2023-03-10 11:16:52 +0300
commit1fe8dc995566d869836d3caf37e427c28536f453 (patch)
treeab708c7d847836efb1a8f6b6a263b6233713f0ed /include
parent506144f398b7911a2395d127fb6a64082a4a79cc (diff)
downloadopensbi-1fe8dc995566d869836d3caf37e427c28536f453.tar.xz
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 <mchitale@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_pmu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sbi/sbi_pmu.h b/include/sbi/sbi_pmu.h
index c365243..b3b75c1 100644
--- a/include/sbi/sbi_pmu.h
+++ b/include/sbi/sbi_pmu.h
@@ -42,6 +42,11 @@ struct sbi_pmu_device {
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
*/