Skip to content

Commit

Permalink
runtime: fast clock_gettime on FreeBSD, use physical/virtual ARM timer
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Meng Zhuo <[email protected]>
Reviewed-by: Dmitri Goutnik <[email protected]>
Run-TryBot: Yuval Pavel Zholkover <[email protected]>
  • Loading branch information
paulzhol authored and mengzhuo committed Sep 4, 2022
1 parent a73506c commit 535fe2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/sys_freebsd_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/vdso_freebsd_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 535fe2b

Please sign in to comment.