lib: sbi: Detect mcountinihibit support at runtime
authorAtish Patra <atish.patra@wdc.com>
Sat, 10 Jul 2021 16:18:03 +0000 (09:18 -0700)
committerAnup Patel <anup@brainfault.org>
Sun, 11 Jul 2021 04:41:10 +0000 (10:11 +0530)
commitfde28fadc2603c7c7a4afa7c2e7b96cc7b11d2e2
tree5b473fe4342a31d47ba988d93c8730409e28a993
parent3e8b31aca988955800d15329f1d4e48b4fbe7233
lib: sbi: Detect mcountinihibit support at runtime

RISC-V ISA specification v1.11 defined mcountinhibit CSR that allows
software to stop any counter from incrementing. The SBI PMU extension
depends on this CSR support in hardware.

Define mcountinhibit as a hart specific feature and detect it at runtime.

Reviewed-by: Anup Patel <anup.patel@wdc.com>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
include/sbi/sbi_hart.h
lib/sbi/sbi_hart.c