]> Cypherpunks repositories - gostls13.git/commit
runtime: fast clock_gettime call on FreeBSD
authorYuval Pavel Zholkover <paulzhol@gmail.com>
Mon, 5 Feb 2018 15:11:27 +0000 (17:11 +0200)
committerIan Lance Taylor <iant@golang.org>
Wed, 18 Apr 2018 21:54:26 +0000 (21:54 +0000)
commit744ccbb852f18241c637b2c6314b35fce7359916
tree7201dea7cc3ce21462c40af6a646f7ff0c0427db
parent236c567ba9b7767b6f1ebe32eb2d8f0018de8780
runtime: fast clock_gettime call on FreeBSD

Use AT_TIMEKEEP ELF aux entry to access a kernel mapped ring of timehands structs.
The timehands are updated by the kernel periodically, but for accurate measure the
timecounter still needs to be queried.
Currently the fast path is used only when kern.timecounter.hardware==TSC-low
or kern.timecounter.hardware=='ARM MPCore Timecounter',
other timecounters revert back to regular system call.

TODO: add support for HPET timecounter on 386/amd64.

Change-Id: I321ca4e92be63ba21a2574b758ef5c1e729086ad
Reviewed-on: https://go-review.googlesource.com/93156
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
15 files changed:
src/runtime/defs_freebsd.go
src/runtime/defs_freebsd_386.go
src/runtime/defs_freebsd_amd64.go
src/runtime/defs_freebsd_arm.go
src/runtime/os_freebsd.go
src/runtime/stubs2.go
src/runtime/stubs3.go [new file with mode: 0644]
src/runtime/sys_freebsd_386.s
src/runtime/sys_freebsd_amd64.s
src/runtime/sys_freebsd_arm.s
src/runtime/timestub.go
src/runtime/timestub2.go [new file with mode: 0644]
src/runtime/vdso_freebsd.go [new file with mode: 0644]
src/runtime/vdso_freebsd_arm.go [new file with mode: 0644]
src/runtime/vdso_freebsd_x86.go [new file with mode: 0644]