From 5594074dcd09d0bb8c35998e20cddf728893ff00 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 27 Oct 2016 09:22:43 -0400 Subject: runtime: use clock_gettime(CLOCK_REALTIME) for nanosecond-precision time.now on arm64, mips64x Assembly copied from the clock_gettime(CLOCK_MONOTONIC) call in runtime.nanotime in these files and then modified to use CLOCK_REALTIME. Also comment system call numbers in a few other files. Fixes #11222. Change-Id: Ie132086de7386f865908183aac2713f90fc73e0d Reviewed-on: https://go-review.googlesource.com/32177 Reviewed-by: Cherry Zhang --- src/runtime/sys_linux_arm64.s | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/runtime/sys_linux_arm64.s') diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s index 3bf2e97972..1b91b4499d 100644 --- a/src/runtime/sys_linux_arm64.s +++ b/src/runtime/sys_linux_arm64.s @@ -184,14 +184,12 @@ TEXT runtime·mincore(SB),NOSPLIT,$-8-28 // func now() (sec int64, nsec int32) TEXT time·now(SB),NOSPLIT,$24-12 - MOVD RSP, R0 - MOVD $0, R1 - MOVD $SYS_gettimeofday, R8 + MOVW $0, R0 // CLOCK_REALTIME + MOVD RSP, R1 + MOVD $SYS_clock_gettime, R8 SVC MOVD 0(RSP), R3 // sec - MOVD 8(RSP), R5 // usec - MOVD $1000, R4 - MUL R4, R5 + MOVD 8(RSP), R5 // nsec MOVD R3, sec+0(FP) MOVW R5, nsec+8(FP) RET -- cgit v1.3-6-g1900