lib: sbi: Implement Sstc extension
authorAtish Patra <atishp@rivosinc.com>
Tue, 26 Apr 2022 06:29:22 +0000 (23:29 -0700)
committerAnup Patel <anup@brainfault.org>
Thu, 28 Apr 2022 06:15:21 +0000 (11:45 +0530)
commitd62f6da062ad0fcc3bdc042a3f3b200d91d18afd
treec26f03e59440fd15c0b6639633645dcd45114b76
parent4035ae94be802a68f8e8408a84b77f531d59416b
lib: sbi: Implement Sstc extension

Recently, Sstc extension was ratified. It defines stimecmp which allows
the supervisor mode to directly update the timecmp value without the
need of the SBI call. The hardware also can inject the S-mode timer
interrupt direclty to the supervisor without going through the M-mode.
To maintain backward compatibility with the older software, SBI call
now uses stimecmp directly if the hardware supports.

Implement the Sstc extension.

Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
include/sbi/riscv_encoding.h
include/sbi/sbi_hart.h
lib/sbi/sbi_hart.c
lib/sbi/sbi_timer.c