aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2023-12-07 14:23:50 -0800
committerAnup Patel <anup@brainfault.org>2023-12-08 22:50:23 +0530
commit11a0ba5d4bce74b2573091c5533717c2871191f1 (patch)
tree263754bc57d322303f8cfc46fb839641e2f086e8 /include
parentee725174bada254f8a081937d870feb837618d6e (diff)
downloadopensbi-11a0ba5d4bce74b2573091c5533717c2871191f1.zip
opensbi-11a0ba5d4bce74b2573091c5533717c2871191f1.tar.gz
opensbi-11a0ba5d4bce74b2573091c5533717c2871191f1.tar.bz2
lib: sbi_pmu: Fix the counter info function
The counter info should only return valid hardware counters for the ones set in the counter mask. Otherwise, it will report incorrect number of hardware counters to the supervisor if the platform has discontiguous counters. Fixes: c744ed77b18c ("lib: sbi_pmu: Enable noncontigous hpm event and counters") Signed-off-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_pmu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sbi/sbi_pmu.h b/include/sbi/sbi_pmu.h
index d63149c..7d32a4d 100644
--- a/include/sbi/sbi_pmu.h
+++ b/include/sbi/sbi_pmu.h
@@ -23,6 +23,7 @@ struct sbi_scratch;
#define SBI_PMU_HW_CTR_MAX 32
#define SBI_PMU_CTR_MAX (SBI_PMU_HW_CTR_MAX + SBI_PMU_FW_CTR_MAX)
#define SBI_PMU_FIXED_CTR_MASK 0x07
+#define SBI_PMU_CY_IR_MASK 0x05
struct sbi_pmu_device {
/** Name of the PMU platform device */