aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_windows_arm.s
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2019-09-02 14:34:20 +0000
committerDaniel Martí <mvdan@mvdan.cc>2019-09-02 21:46:03 +0000
commitb36a7a502a590bd9fbf7f73b9678ba58028acfde (patch)
treeedb453c155a75639cc5b5d0091e6ab98703da1e2 /src/runtime/sys_windows_arm.s
parentea2fb678c0c0af7be23e0149532f1cd9c8858cdf (diff)
downloadgo-b36a7a502a590bd9fbf7f73b9678ba58028acfde.tar.gz
go-b36a7a502a590bd9fbf7f73b9678ba58028acfde.zip
Revert "runtime: remove slow time compatibility hacks for wine"
This reverts CL 191759. Reason for revert: broke most Go programs using the time package on Wine, including on 4.15, the latest stable version. Only wine-staging (with experimental patches) contains an upstream fix we could rely on. Change-Id: Ic8ba126022e54f412174042fbb9abed82d5eb318 Reviewed-on: https://go-review.googlesource.com/c/go/+/192622 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Diffstat (limited to 'src/runtime/sys_windows_arm.s')
-rw-r--r--src/runtime/sys_windows_arm.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s
index 294e217e6c..8f8af0a4f7 100644
--- a/src/runtime/sys_windows_arm.s
+++ b/src/runtime/sys_windows_arm.s
@@ -496,6 +496,10 @@ TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0
#define time_hi2 8
TEXT runtime·nanotime(SB),NOSPLIT,$0-8
+ MOVW $0, R0
+ MOVB runtime·useQPCTime(SB), R0
+ CMP $0, R0
+ BNE useQPC
MOVW $_INTERRUPT_TIME, R3
loop:
MOVW time_hi1(R3), R1
@@ -513,8 +517,15 @@ loop:
MOVW R3, ret_lo+0(FP)
MOVW R4, ret_hi+4(FP)
RET
+useQPC:
+ B runtime·nanotimeQPC(SB) // tail call
+ RET
TEXT time·now(SB),NOSPLIT,$0-20
+ MOVW $0, R0
+ MOVB runtime·useQPCTime(SB), R0
+ CMP $0, R0
+ BNE useQPC
MOVW $_INTERRUPT_TIME, R3
loop:
MOVW time_hi1(R3), R1
@@ -583,6 +594,9 @@ wall:
MOVW R7,sec_hi+4(FP)
MOVW R1,nsec+8(FP)
RET
+useQPC:
+ B runtime·nanotimeQPC(SB) // tail call
+ RET
// save_g saves the g register (R10) into thread local memory
// so that we can call externally compiled