Commit 5e35845a authored by Tobias Klauser's avatar Tobias Klauser Committed by Brad Fitzpatrick

runtime: use MRS instruction to read system registers on freebsd/arm64

Support for these was added in CL 189577

Change-Id: Iaf2a774b141995cbbdfb3888aea67ae9c7f928b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/210677
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 931fe394
...@@ -506,38 +506,33 @@ TEXT runtime·getCntxct(SB),NOSPLIT,$0 ...@@ -506,38 +506,33 @@ TEXT runtime·getCntxct(SB),NOSPLIT,$0
CMP $0, R0 CMP $0, R0
BEQ 3(PC) BEQ 3(PC)
// get CNTPCT (Physical Count Register) into x0 // get CNTPCT (Physical Count Register) into R0
// mrs x0, cntpct_el0 = d53be020 MRS CNTPCT_EL0, R0 // SIGILL
WORD $0xd53be020 // SIGILL
B 2(PC) B 2(PC)
// get CNTVCT (Virtual Count Register) into x0 // get CNTVCT (Virtual Count Register) into R0
// mrs x0, cntvct_el0 = d53be040 MRS CNTVCT_EL0, R0
WORD $0xd53be040
MOVW R0, ret+8(FP) MOVW R0, ret+8(FP)
RET RET
// func getisar0() uint64 // func getisar0() uint64
TEXT runtime·getisar0(SB),NOSPLIT,$0 TEXT runtime·getisar0(SB),NOSPLIT,$0
// get Instruction Set Attributes 0 into x0 // get Instruction Set Attributes 0 into R0
// mrs x0, ID_AA64ISAR0_EL1 = d5380600 MRS ID_AA64ISAR0_EL1, R0
WORD $0xd5380600
MOVD R0, ret+0(FP) MOVD R0, ret+0(FP)
RET RET
// func getisar1() uint64 // func getisar1() uint64
TEXT runtime·getisar1(SB),NOSPLIT,$0 TEXT runtime·getisar1(SB),NOSPLIT,$0
// get Instruction Set Attributes 1 into x0 // get Instruction Set Attributes 1 into R0
// mrs x0, ID_AA64ISAR1_EL1 = d5380620 MRS ID_AA64ISAR1_EL1, R0
WORD $0xd5380620
MOVD R0, ret+0(FP) MOVD R0, ret+0(FP)
RET RET
// func getpfr0() uint64 // func getpfr0() uint64
TEXT runtime·getpfr0(SB),NOSPLIT,$0 TEXT runtime·getpfr0(SB),NOSPLIT,$0
// get Processor Feature Register 0 into x0 // get Processor Feature Register 0 into R0
// mrs x0, ID_AA64PFR0_EL1 = d5380400 MRS ID_AA64PFR0_EL1, R0
WORD $0xd5380400
MOVD R0, ret+0(FP) MOVD R0, ret+0(FP)
RET RET
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment