aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_386.s
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2018-05-01 09:42:04 -0700
committerKeith Randall <khr@golang.org>2018-05-20 00:09:28 +0000
commitcc09212f59ee215cae5345dc1ffcd1ed81664e1b (patch)
treef3848bd8adf10bf4a21ee4525659d05e17185ba8 /src/runtime/asm_386.s
parente86c26789dbc11c50c4c49bee55ea015847a97b7 (diff)
downloadgo-cc09212f59ee215cae5345dc1ffcd1ed81664e1b.tar.gz
go-cc09212f59ee215cae5345dc1ffcd1ed81664e1b.zip
runtime: use libc for nanotime on Darwin
Use mach_absolute_time and mach_timebase_info to get nanosecond-level timing information from libc on Darwin. The conversion code from Apple's arbitrary time unit to nanoseconds is really annoying. It would be nice if we could replace the internal runtime "time" with arbitrary units and put the conversion to nanoseconds only in the places that really need it (so it isn't in every nanotime call). It's especially annoying because numer==denom==1 for all the machines I tried. Makes it hard to test the conversion code :( Update #17490 Change-Id: I6c5d602a802f5c24e35184e33d5e8194aa7afa86 Reviewed-on: https://go-review.googlesource.com/110655 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/asm_386.s')
-rw-r--r--src/runtime/asm_386.s2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s
index 54d5eaa014..5ca26a2d5f 100644
--- a/src/runtime/asm_386.s
+++ b/src/runtime/asm_386.s
@@ -704,6 +704,8 @@ TEXT ·asmcgocall(SB),NOSPLIT,$0-12
MOVL g(CX), DI
CMPL SI, DI
JEQ noswitch
+ CMPL DI, m_gsignal(BP)
+ JEQ noswitch
CALL gosave<>(SB)
get_tls(CX)
MOVL SI, g(CX)