summaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
authorMayuresh Chitale <[email protected]>2023-08-02 16:45:23 +0530
committerAnup Patel <[email protected]>2023-08-06 10:09:25 +0530
commitc744ed77b18cd2c3c6deb77a53f6a6e67de2d153 (patch)
tree3ff0545fb3b18d4f221192838d66b68c01864521 /include/sbi
parentf536e0b02e7e29abc7e6d845939a8c9fb00ab7e1 (diff)
lib: sbi_pmu: Enable noncontigous hpm event and counters
Platforms may implement hpm events/counters non contiguously but the current implementation assumes them to be always contigous. Add a bitmap that captures the hpm events/counters as implemented in the hardware and use it to set the max limit of hardware counters visible to the OS. Counters not implemented in the hardware can't be used by the OS because those wont be described in the DT. Signed-off-by: Mayuresh Chitale <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include/sbi')
-rw-r--r--include/sbi/sbi_hart.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
index c150b7e4..1310198b 100644
--- a/include/sbi/sbi_hart.h
+++ b/include/sbi/sbi_hart.h
@@ -68,6 +68,7 @@ struct sbi_hart_features {
unsigned int pmp_addr_bits;
unsigned long pmp_gran;
unsigned int mhpm_count;
+ unsigned int mhpm_mask;
unsigned int mhpm_bits;
};
@@ -83,6 +84,7 @@ static inline ulong sbi_hart_expected_trap_addr(void)
}
unsigned int sbi_hart_mhpm_count(struct sbi_scratch *scratch);
+unsigned int sbi_hart_mhpm_mask(struct sbi_scratch *scratch);
void sbi_hart_delegation_dump(struct sbi_scratch *scratch,
const char *prefix, const char *suffix);
unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch);