Skip to content

Commit 7a0e248

Browse files
Use CLOCK_BOOTTIME also for amd64's time.now() in Go runtime
This change was missing in the original patch causing issues with GoLang time functions on chromebooks after device wakes up from sleep and leading to failed connections. Signed-off-by: Mateusz Markowicz <[email protected]>
1 parent 4ba8794 commit 7a0e248

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

tunnel/tools/libwg-go/goruntime-boottime-over-monotonic.diff

+26-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Change-Id: I7b2a6ca0c5bc5fce57ec0eeafe7b68270b429321
2626
src/runtime/sys_linux_mipsx.s | 2 +-
2727
src/runtime/sys_linux_ppc64x.s | 2 +-
2828
src/runtime/sys_linux_s390x.s | 2 +-
29-
8 files changed, 12 insertions(+), 12 deletions(-)
29+
src/runtime/time_linux_amd64.s | 4 ++--
30+
9 files changed, 14 insertions(+), 14 deletions(-)
3031

3132
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s
3233
index 12a294153d..17e3524b40 100644
@@ -165,7 +166,28 @@ index 1448670b91..7d2ee3231c 100644
165166
+ MOVW $7, R2 // CLOCK_BOOTTIME
166167

167168
MOVD R15, R7 // Backup stack pointer
168-
169-
--
170-
2.17.1
171169

170+
diff --git a/src/runtime/time_linux_amd64.s b/src/runtime/time_linux_amd64.s
171+
index 1416d23230..8d42242505 100644
172+
--- a/src/runtime/time_linux_amd64.s
173+
+++ b/src/runtime/time_linux_amd64.s
174+
@@ -46,7 +46,7 @@ noswitch:
175+
JEQ fallback
176+
CALL AX
177+
178+
- MOVL $1, DI // CLOCK_MONOTONIC
179+
+ MOVL $7, DI // CLOCK_BOOTTIME
180+
LEAQ 0(SP), SI
181+
MOVQ runtime·vdsoClockgettimeSym(SB), AX
182+
CALL AX
183+
@@ -79,7 +79,7 @@ fallback:
184+
MOVQ $SYS_clock_gettime, AX
185+
SYSCALL
186+
187+
- MOVL $1, DI // CLOCK_MONOTONIC
188+
+ MOVL $7, DI // CLOCK_BOOTTIME
189+
LEAQ 0(SP), SI
190+
MOVQ $SYS_clock_gettime, AX
191+
SYSCALL
192+
--
193+
2.43.0

0 commit comments

Comments
 (0)