summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm64/sysreg.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-07-23 15:10:01 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2021-07-23 15:10:01 +0000
commitc38fcb5dc35986b8a93bf2107f800a890e2cea9b (patch)
treec8a7877f0b2929482de7d527bf6c6db44a414fdf /sys/src/9/bcm64/sysreg.h
parent2c1727e55c48f46b3294b5a474de90a4cef8f70c (diff)
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.
Diffstat (limited to 'sys/src/9/bcm64/sysreg.h')
-rw-r--r--sys/src/9/bcm64/sysreg.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/src/9/bcm64/sysreg.h b/sys/src/9/bcm64/sysreg.h
index c057bbba8..0d9b1b172 100644
--- a/sys/src/9/bcm64/sysreg.h
+++ b/sys/src/9/bcm64/sysreg.h
@@ -32,6 +32,8 @@
#define PMUSERENR_EL0 SYSREG(3,3,9,14,0)
#define CNTPCT_EL0 SYSREG(3,3,14,0,1)
+#define CNTVCT_EL0 SYSREG(3,3,14,0,2)
+#define CNTKCTL_EL1 SYSREG(3,0,14,1,0)
#define CNTP_TVAL_EL0 SYSREG(3,3,14,2,0)
#define CNTP_CTL_EL0 SYSREG(3,3,14,2,1)
#define CNTP_CVAL_EL0 SYSREG(3,3,14,2,2)