shithub: riscv

ref: ec73849b6936d839410ccb239d14b2f7c7ca3d6f
dir: /sys/src/ape/lib/ap/arm64/cycles.s/

View raw version
#define	SYSREG(op0,op1,Cn,Cm,op2)	SPR(((op0)<<19|(op1)<<16|(Cn)<<12|(Cm)<<8|(op2)<<5))
#define CNTVCT_EL0			SYSREG(3,3,14,0,2)

TEXT _cycles(SB), 1, $-4
	MRS	CNTVCT_EL0, R1
	MOV	R1, (R0)
	RETURN