From: Ian Lance Taylor Date: Wed, 28 Apr 2021 20:06:55 +0000 (-0700) Subject: runtime: remove linux-amd64 walltime function X-Git-Tag: go1.17beta1~363 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b15372f39bb555196053ddac5e86931a1502c86c;p=gostls13.git runtime: remove linux-amd64 walltime function It's never called. Change-Id: I8956743b21301816b5f37a9b34e3f50ef7b2e70a Reviewed-on: https://go-review.googlesource.com/c/go/+/314771 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Michael Knyszek --- diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s index ee587de805..33cc670b64 100644 --- a/src/runtime/sys_linux_amd64.s +++ b/src/runtime/sys_linux_amd64.s @@ -204,9 +204,8 @@ TEXT runtime·mincore(SB),NOSPLIT,$0-28 MOVL AX, ret+24(FP) RET -// func walltime() (sec int64, nsec int32) -// non-zero frame-size means bp is saved and restored -TEXT runtime·walltime(SB),NOSPLIT,$16-12 +// func nanotime1() int64 +TEXT runtime·nanotime1(SB),NOSPLIT,$16-8 // 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 @@ -216,74 +215,6 @@ TEXT runtime·walltime(SB),NOSPLIT,$16-12 MOVQ SP, R12 // Save old SP; R12 unchanged by C code. -#ifdef GOEXPERIMENT_regabig - MOVQ g_m(R14), BX // BX unchanged by C code. -#else - get_tls(CX) - MOVQ g(CX), AX - MOVQ g_m(AX), BX // BX unchanged by C code. -#endif - - // Set vdsoPC and vdsoSP for SIGPROF traceback. - // Save the old values on stack and restore them on exit, - // so this function is reentrant. - MOVQ m_vdsoPC(BX), CX - MOVQ m_vdsoSP(BX), DX - MOVQ CX, 0(SP) - MOVQ DX, 8(SP) - - LEAQ sec+0(FP), DX - MOVQ -8(DX), CX - MOVQ CX, m_vdsoPC(BX) - MOVQ DX, m_vdsoSP(BX) - -#ifdef GOEXPERIMENT_regabig - CMPQ R14, m_curg(BX) // Only switch if on curg. -#else - CMPQ AX, m_curg(BX) // Only switch if on curg. -#endif - JNE noswitch - - MOVQ m_g0(BX), DX - MOVQ (g_sched+gobuf_sp)(DX), SP // Set SP to g0 stack - -noswitch: - SUBQ $16, SP // Space for results - ANDQ $~15, SP // Align for C code - - MOVL $0, DI // CLOCK_REALTIME - LEAQ 0(SP), SI - MOVQ runtime·vdsoClockgettimeSym(SB), AX - CMPQ AX, $0 - JEQ fallback - CALL AX -ret: - MOVQ 0(SP), AX // sec - MOVQ 8(SP), DX // nsec - MOVQ R12, SP // Restore real SP - // Restore vdsoPC, vdsoSP - // We don't worry about being signaled between the two stores. - // If we are not in a signal handler, we'll restore vdsoSP to 0, - // and no one will care about vdsoPC. If we are in a signal handler, - // we cannot receive another signal. - MOVQ 8(SP), CX - MOVQ CX, m_vdsoSP(BX) - MOVQ 0(SP), CX - MOVQ CX, m_vdsoPC(BX) - MOVQ AX, sec+0(FP) - MOVL DX, nsec+8(FP) - RET -fallback: - MOVQ $SYS_clock_gettime, AX - SYSCALL - JMP ret - -// func nanotime1() int64 -TEXT runtime·nanotime1(SB),NOSPLIT,$16-8 - // Switch to g0 stack. See comment above in runtime·walltime. - - MOVQ SP, R12 // Save old SP; R12 unchanged by C code. - #ifdef GOEXPERIMENT_regabig MOVQ g_m(R14), BX // BX unchanged by C code. #else diff --git a/src/runtime/timestub2.go b/src/runtime/timestub2.go index d66579440e..800a2a94e0 100644 --- a/src/runtime/timestub2.go +++ b/src/runtime/timestub2.go @@ -2,8 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !freebsd && !openbsd && !solaris && !windows -// +build !aix,!darwin,!freebsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !freebsd && !openbsd && !solaris && !windows && !(linux && amd64) +// +build !aix +// +build !darwin +// +build !freebsd +// +build !openbsd +// +build !solaris +// +build !windows +// +build !linux !amd64 package runtime