diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2019-12-10 11:57:35 +0100 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-12-10 21:10:17 +0000 |
commit | 5e35845a4aedd86d51a6b189bbcac688af446ce3 (patch) | |
tree | d60101dffb0ef371bbd076c61f8150ec48dd5b7c | |
parent | 931fe39400006e6c272d13f2a4d46de2a6736761 (diff) | |
download | go-5e35845a4aedd86d51a6b189bbcac688af446ce3.tar.gz go-5e35845a4aedd86d51a6b189bbcac688af446ce3.zip |
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: Ian Lance Taylor <iant@golang.org>
-rw-r--r-- | src/runtime/sys_freebsd_arm64.s | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/runtime/sys_freebsd_arm64.s b/src/runtime/sys_freebsd_arm64.s index e0ef2f679d..78cd9f15ee 100644 --- a/src/runtime/sys_freebsd_arm64.s +++ b/src/runtime/sys_freebsd_arm64.s @@ -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 |