diff options
| author | Atish Patra <[email protected]> | 2021-11-08 10:52:58 -0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2021-11-11 17:42:59 +0530 |
| commit | 867c65360df283f056afa963ad8333e9c1eb21bb (patch) | |
| tree | 9757f8fb87e66a09d195ec18bc57e44882db94ed /include | |
| parent | 7084ad9f4281eecd7a7f66cecfd7d9cff8d452ad (diff) | |
lib: sbi: Detect Sscofpmf extension at run time
Sscofpmf ISA extension introduces PMU counter overflow and filtering support.
It introduces a read only `scountovf` csr that can be used to detect if
a hart supports this extension at runtime. However, this feature is only
useful if the hart already supports mcounteren and mcountinhibit.
Add a dynamic detection mechanism and boot time print message if sscofpmf
is present.
Reviewed-by: Anup Patel <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Signed-off-by: Atish Patra <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_hart.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index 0c18ef93..d2db9d6e 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -20,8 +20,10 @@ enum sbi_hart_features { SBI_HART_HAS_MCOUNTEREN = (1 << 1), /** Hart has counter inhibit CSR */ SBI_HART_HAS_MCOUNTINHIBIT = (1 << 2), + /** Hart has sscofpmf extension */ + SBI_HART_HAS_SSCOFPMF = (1 << 3), /** HART has timer csr implementation in hardware */ - SBI_HART_HAS_TIME = (1 << 3), + SBI_HART_HAS_TIME = (1 << 4), /** Last index of Hart features*/ SBI_HART_HAS_LAST_FEATURE = SBI_HART_HAS_TIME, |
