From: Hiroshi Ioka Date: Tue, 25 Jul 2017 12:44:11 +0000 (+0900) Subject: runtime: move mincore from stubs.go to os_linux.go X-Git-Tag: go1.10beta1~1648 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e9348ab4e9c8c189036ef405d73528ca50a6f785;p=gostls13.git runtime: move mincore from stubs.go to os_linux.go Although mincore is declared in stubs.go, mincore isn't used by any OSes except linux. Move it to os_linux.go and clean up unused code. Change-Id: I6cfb0fed85c0317a4d091a2722ac55fa79fc7c9a Reviewed-on: https://go-review.googlesource.com/54910 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go index 78899737b6..dac4de4985 100644 --- a/src/runtime/os_linux.go +++ b/src/runtime/os_linux.go @@ -193,6 +193,8 @@ const ( var procAuxv = []byte("/proc/self/auxv\x00") +func mincore(addr unsafe.Pointer, n uintptr, dst *byte) int32 + func sysargs(argc int32, argv **byte) { n := argc + 1 diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index d9a7aa0966..e1f43a5cf0 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -131,7 +131,6 @@ func noescape(p unsafe.Pointer) unsafe.Pointer { func cgocallback(fn, frame unsafe.Pointer, framesize, ctxt uintptr) func gogo(buf *gobuf) func gosave(buf *gobuf) -func mincore(addr unsafe.Pointer, n uintptr, dst *byte) int32 //go:noescape func jmpdefer(fv *funcval, argp uintptr) diff --git a/src/runtime/sys_darwin_arm.s b/src/runtime/sys_darwin_arm.s index ea559b5f3e..5def7766b0 100644 --- a/src/runtime/sys_darwin_arm.s +++ b/src/runtime/sys_darwin_arm.s @@ -19,7 +19,6 @@ #define SYS_mmap 197 #define SYS_munmap 73 #define SYS_madvise 75 -#define SYS_mincore 78 #define SYS_gettimeofday 116 #define SYS_kill 37 #define SYS_getpid 20 @@ -150,15 +149,6 @@ TEXT runtime·setitimer(SB),NOSPLIT,$0 SWI $0x80 RET -TEXT runtime·mincore(SB),NOSPLIT,$0 - MOVW addr+0(FP), R0 - MOVW n+4(FP), R1 - MOVW dst+8(FP), R2 - MOVW $SYS_mincore, R12 - SWI $0x80 - MOVW R0, ret+12(FP) - RET - TEXT runtime·walltime(SB), 7, $32 MOVW $8(R13), R0 // timeval MOVW $0, R1 // zone diff --git a/src/runtime/sys_darwin_arm64.s b/src/runtime/sys_darwin_arm64.s index 0e91d5bd10..34fb1f3086 100644 --- a/src/runtime/sys_darwin_arm64.s +++ b/src/runtime/sys_darwin_arm64.s @@ -19,7 +19,6 @@ #define SYS_mmap 197 #define SYS_munmap 73 #define SYS_madvise 75 -#define SYS_mincore 78 #define SYS_gettimeofday 116 #define SYS_kill 37 #define SYS_getpid 20