]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/arm64/cycles.s
arm64: use generic timer virtual counter for cycles()
[plan9front.git] / sys / src / libc / arm64 / cycles.s
1 #define SYSREG(op0,op1,Cn,Cm,op2)       SPR(((op0)<<19|(op1)<<16|(Cn)<<12|(Cm)<<8|(op2)<<5))
2 #define CNTVCT_EL0                      SYSREG(3,3,14,0,2)
3
4 TEXT cycles(SB), 1, $-4
5         MRS     CNTVCT_EL0, R1
6         MOV     R1, (R0)
7         RETURN