lib: sbi_pmu: remove mhpm_count field in hart feature

After supporting noncontigous hpm event and counters in opensbi, the
number of hpm counters can be calculated by the mhpm_mask. So this field
is unnecessary and can be removed to save some space.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
Reviewed-by: Anup Patel  <anup@brainfault.org>
This commit is contained in:
Inochi Amaoto authored and Anup Patel committed 2023-08-22 13:26:09 +05:30
1 parent e7e73aa532
commit ee1f83ca84
5 files changed
+37 -34

No files matched your search

+1 -1
View File
@@ -109,7 +109,7 @@ int sbi_emulate_csr_read(int csr_num, struct sbi_trap_regs *regs,
#define switchcase_hpm(__uref, __mref, __csr) \
case __csr: \
if ((sbi_hart_mhpm_count(scratch) + 3) <= (__csr - __uref))\
if (sbi_hart_mhpm_mask(scratch) & (1 << (__csr - __uref)))\
return SBI_ENOTSUPP; \
if (!hpm_allowed(__csr - __uref, prev_mode, virt)) \
return SBI_ENOTSUPP; \