aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_ppc64x.s
diff options
context:
space:
mode:
authorCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>2016-08-10 15:02:02 -0300
committerBrad Fitzpatrick <bradfitz@golang.org>2016-08-23 05:37:05 +0000
commit0df5ab7e6569a8bf6bc87975e539706163bf664a (patch)
tree34799361c281869326325d822c3fbf29676098f1 /src/runtime/sys_linux_ppc64x.s
parent8a9b96ace4c0064d3c06cd483368bd655ad43d87 (diff)
downloadgo-0df5ab7e6569a8bf6bc87975e539706163bf664a.tar.gz
go-0df5ab7e6569a8bf6bc87975e539706163bf664a.zip
runtime: Use clock_gettime to get current time on ppc64x
Fetch the current time in nanoseconds, not microseconds, by using clock_gettime rather than gettimeofday. Updates #11222 Change-Id: I1c2c1b88f80ae82002518359436e19099061c6fb Reviewed-on: https://go-review.googlesource.com/26790 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Minux Ma <minux@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_ppc64x.s')
-rw-r--r--src/runtime/sys_linux_ppc64x.s10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s
index 56b842ac01..883aef8409 100644
--- a/src/runtime/sys_linux_ppc64x.s
+++ b/src/runtime/sys_linux_ppc64x.s
@@ -159,13 +159,11 @@ TEXT runtime·mincore(SB),NOSPLIT|NOFRAME,$0-28
// func now() (sec int64, nsec int32)
TEXT time·now(SB),NOSPLIT,$16
- MOVD $0(R1), R3
- MOVD $0, R4
- SYSCALL $SYS_gettimeofday
+ MOVD $0, R3 // CLOCK_REALTIME
+ MOVD $0(R1), R4
+ SYSCALL $SYS_clock_gettime
MOVD 0(R1), R3 // sec
- MOVD 8(R1), R5 // usec
- MOVD $1000, R4
- MULLD R4, R5
+ MOVD 8(R1), R5 // nsec
MOVD R3, sec+0(FP)
MOVW R5, nsec+8(FP)
RET