riscv timer: provide a function for cpu_ticks
This is cheaper than the default of tc_cpu_ticks().
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35462
(cherry picked from commit 33734a1f765f8d0ca6214918c3051d88b7b98764)