diff options
author | Anup Patel <apatel@ventanamicro.com> | 2022-04-28 18:59:22 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-05-07 07:46:30 +0300 |
commit | cad6c91045331009f38d13f63956a119b0b053c8 (patch) | |
tree | 5a3ea1d046f2085f2ebee231598f4199626d85c0 /lib/sbi/sbi_timer.c | |
parent | a6ab94fdbf5f8bd7154ea86b8ee83f7ec394851a (diff) | |
download | opensbi-cad6c91045331009f38d13f63956a119b0b053c8.tar.xz |
lib: sbi: Convert hart features into hart extensions
Since past few years, we have been using "hart features" in OpenSBI
to represent all optionalities and multi-letter extensions defined
by the RISC-V specifications.
The RISC-V profiles specification has taken a different approach and
started assigning extension names for all optionalities which did not
have any extension name previously.
(Refer, https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc)
Inspired from the RISC-V profiles specification, we convert OpenSBI
hart features into hart extensions. Going forward, we align the
extension naming with RISC-V profiles specification. Currently, only
"time CSR" and "AIA CSR" have not been assigned extension name but
for everything else we have a name.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Diffstat (limited to 'lib/sbi/sbi_timer.c')
-rw-r--r-- | lib/sbi/sbi_timer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sbi/sbi_timer.c b/lib/sbi/sbi_timer.c index bf0f375..353886f 100644 --- a/lib/sbi/sbi_timer.c +++ b/lib/sbi/sbi_timer.c @@ -129,7 +129,7 @@ void sbi_timer_event_start(u64 next_event) * Update the stimecmp directly if available. This allows * the older software to leverage sstc extension on newer hardware. */ - if (sbi_hart_has_feature(sbi_scratch_thishart_ptr(), SBI_HART_HAS_SSTC)) { + if (sbi_hart_has_extension(sbi_scratch_thishart_ptr(), SBI_HART_EXT_SSTC)) { #if __riscv_xlen == 32 csr_write(CSR_STIMECMP, next_event & 0xFFFFFFFF); csr_write(CSR_STIMECMPH, next_event >> 32); @@ -151,7 +151,7 @@ void sbi_timer_process(void) * directly without M-mode come in between. This function should * only invoked if M-mode programs the timer for its own purpose. */ - if (!sbi_hart_has_feature(sbi_scratch_thishart_ptr(), SBI_HART_HAS_SSTC)) + if (!sbi_hart_has_extension(sbi_scratch_thishart_ptr(), SBI_HART_EXT_SSTC)) csr_set(CSR_MIP, MIP_STIP); } @@ -180,7 +180,7 @@ int sbi_timer_init(struct sbi_scratch *scratch, bool cold_boot) if (!time_delta_off) return SBI_ENOMEM; - if (sbi_hart_has_feature(scratch, SBI_HART_HAS_TIME)) + if (sbi_hart_has_extension(scratch, SBI_HART_EXT_TIME)) get_time_val = get_ticks; } else { if (!time_delta_off) |