diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-08-19 17:31:37 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-09-01 10:28:31 +0530 |
commit | 2c341f7844f439017c9aab42ae92e919c3b98253 (patch) | |
tree | e1140a8dca11b40b895cd70c58bc052d6e9722f2 /include | |
parent | 74d1db706293f42f5a4e87c907978339b2d0993d (diff) |
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 <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sbi/sbi_hart.h | 1 |
1 files changed, 1 insertions, 0 deletions
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, |