HomeFreeBSD

riscv: Fix SSTC extension support

Description

riscv: Fix SSTC extension support

From the SSTC spec:
"If the stimecmp (supervisor-mode timer compare) register is implemented,
then STIP is read-only in mip and reflects the supervisor-level timer
interrupt signal resulting from stimecmp. This timer interrupt signal
is cleared by writing stimecmp with a value greater than the current time
value."

This fixes operation in Spike with sstc extension enabled.
Example:

spike --isa RV64IMAFDCH_zicntr_zihpm_sstc

Reviewed by: mhorne
Differential Revision: https://reviews.freebsd.org/D45226

(cherry picked from commit ddd0d4f4cd65341a07bb3bb833dee7982018fd60)

Details

Provenance
brAuthored on May 22 2024, 2:51 PM
mhorneCommitted on Sep 15 2025, 7:32 PM
Reviewer
mhorne
Differential Revision
D45226: Fix SSTC extension support
Parents
rGaacf2678b67b: ports.7: Fix example of passing variables on the command line
Branches
Unknown
Tags
Unknown