Commit 6ed2ec4a authored by Russ Cox's avatar Russ Cox

runtime: fix vet complaints for linux/386

Working toward making the tree vet-safe instead of having
so many exceptions in cmd/vet/all/whitelist.

This CL makes "GOOS=linux GOARCH=386 go vet -unsafeptr=false runtime" happy,
while keeping "GO_BUILDER_NAME=misc-vetall go tool dist test" happy too.

For #31916.

Change-Id: I3e5586a7ff6e359357350d0602c2259493280ded
Reviewed-on: https://go-review.googlesource.com/c/go/+/176099
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarAustin Clements <austin@google.com>
parent cd03664f
// 386-specific vet whitelist. See readme.txt for details.
// startup code uses non-standard calling convention and intentionally
// omits args.
runtime/asm_386.s: [386] rt0_go: use of 4(SP) points beyond argument frame
// reflect trampolines intentionally omit arg size. Same for morestack.
runtime/asm_386.s: [386] morestack: use of 4(SP) points beyond argument frame
runtime/asm_386.s: [386] morestack: use of 8(SP) points beyond argument frame
runtime/asm_386.s: [386] morestack: use of 4(SP) points beyond argument frame
// Intentionally missing declarations. These are special assembly routines.
runtime/asm_386.s: [386] ldt0setup: function ldt0setup missing Go declaration
runtime/asm_386.s: [386] emptyfunc: function emptyfunc missing Go declaration
runtime/asm_386.s: [386] aeshashbody: function aeshashbody missing Go declaration
runtime/asm_386.s: [386] addmoduledata: function addmoduledata missing Go declaration
runtime/duff_386.s: [386] duffzero: function duffzero missing Go declaration
runtime/duff_386.s: [386] duffcopy: function duffcopy missing Go declaration
...@@ -13,6 +13,3 @@ runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument fram ...@@ -13,6 +13,3 @@ runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument fram
// Others use the platform ABI. // Others use the platform ABI.
// There is no sensible corresponding Go prototype. // There is no sensible corresponding Go prototype.
runtime/asm_amd64.s: [amd64] aeshashbody: function aeshashbody missing Go declaration runtime/asm_amd64.s: [amd64] aeshashbody: function aeshashbody missing Go declaration
runtime/asm_amd64.s: [amd64] addmoduledata: function addmoduledata missing Go declaration
runtime/duff_amd64.s: [amd64] duffzero: function duffzero missing Go declaration
runtime/duff_amd64.s: [amd64] duffcopy: function duffcopy missing Go declaration
// android/386-specific vet whitelist. See readme.txt for details.
runtime/sys_linux_386.s: [386] setldt: function setldt missing Go declaration
// These SP references occur after a stack-altering call. They're fine.
runtime/sys_linux_386.s: [386] clone: 12(SP) should be mp+8(FP)
runtime/sys_linux_386.s: [386] clone: 4(SP) should be flags+0(FP)
runtime/sys_linux_386.s: [386] clone: 8(SP) should be stk+4(FP)
...@@ -3,8 +3,5 @@ ...@@ -3,8 +3,5 @@
// Intentionally missing declarations. // Intentionally missing declarations.
runtime/asm_arm.s: [arm] emptyfunc: function emptyfunc missing Go declaration runtime/asm_arm.s: [arm] emptyfunc: function emptyfunc missing Go declaration
runtime/asm_arm.s: [arm] usplitR0: function usplitR0 missing Go declaration runtime/asm_arm.s: [arm] usplitR0: function usplitR0 missing Go declaration
runtime/asm_arm.s: [arm] addmoduledata: function addmoduledata missing Go declaration
runtime/duff_arm.s: [arm] duffzero: function duffzero missing Go declaration
runtime/duff_arm.s: [arm] duffcopy: function duffcopy missing Go declaration
runtime/tls_arm.s: [arm] load_g: function load_g missing Go declaration runtime/tls_arm.s: [arm] load_g: function load_g missing Go declaration
runtime/tls_arm.s: [arm] _initcgo: function _initcgo missing Go declaration runtime/tls_arm.s: [arm] _initcgo: function _initcgo missing Go declaration
// arm64-specific vet whitelist. See readme.txt for details. // arm64-specific vet whitelist. See readme.txt for details.
// Intentionally missing declarations. // Intentionally missing declarations.
runtime/asm_arm64.s: [arm64] addmoduledata: function addmoduledata missing Go declaration
runtime/tls_arm64.s: [arm64] load_g: function load_g missing Go declaration runtime/tls_arm64.s: [arm64] load_g: function load_g missing Go declaration
runtime/tls_arm64.s: [arm64] save_g: function save_g missing Go declaration runtime/tls_arm64.s: [arm64] save_g: function save_g missing Go declaration
// darwin/386-specific vet whitelist. See readme.txt for details.
// Ok
runtime/sys_darwin_386.s: [386] setldt: function setldt missing Go declaration
...@@ -5,7 +5,6 @@ runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable signo ...@@ -5,7 +5,6 @@ runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable signo
runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable info runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable info
runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable context runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable context
runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable context runtime/sys_freebsd_386.s: [386] sigtramp: unknown variable context
runtime/sys_freebsd_386.s: [386] setldt: function setldt missing Go declaration
runtime/sys_freebsd_386.s: [386] i386_set_ldt: function i386_set_ldt missing Go declaration runtime/sys_freebsd_386.s: [386] i386_set_ldt: function i386_set_ldt missing Go declaration
syscall/asm_unix_386.s: [386] Syscall: 8(SP) should be a1+4(FP) syscall/asm_unix_386.s: [386] Syscall: 8(SP) should be a1+4(FP)
syscall/asm_unix_386.s: [386] Syscall: 4(SP) should be trap+0(FP) syscall/asm_unix_386.s: [386] Syscall: 4(SP) should be trap+0(FP)
......
// linux/386-specific vet whitelist. See readme.txt for details.
runtime/sys_linux_386.s: [386] setldt: function setldt missing Go declaration
// These SP references occur after a stack-altering call. They're fine.
runtime/sys_linux_386.s: [386] clone: 12(SP) should be mp+8(FP)
runtime/sys_linux_386.s: [386] clone: 4(SP) should be flags+0(FP)
runtime/sys_linux_386.s: [386] clone: 8(SP) should be stk+4(FP)
// Android-specific; stubs missing on other linux platforms.
runtime/sys_linux_386.s: [386] access: function access missing Go declaration
runtime/sys_linux_386.s: [386] connect: function connect missing Go declaration
runtime/sys_linux_386.s: [386] socket: function socket missing Go declaration
// linux/amd64-specific vet whitelist. See readme.txt for details. // linux/amd64-specific vet whitelist. See readme.txt for details.
runtime/sys_linux_amd64.s: [amd64] settls: function settls missing Go declaration runtime/sys_linux_amd64.s: [amd64] settls: function settls missing Go declaration
// Android-specific; stubs missing on other linux platforms.
runtime/sys_linux_amd64.s: [amd64] access: function access missing Go declaration
runtime/sys_linux_amd64.s: [amd64] connect: function connect missing Go declaration
runtime/sys_linux_amd64.s: [amd64] socket: function socket missing Go declaration
// linux/arm-specific vet whitelist. See readme.txt for details. // linux/arm-specific vet whitelist. See readme.txt for details.
// These SP references occur after a stack-altering call. They're fine. // These SP references occur after a stack-altering call. They're fine.
runtime/sys_linux_arm.s: [arm] clone: 12(R13) should be stk+4(FP) runtime/sys_linux_arm.s: [arm] clone: 12(R13) should be stk+4(FP)
runtime/sys_linux_arm.s: [arm] clone: 8(R13) should be flags+0(FP) runtime/sys_linux_arm.s: [arm] clone: 8(R13) should be flags+0(FP)
// Special functions.
runtime/sys_linux_arm.s: [arm] access: function access missing Go declaration
runtime/sys_linux_arm.s: [arm] connect: function connect missing Go declaration
runtime/sys_linux_arm.s: [arm] socket: function socket missing Go declaration
// linux/arm64-specific vet whitelist. See readme.txt for details.
runtime/sys_linux_arm64.s: [arm64] access: function access missing Go declaration
runtime/sys_linux_arm64.s: [arm64] connect: function connect missing Go declaration
runtime/sys_linux_arm64.s: [arm64] socket: function socket missing Go declaration
// nacl/386-specific vet whitelist. See readme.txt for details. // nacl/386-specific vet whitelist. See readme.txt for details.
runtime/sys_nacl_386.s: [386] nacl_clock_gettime: function nacl_clock_gettime missing Go declaration runtime/sys_nacl_386.s: [386] nacl_clock_gettime: function nacl_clock_gettime missing Go declaration
runtime/sys_nacl_386.s: [386] setldt: function setldt missing Go declaration
runtime/sys_nacl_386.s: [386] sigtramp: use of 20(SP) points beyond argument frame runtime/sys_nacl_386.s: [386] sigtramp: use of 20(SP) points beyond argument frame
runtime/sys_nacl_386.s: [386] sigtramp: use of 4(SP) points beyond argument frame runtime/sys_nacl_386.s: [386] sigtramp: use of 4(SP) points beyond argument frame
runtime/sys_nacl_386.s: [386] sigtramp: unknown variable ctxt runtime/sys_nacl_386.s: [386] sigtramp: unknown variable ctxt
......
...@@ -9,8 +9,6 @@ runtime/sys_netbsd_386.s: [386] sigreturn_tramp: use of 4(SP) points beyond argu ...@@ -9,8 +9,6 @@ runtime/sys_netbsd_386.s: [386] sigreturn_tramp: use of 4(SP) points beyond argu
runtime/sys_netbsd_386.s: [386] sigtramp: unknown variable signo runtime/sys_netbsd_386.s: [386] sigtramp: unknown variable signo
runtime/sys_netbsd_386.s: [386] sigtramp: unknown variable info runtime/sys_netbsd_386.s: [386] sigtramp: unknown variable info
runtime/sys_netbsd_386.s: [386] sigtramp: unknown variable context runtime/sys_netbsd_386.s: [386] sigtramp: unknown variable context
runtime/sys_netbsd_386.s: [386] setldt: function setldt missing Go declaration
runtime/sys_netbsd_386.s: [386] setldt: use of 16(SP) points beyond argument frame
syscall/asm_unix_386.s: [386] Syscall: 8(SP) should be a1+4(FP) syscall/asm_unix_386.s: [386] Syscall: 8(SP) should be a1+4(FP)
syscall/asm_unix_386.s: [386] Syscall: 4(SP) should be trap+0(FP) syscall/asm_unix_386.s: [386] Syscall: 4(SP) should be trap+0(FP)
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
runtime/sys_openbsd_386.s: [386] sigtramp: unknown variable signo runtime/sys_openbsd_386.s: [386] sigtramp: unknown variable signo
runtime/sys_openbsd_386.s: [386] sigtramp: unknown variable info runtime/sys_openbsd_386.s: [386] sigtramp: unknown variable info
runtime/sys_openbsd_386.s: [386] sigtramp: unknown variable context runtime/sys_openbsd_386.s: [386] sigtramp: unknown variable context
runtime/sys_openbsd_386.s: [386] setldt: function setldt missing Go declaration
runtime/sys_openbsd_386.s: [386] settls: function settls missing Go declaration runtime/sys_openbsd_386.s: [386] settls: function settls missing Go declaration
syscall/asm_unix_386.s: [386] Syscall: 8(SP) should be a1+4(FP) syscall/asm_unix_386.s: [386] Syscall: 8(SP) should be a1+4(FP)
syscall/asm_unix_386.s: [386] Syscall: 4(SP) should be trap+0(FP) syscall/asm_unix_386.s: [386] Syscall: 4(SP) should be trap+0(FP)
......
// plan9/386-specific vet whitelist. See readme.txt for details.
runtime/sys_plan9_386.s: [386] setldt: function setldt missing Go declaration
// plan9/amd64-specific vet whitelist. See readme.txt for details. // plan9/amd64-specific vet whitelist. See readme.txt for details.
runtime/sys_plan9_amd64.s: [amd64] setldt: function setldt missing Go declaration
runtime/sys_plan9_amd64.s: [amd64] settls: function settls missing Go declaration runtime/sys_plan9_amd64.s: [amd64] settls: function settls missing Go declaration
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
runtime/sys_windows_386.s: [386] profileloop: use of 4(SP) points beyond argument frame runtime/sys_windows_386.s: [386] profileloop: use of 4(SP) points beyond argument frame
runtime/sys_windows_386.s: [386] ctrlhandler: 4(SP) should be _type+0(FP) runtime/sys_windows_386.s: [386] ctrlhandler: 4(SP) should be _type+0(FP)
runtime/sys_windows_386.s: [386] setldt: function setldt missing Go declaration
runtime/sys_windows_386.s: [386] callbackasm1+0: function callbackasm1+0 missing Go declaration runtime/sys_windows_386.s: [386] callbackasm1+0: function callbackasm1+0 missing Go declaration
runtime/sys_windows_386.s: [386] tstart: function tstart missing Go declaration runtime/sys_windows_386.s: [386] tstart: function tstart missing Go declaration
runtime/sys_windows_386.s: [386] tstart_stdcall: RET without writing to 4-byte ret+4(FP) runtime/sys_windows_386.s: [386] tstart_stdcall: RET without writing to 4-byte ret+4(FP)
......
...@@ -89,7 +89,7 @@ GLOBL _rt0_386_lib_argc<>(SB),NOPTR, $4 ...@@ -89,7 +89,7 @@ GLOBL _rt0_386_lib_argc<>(SB),NOPTR, $4
DATA _rt0_386_lib_argv<>(SB)/4, $0 DATA _rt0_386_lib_argv<>(SB)/4, $0
GLOBL _rt0_386_lib_argv<>(SB),NOPTR, $4 GLOBL _rt0_386_lib_argv<>(SB),NOPTR, $4
TEXT runtime·rt0_go(SB),NOSPLIT,$0 TEXT runtime·rt0_go(SB),NOSPLIT|NOFRAME,$0
// Copy arguments forward on an even stack. // Copy arguments forward on an even stack.
// Users of this function jump to it, they don't call it. // Users of this function jump to it, they don't call it.
MOVL 0(SP), AX MOVL 0(SP), AX
...@@ -209,7 +209,7 @@ needtls: ...@@ -209,7 +209,7 @@ needtls:
#endif #endif
// set up %gs // set up %gs
CALL runtime·ldt0setup(SB) CALL ldt0setup<>(SB)
// store through it, to make sure it works // store through it, to make sure it works
get_tls(BX) get_tls(BX)
...@@ -453,6 +453,7 @@ TEXT runtime·morestack(SB),NOSPLIT,$0-0 ...@@ -453,6 +453,7 @@ TEXT runtime·morestack(SB),NOSPLIT,$0-0
// Called from f. // Called from f.
// Set m->morebuf to f's caller. // Set m->morebuf to f's caller.
NOP SP // tell vet SP changed - stop checking offsets
MOVL 4(SP), DI // f's caller's PC MOVL 4(SP), DI // f's caller's PC
MOVL DI, (m_morebuf+gobuf_pc)(BX) MOVL DI, (m_morebuf+gobuf_pc)(BX)
LEAL 8(SP), CX // f's caller's SP LEAL 8(SP), CX // f's caller's SP
...@@ -895,7 +896,7 @@ done: ...@@ -895,7 +896,7 @@ done:
MOVL DX, ret_hi+4(FP) MOVL DX, ret_hi+4(FP)
RET RET
TEXT runtime·ldt0setup(SB),NOSPLIT,$16-0 TEXT ldt0setup<>(SB),NOSPLIT,$16-0
// set up ldt 7 to point at m0.tls // set up ldt 7 to point at m0.tls
// ldt 1 would be fine on Linux, but on OS X, 7 is as low as we can go. // ldt 1 would be fine on Linux, but on OS X, 7 is as low as we can go.
// the entry number is just a hint. setldt will set up GS with what it used. // the entry number is just a hint. setldt will set up GS with what it used.
...@@ -914,19 +915,19 @@ TEXT runtime·aeshash(SB),NOSPLIT,$0-16 ...@@ -914,19 +915,19 @@ TEXT runtime·aeshash(SB),NOSPLIT,$0-16
MOVL p+0(FP), AX // ptr to data MOVL p+0(FP), AX // ptr to data
MOVL s+8(FP), BX // size MOVL s+8(FP), BX // size
LEAL ret+12(FP), DX LEAL ret+12(FP), DX
JMP runtime·aeshashbody(SB) JMP aeshashbody<>(SB)
TEXT runtime·aeshashstr(SB),NOSPLIT,$0-12 TEXT runtime·aeshashstr(SB),NOSPLIT,$0-12
MOVL p+0(FP), AX // ptr to string object MOVL p+0(FP), AX // ptr to string object
MOVL 4(AX), BX // length of string MOVL 4(AX), BX // length of string
MOVL (AX), AX // string data MOVL (AX), AX // string data
LEAL ret+8(FP), DX LEAL ret+8(FP), DX
JMP runtime·aeshashbody(SB) JMP aeshashbody<>(SB)
// AX: data // AX: data
// BX: length // BX: length
// DX: address to put return value // DX: address to put return value
TEXT runtime·aeshashbody(SB),NOSPLIT,$0-0 TEXT aeshashbody<>(SB),NOSPLIT,$0-0
MOVL h+4(FP), X0 // 32 bits of per-table hash seed MOVL h+4(FP), X0 // 32 bits of per-table hash seed
PINSRW $4, BX, X0 // 16 bits of length PINSRW $4, BX, X0 // 16 bits of length
PSHUFHW $0, X0, X0 // replace size with its low 2 bytes repeated 4 times PSHUFHW $0, X0, X0 // replace size with its low 2 bytes repeated 4 times
......
...@@ -893,7 +893,7 @@ TEXT runtime·usplitR0(SB),NOSPLIT,$0 ...@@ -893,7 +893,7 @@ TEXT runtime·usplitR0(SB),NOSPLIT,$0
#ifndef GOOS_nacl #ifndef GOOS_nacl
// This is called from .init_array and follows the platform, not Go, ABI. // This is called from .init_array and follows the platform, not Go, ABI.
TEXT runtime·addmoduledata(SB),NOSPLIT,$0-8 TEXT runtime·addmoduledata(SB),NOSPLIT,$0-0
MOVW R9, saver9-4(SP) // The access to global variables below implicitly uses R9, which is callee-save MOVW R9, saver9-4(SP) // The access to global variables below implicitly uses R9, which is callee-save
MOVW R11, saver11-8(SP) // Likewise, R11 is the temp register, but callee-save in C ABI MOVW R11, saver11-8(SP) // Likewise, R11 is the temp register, but callee-save in C ABI
MOVW runtime·lastmoduledatap(SB), R1 MOVW runtime·lastmoduledatap(SB), R1
......
...@@ -266,3 +266,6 @@ TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0 ...@@ -266,3 +266,6 @@ TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0
RET RET
// TODO: Implement runtime·duffcopy. // TODO: Implement runtime·duffcopy.
TEXT runtime·duffcopy(SB),NOSPLIT|NOFRAME,$0-0
MOVV R0, 2(R0)
RET
...@@ -138,3 +138,6 @@ TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0 ...@@ -138,3 +138,6 @@ TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0
RET RET
// TODO: Implement runtime·duffcopy. // TODO: Implement runtime·duffcopy.
TEXT runtime·duffcopy(SB),NOSPLIT|NOFRAME,$0-0
MOVD R0, 0(R0)
RET
...@@ -319,3 +319,8 @@ func abort() ...@@ -319,3 +319,8 @@ func abort()
// Called from compiled code; declared for vet; do NOT call from Go. // Called from compiled code; declared for vet; do NOT call from Go.
func gcWriteBarrier() func gcWriteBarrier()
func duffzero()
func duffcopy()
// Called from linker-generated .initarray; declared for go vet; do NOT call from Go.
func addmoduledata()
...@@ -4,5 +4,11 @@ ...@@ -4,5 +4,11 @@
package runtime package runtime
import "unsafe"
func float64touint32(a float64) uint32 func float64touint32(a float64) uint32
func uint32tofloat64(a uint32) float64 func uint32tofloat64(a uint32) float64
// Called from assembly only; declared for go vet.
func setldt(slot uintptr, base unsafe.Pointer, size uintptr)
func emptyfunc()
package runtime
import "unsafe"
// Return values of access/connect/socket are the return values of the syscall
// (may encode error numbers).
// int access(const char *, int)
//go:noescape
func access(name *byte, mode int32) int32
// int connect(int, const struct sockaddr*, socklen_t)
func connect(fd int32, addr unsafe.Pointer, len int32) int32
// int socket(int, int, int)
func socket(domain int32, typ int32, prot int32) int32
...@@ -6,4 +6,14 @@ ...@@ -6,4 +6,14 @@
package runtime package runtime
import "unsafe"
func sbrk0() uintptr func sbrk0() uintptr
// Called from write_err_android.go only, but defined in sys_linux_*.s;
// declared here (instead of in write_err_android.go) for go vet on non-android builds.
// The return value is the raw syscall result, which may encode an error number.
//go:noescape
func access(name *byte, mode int32) int32
func connect(fd int32, addr unsafe.Pointer, len int32) int32
func socket(domain int32, typ int32, prot int32) int32
...@@ -295,7 +295,7 @@ int i386_set_ldt(int, const union ldt_entry *, int); ...@@ -295,7 +295,7 @@ int i386_set_ldt(int, const union ldt_entry *, int);
// setldt(int entry, int address, int limit) // setldt(int entry, int address, int limit)
TEXT runtime·setldt(SB),NOSPLIT,$32 TEXT runtime·setldt(SB),NOSPLIT,$32
MOVL address+4(FP), BX // aka base MOVL base+4(FP), BX
// see comment in sys_linux_386.s; freebsd is similar // see comment in sys_linux_386.s; freebsd is similar
ADDL $0x4, BX ADDL $0x4, BX
......
...@@ -474,6 +474,7 @@ TEXT runtime·clone(SB),NOSPLIT,$0 ...@@ -474,6 +474,7 @@ TEXT runtime·clone(SB),NOSPLIT,$0
RET RET
// Paranoia: check that SP is as we expect. // Paranoia: check that SP is as we expect.
NOP SP // tell vet SP changed - stop checking offsets
MOVL 12(SP), BP MOVL 12(SP), BP
CMPL BP, $1234 CMPL BP, $1234
JEQ 2(PC) JEQ 2(PC)
...@@ -572,7 +573,7 @@ GLOBL runtime·tls_entry_number(SB), NOPTR, $4 ...@@ -572,7 +573,7 @@ GLOBL runtime·tls_entry_number(SB), NOPTR, $4
// The name, setldt, is a misnomer, although we leave this name as it is for // The name, setldt, is a misnomer, although we leave this name as it is for
// the compatibility with other platforms. // the compatibility with other platforms.
TEXT runtime·setldt(SB),NOSPLIT,$32 TEXT runtime·setldt(SB),NOSPLIT,$32
MOVL address+4(FP), DX // base address MOVL base+4(FP), DX
#ifdef GOOS_android #ifdef GOOS_android
// Android stores the TLS offset in runtime·tls_g. // Android stores the TLS offset in runtime·tls_g.
......
...@@ -462,3 +462,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8 ...@@ -462,3 +462,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8
SYSCALL SYSCALL
MOVV R2, ret+0(FP) MOVV R2, ret+0(FP)
RET RET
TEXT runtime·access(SB),$0-20
MOVV R0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+16(FP) // for vet
RET
TEXT runtime·connect(SB),$0-28
MOVV R0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+24(FP) // for vet
RET
TEXT runtime·socket(SB),$0-20
MOVV R0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+16(FP) // for vet
RET
...@@ -492,3 +492,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT,$0-4 ...@@ -492,3 +492,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT,$0-4
SYSCALL SYSCALL
MOVW R2, ret+0(FP) MOVW R2, ret+0(FP)
RET RET
TEXT runtime·access(SB),$0-12
BREAK // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+8(FP) // for vet
RET
TEXT runtime·connect(SB),$0-16
BREAK // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+12(FP) // for vet
RET
TEXT runtime·socket(SB),$0-16
BREAK // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+12(FP) // for vet
RET
...@@ -616,3 +616,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0 ...@@ -616,3 +616,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0
SYSCALL $SYS_brk SYSCALL $SYS_brk
MOVD R3, ret+0(FP) MOVD R3, ret+0(FP)
RET RET
TEXT runtime·access(SB),$0-20
MOVD R0, 0(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+16(FP) // for vet
RET
TEXT runtime·connect(SB),$0-28
MOVD R0, 0(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+24(FP) // for vet
RET
TEXT runtime·socket(SB),$0-20
MOVD R0, 0(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+16(FP) // for vet
RET
...@@ -446,3 +446,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8 ...@@ -446,3 +446,18 @@ TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8
SYSCALL SYSCALL
MOVD R2, ret+0(FP) MOVD R2, ret+0(FP)
RET RET
TEXT runtime·access(SB),$0-20
MOVD $0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+16(FP)
RET
TEXT runtime·connect(SB),$0-28
MOVD $0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+24(FP)
RET
TEXT runtime·socket(SB),$0-20
MOVD $0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
MOVW R0, ret+16(FP)
RET
...@@ -287,7 +287,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$20 ...@@ -287,7 +287,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$20
RET RET
TEXT runtime·setldt(SB),NOSPLIT,$8 TEXT runtime·setldt(SB),NOSPLIT,$8
MOVL addr+4(FP), BX // aka base MOVL base+4(FP), BX
ADDL $0x8, BX ADDL $0x8, BX
MOVL BX, 0(SP) MOVL BX, 0(SP)
NACL_SYSCALL(SYS_tls_init) NACL_SYSCALL(SYS_tls_init)
......
...@@ -361,7 +361,7 @@ TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 ...@@ -361,7 +361,7 @@ TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
TEXT runtime·setldt(SB),NOSPLIT,$8 TEXT runtime·setldt(SB),NOSPLIT,$8
// Under NetBSD we set the GS base instead of messing with the LDT. // Under NetBSD we set the GS base instead of messing with the LDT.
MOVL 16(SP), AX // tls0 MOVL base+4(FP), AX
MOVL AX, 0(SP) MOVL AX, 0(SP)
CALL runtime·settls(SB) CALL runtime·settls(SB)
RET RET
......
...@@ -329,7 +329,7 @@ TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 ...@@ -329,7 +329,7 @@ TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
TEXT runtime·setldt(SB),NOSPLIT,$4 TEXT runtime·setldt(SB),NOSPLIT,$4
// Under OpenBSD we set the GS base instead of messing with the LDT. // Under OpenBSD we set the GS base instead of messing with the LDT.
MOVL tls0+4(FP), AX MOVL base+4(FP), AX
MOVL AX, 0(SP) MOVL AX, 0(SP)
CALL runtime·settls(SB) CALL runtime·settls(SB)
RET RET
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
#include "go_tls.h" #include "go_tls.h"
#include "textflag.h" #include "textflag.h"
// setldt(int entry, int address, int limit)
TEXT runtime·setldt(SB),NOSPLIT,$0
RET
TEXT runtime·open(SB),NOSPLIT,$0 TEXT runtime·open(SB),NOSPLIT,$0
MOVQ $14, BP MOVQ $14, BP
SYSCALL SYSCALL
......
...@@ -354,7 +354,7 @@ TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0 ...@@ -354,7 +354,7 @@ TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0
// setldt(int entry, int address, int limit) // setldt(int entry, int address, int limit)
TEXT runtime·setldt(SB),NOSPLIT,$0 TEXT runtime·setldt(SB),NOSPLIT,$0
MOVL address+4(FP), CX MOVL base+4(FP), CX
MOVL CX, 0x14(FS) MOVL CX, 0x14(FS)
RET RET
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment