Page MenuHomeFreeBSD

riscv timer: use stimecmp CSR when available

Authored by mhorne on May 23 2023, 5:16 PM.
Referenced Files
Unknown Object (File)
Sat, Sep 30, 6:11 AM
Unknown Object (File)
Mon, Sep 25, 3:09 PM
Unknown Object (File)
Mon, Sep 11, 11:44 AM
Unknown Object (File)
Tue, Sep 5, 11:59 PM
Unknown Object (File)
Aug 27 2023, 12:01 PM
Unknown Object (File)
Aug 10 2023, 9:02 AM
Unknown Object (File)
Jul 7 2023, 10:50 AM
Unknown Object (File)
Jun 21 2023, 3:41 PM



The Sstc extension defines a new stimecmp CSR, allowing supervisor
software to set the timer, rather than just read it. When supported,
using this avoids the frequent trips through the SBI every time the
CPU's timer expires.

Diff Detail

rG FreeBSD src repository
Lint Passed
No Test Coverage
Build Status
Buildable 51645
Build 48536: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.May 23 2023, 9:03 PM

Thanks for adding this - I was recently trying to debug RISC-V issues using qemu tracing and the constant SBI calls meant that it made essentially zero progress since tracing slowed down qemu so much that the next timer interrupt fired once it returned from the sbi call.

This revision was automatically updated to reflect the committed changes.