]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fast clock_gettime on FreeBSD, use physical/virtual ARM timer
authorYuval Pavel Zholkover <paulzhol@gmail.com>
Fri, 12 Aug 2022 18:57:28 +0000 (21:57 +0300)
committerMeng Zhuo <mzh@golangcn.org>
Sun, 4 Sep 2022 04:17:04 +0000 (04:17 +0000)
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>

src/runtime/sys_freebsd_arm64.s
src/runtime/vdso_freebsd_arm64.go

index 5dcdf375ab5c63afa96f3ad10741cbdafa5a6174..cb960773ebeed38343fa7dac3165f66ffbf50131 100644 (file)
@@ -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
index 7d9f62d5f928ca5eff57df88e7ba774c4d541583..37b26d73e78801895a5ec4ae92ae23b3a66edcf1 100644 (file)
@@ -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
        }