From 4af3c17f8cd37288a5bb9bc53e8b88c58f5624d1 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 1 Sep 2019 10:37:44 -0400 Subject: runtime: wrap nanotime, walltime, and write In preparation for general faketime support, this renames the existing nanotime, walltime, and write functions to nanotime1, walltime1, and write1 and wraps them with trivial Go functions. This will let us inject different implementations on all platforms when faketime is enabled. Updates #30439. Change-Id: Ice5ccc513a32a6d89ea051638676d3ee05b00418 Reviewed-on: https://go-review.googlesource.com/c/go/+/192738 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick --- src/runtime/sys_linux_amd64.s | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/runtime/sys_linux_amd64.s') diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s index 5c300f553d..7e8f5279ca 100644 --- a/src/runtime/sys_linux_amd64.s +++ b/src/runtime/sys_linux_amd64.s @@ -89,7 +89,7 @@ TEXT runtime·closefd(SB),NOSPLIT,$0-12 MOVL AX, ret+8(FP) RET -TEXT runtime·write(SB),NOSPLIT,$0-28 +TEXT runtime·write1(SB),NOSPLIT,$0-28 MOVQ fd+0(FP), DI MOVQ p+8(FP), SI MOVL n+16(FP), DX @@ -175,8 +175,8 @@ TEXT runtime·mincore(SB),NOSPLIT,$0-28 MOVL AX, ret+24(FP) RET -// func walltime() (sec int64, nsec int32) -TEXT runtime·walltime(SB),NOSPLIT,$0-12 +// func walltime1() (sec int64, nsec int32) +TEXT runtime·walltime1(SB),NOSPLIT,$0-12 // We don't know how much stack space the VDSO code will need, // so switch to g0. // In particular, a kernel configured with CONFIG_OPTIMIZE_INLINING=n @@ -233,7 +233,7 @@ fallback: MOVL DX, nsec+8(FP) RET -TEXT runtime·nanotime(SB),NOSPLIT,$0-8 +TEXT runtime·nanotime1(SB),NOSPLIT,$0-8 // Switch to g0 stack. See comment above in runtime·walltime. MOVQ SP, BP // Save old SP; BP unchanged by C code. -- cgit v1.3-5-g45d5