aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuval Pavel Zholkover <paulzhol@gmail.com>2022-08-12 21:57:28 +0300
committerMeng Zhuo <mzh@golangcn.org>2022-09-04 04:17:04 +0000
commit535fe2b226096a3547321a51b36f464ab443b5cb (patch)
treec9a8e8acb16c742b3504c11bf701670e1868d4ca /src
parenta73506cff560c4d95ac604f4f76d58386ca29ed9 (diff)
downloadgo-535fe2b226096a3547321a51b36f464ab443b5cb.tar.xz
runtime: fast clock_gettime on FreeBSD, use physical/virtual ARM timer
as setup by the kernel on GOARCH=arm64. Update #50947 Change-Id: I2f44be9b36e9ce8d264eccc0aa3df10825c5f4f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/422977 Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Meng Zhuo <mzh@golangcn.org> Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com> Run-TryBot: Yuval Pavel Zholkover <paulzhol@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/sys_freebsd_arm64.s2
-rw-r--r--src/runtime/vdso_freebsd_arm64.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/sys_freebsd_arm64.s b/src/runtime/sys_freebsd_arm64.s
index 5dcdf375ab..cb960773eb 100644
--- a/src/runtime/sys_freebsd_arm64.s
+++ b/src/runtime/sys_freebsd_arm64.s
@@ -460,7 +460,7 @@ TEXT runtime·getCntxct(SB),NOSPLIT,$0
BEQ 3(PC)
// get CNTPCT (Physical Count Register) into R0
- MRS CNTPCT_EL0, R0 // SIGILL
+ MRS CNTPCT_EL0, R0
B 2(PC)
// get CNTVCT (Virtual Count Register) into R0
diff --git a/src/runtime/vdso_freebsd_arm64.go b/src/runtime/vdso_freebsd_arm64.go
index 7d9f62d5f9..37b26d73e7 100644
--- a/src/runtime/vdso_freebsd_arm64.go
+++ b/src/runtime/vdso_freebsd_arm64.go
@@ -14,7 +14,7 @@ func getCntxct(physical bool) uint32
func (th *vdsoTimehands) getTimecounter() (uint32, bool) {
switch th.algo {
case _VDSO_TH_ALGO_ARM_GENTIM:
- return getCntxct(false), true
+ return getCntxct(th.physical != 0), true
default:
return 0, false
}