1
0
mirror of https://github.com/golang/go synced 2024-10-02 12:18:33 -06:00

syscall: add GO_ARGS to Go-called assembly

Fixes sporadic linux/386 build failure (untyped args)
and probably some others we haven't observed yet.

Fixes #8727.

TBR=iant
R=golang-codereviews
CC=bradfitz, golang-codereviews, iant, khr, r
https://golang.org/cl/143930043
This commit is contained in:
Russ Cox 2014-09-14 22:27:03 -04:00
parent e8a74dcad9
commit 3b4bccc820
5 changed files with 11 additions and 0 deletions

View File

@ -119,6 +119,7 @@ ok2:
// func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int)
// Kernel interface gets call sub-number and pointer to a0.
TEXT ·socketcall(SB),NOSPLIT,$0-36
GO_ARGS
CALL runtime·entersyscall(SB)
MOVL $SYS_SOCKETCALL, AX // syscall entry
MOVL 4(SP), BX // socket call number
@ -143,6 +144,7 @@ oksock:
// func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int)
// Kernel interface gets call sub-number and pointer to a0.
TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
GO_ARGS
MOVL $SYS_SOCKETCALL, AX // syscall entry
MOVL 4(SP), BX // socket call number
LEAL 8(SP), CX // pointer to call arguments
@ -168,6 +170,7 @@ oksock1:
// Underlying system call is
// llseek(int fd, int offhi, int offlo, int64 *result, int whence)
TEXT ·seek(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB)
MOVL $SYS__LLSEEK, AX // syscall entry
MOVL 4(SP), BX // fd

View File

@ -116,6 +116,7 @@ ok2:
RET
TEXT ·gettimeofday(SB),NOSPLIT,$0-16
GO_ARGS
MOVQ 8(SP), DI
MOVQ $0, SI
MOVQ runtime·__vdso_gettimeofday_sym(SB), AX

View File

@ -111,6 +111,7 @@ ok2:
// Underlying system call is
// llseek(int fd, int offhi, int offlo, int64 *result, int whence)
TEXT ·seek(SB),NOSPLIT,$0-32
GO_ARGS
BL runtime·entersyscall(SB)
MOVW $SYS__LLSEEK, R7 // syscall entry
MOVW 4(SP), R0 // fd

View File

@ -132,6 +132,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
TEXT ·seek(SB),NOSPLIT,$0-36
GO_ARGS
LEAL newoffset+24(SP), AX
MOVL AX, placeholder+4(SP)
@ -163,6 +164,8 @@ copyresult6:
//func exit(code int)
// Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),NOSPLIT,$4-4
GO_ARGS
NO_LOCAL_POINTERS
MOVL code+0(FP), AX
MOVL AX, 0(SP)
CALL runtime·exit(SB)

View File

@ -131,6 +131,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
TEXT ·seek(SB),NOSPLIT,$0-56
GO_ARGS
LEAQ newoffset+40(SP), AX
MOVQ AX, placeholder+8(SP)
@ -161,6 +162,8 @@ copyresult6:
//func exit(code int)
// Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),NOSPLIT,$8-8
GO_ARGS
NO_LOCAL_POINTERS
MOVQ code+0(FP), AX
MOVQ AX, 0(SP)
CALL runtime·exit(SB)