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
CMP $0, R0
BEQ 3(PC)
// get CNTPCT (Physical Count Register) into x0
// mrs x0, cntpct_el0 = d53be020
WORD $0xd53be020 // SIGILL
// get CNTPCT (Physical Count Register) into R0
MRS CNTPCT_EL0, R0 // SIGILL
B 2(PC)
// get CNTVCT (Virtual Count Register) into x0
// mrs x0, cntvct_el0 = d53be040
WORD $0xd53be040
// get CNTVCT (Virtual Count Register) into R0
MRS CNTVCT_EL0, R0
MOVW R0, ret+8(FP)
RET
// func getisar0() uint64
TEXT runtime·getisar0(SB),NOSPLIT,$0
// get Instruction Set Attributes 0 into x0
// mrs x0, ID_AA64ISAR0_EL1 = d5380600
WORD $0xd5380600
// get Instruction Set Attributes 0 into R0
MRS ID_AA64ISAR0_EL1, R0
MOVD R0, ret+0(FP)
RET
// func getisar1() uint64
TEXT runtime·getisar1(SB),NOSPLIT,$0
// get Instruction Set Attributes 1 into x0
// mrs x0, ID_AA64ISAR1_EL1 = d5380620
WORD $0xd5380620
// get Instruction Set Attributes 1 into R0
MRS ID_AA64ISAR1_EL1, R0
MOVD R0, ret+0(FP)
RET
// func getpfr0() uint64
TEXT runtime·getpfr0(SB),NOSPLIT,$0
// get Processor Feature Register 0 into x0
// mrs x0, ID_AA64PFR0_EL1 = d5380400
WORD $0xd5380400
// get Processor Feature Register 0 into R0
MRS ID_AA64PFR0_EL1, R0
MOVD R0, ret+0(FP)
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