From 2c341f7844f439017c9aab42ae92e919c3b98253 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Wed, 19 Aug 2020 17:31:37 +0530 Subject: lib: sbi: Detect and print MHPM counters at boot-time A RISC-V platform can leave unimplemented MHPM counters hard-wired to zero. We extend hart_detect_features() to detect MHPM counters which are accessible and not hard-wired to zero. We also print number of available MHPM counters as part of boot prints. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- include/sbi/sbi_hart.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sbi') diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index c2ea686..1e1eb67 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -35,6 +35,7 @@ static inline ulong sbi_hart_expected_trap_addr(void) return (ulong)sbi_hart_expected_trap; } +unsigned int sbi_hart_mhpm_count(struct sbi_scratch *scratch); void sbi_hart_delegation_dump(struct sbi_scratch *scratch); unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch); int sbi_hart_pmp_get(struct sbi_scratch *scratch, unsigned int n, -- cgit v1.2.3