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
2023-08-11 08:24:43 +08:00
committed by Anup Patel
parent e7e73aa532
commit ee1f83ca84
5 changed files with 37 additions and 34 deletions

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; \