• Yuval Pavel Zholkover's avatar
    runtime: fast clock_gettime call on FreeBSD · 744ccbb8
    Yuval Pavel Zholkover authored
    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: 's avatarIan Lance Taylor <iant@golang.org>
    744ccbb8
sys_freebsd_386.s 7.93 KB