Remix.run Logo
hogehoge51 2 hours ago

riscv has mtime. it is somewhat implementation defined, but it should be a single hardware timer shared by all harts. The Zicntr extension defines user space rdtime psuedo instruction to acesss it from userspace.

aarch64 has cntvct_el0 status register that can be read from userspace.