]> git.lizzy.rs Git - plan9front.git/commit
arm64: use generic timer virtual counter for cycles()
authorcinap_lenrek <cinap_lenrek@felloff.net>
Fri, 23 Jul 2021 15:10:01 +0000 (15:10 +0000)
committercinap_lenrek <cinap_lenrek@felloff.net>
Fri, 23 Jul 2021 15:10:01 +0000 (15:10 +0000)
commitc38fcb5dc35986b8a93bf2107f800a890e2cea9b
treec8a7877f0b2929482de7d527bf6c6db44a414fdf
parent2c1727e55c48f46b3294b5a474de90a4cef8f70c
arm64: use generic timer virtual counter for cycles()

We used to use performance cycle counter for cycles(),
but it is kind of useless in userspace as each core
has its own counter and hence not comparable between
cores. Also, the cycle counter stops counting when
the cores are idle.

Most callers expect cycles() to return a high resolution
timestamp instead, so do the best we can do here
and enable the userspace generic timer virtual counter.
sys/man/2/cputime
sys/src/9/bcm64/clock.c
sys/src/9/bcm64/sysreg.h
sys/src/libc/arm64/cycles.s