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 <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Hiroshi Ioka 2017-07-25 21:44:11 +09:00 committed by Ian Lance Taylor
parent 320b6fef18
commit e9348ab4e9
4 changed files with 2 additions and 12 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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