aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/cppc
diff options
context:
space:
mode:
authorYao Zi <ziyao@disroot.org>2025-05-16 13:33:52 +0000
committerAnup Patel <anup@brainfault.org>2025-05-20 13:25:53 +0530
commit7e31dc80525f752d97c2c5a97eb4b9583054e8bc (patch)
treea04b28f15cf9b349459c50509549ca2da6fad906 /lib/utils/cppc
parent2bb76326496440996b44bf20f3ceab127c7f72ae (diff)
downloadopensbi-7e31dc80525f752d97c2c5a97eb4b9583054e8bc.zip
opensbi-7e31dc80525f752d97c2c5a97eb4b9583054e8bc.tar.gz
opensbi-7e31dc80525f752d97c2c5a97eb4b9583054e8bc.tar.bz2
lib: sbi: hart: Detect existence of cycle and instret CSRs for Zicntr
Zicntr extension specifies three read-only CSRs, time, cycle and instret. It isn't sufficient to report Zicntr is fully supported with only time CSR detected. This patch introduces a bitmap to sbi_hart_features to record availability of these CSRs, which are detected using traps. Zicntr is reported as present if and only if three CSRs are all available on the HARTs. Sites originally depending on SBI_HART_EXT_ZICNTR for detecting existence of time CSR are switched to detect SBI_HART_CSR_TIME instead. Suggested-by: Anup Patel <anup@brainfault.org> Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20250516133352.36617-3-ziyao@disroot.org Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/cppc')
0 files changed, 0 insertions, 0 deletions