Commit 3b4bccc8 authored by Russ Cox's avatar Russ Cox

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
parent e8a74dca
...@@ -119,6 +119,7 @@ ok2: ...@@ -119,6 +119,7 @@ ok2:
// func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) // 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. // Kernel interface gets call sub-number and pointer to a0.
TEXT ·socketcall(SB),NOSPLIT,$0-36 TEXT ·socketcall(SB),NOSPLIT,$0-36
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL $SYS_SOCKETCALL, AX // syscall entry MOVL $SYS_SOCKETCALL, AX // syscall entry
MOVL 4(SP), BX // socket call number MOVL 4(SP), BX // socket call number
...@@ -143,6 +144,7 @@ oksock: ...@@ -143,6 +144,7 @@ oksock:
// func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) // 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. // Kernel interface gets call sub-number and pointer to a0.
TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
GO_ARGS
MOVL $SYS_SOCKETCALL, AX // syscall entry MOVL $SYS_SOCKETCALL, AX // syscall entry
MOVL 4(SP), BX // socket call number MOVL 4(SP), BX // socket call number
LEAL 8(SP), CX // pointer to call arguments LEAL 8(SP), CX // pointer to call arguments
...@@ -168,6 +170,7 @@ oksock1: ...@@ -168,6 +170,7 @@ oksock1:
// Underlying system call is // Underlying system call is
// llseek(int fd, int offhi, int offlo, int64 *result, int whence) // llseek(int fd, int offhi, int offlo, int64 *result, int whence)
TEXT ·seek(SB),NOSPLIT,$0-28 TEXT ·seek(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL $SYS__LLSEEK, AX // syscall entry MOVL $SYS__LLSEEK, AX // syscall entry
MOVL 4(SP), BX // fd MOVL 4(SP), BX // fd
......
...@@ -116,6 +116,7 @@ ok2: ...@@ -116,6 +116,7 @@ ok2:
RET RET
TEXT ·gettimeofday(SB),NOSPLIT,$0-16 TEXT ·gettimeofday(SB),NOSPLIT,$0-16
GO_ARGS
MOVQ 8(SP), DI MOVQ 8(SP), DI
MOVQ $0, SI MOVQ $0, SI
MOVQ runtime·__vdso_gettimeofday_sym(SB), AX MOVQ runtime·__vdso_gettimeofday_sym(SB), AX
......
...@@ -111,6 +111,7 @@ ok2: ...@@ -111,6 +111,7 @@ ok2:
// Underlying system call is // Underlying system call is
// llseek(int fd, int offhi, int offlo, int64 *result, int whence) // llseek(int fd, int offhi, int offlo, int64 *result, int whence)
TEXT ·seek(SB),NOSPLIT,$0-32 TEXT ·seek(SB),NOSPLIT,$0-32
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW $SYS__LLSEEK, R7 // syscall entry MOVW $SYS__LLSEEK, R7 // syscall entry
MOVW 4(SP), R0 // fd MOVW 4(SP), R0 // fd
......
...@@ -132,6 +132,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 ...@@ -132,6 +132,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) //func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
TEXT ·seek(SB),NOSPLIT,$0-36 TEXT ·seek(SB),NOSPLIT,$0-36
GO_ARGS
LEAL newoffset+24(SP), AX LEAL newoffset+24(SP), AX
MOVL AX, placeholder+4(SP) MOVL AX, placeholder+4(SP)
...@@ -163,6 +164,8 @@ copyresult6: ...@@ -163,6 +164,8 @@ copyresult6:
//func exit(code int) //func exit(code int)
// Import runtime·exit for cleanly exiting. // Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),NOSPLIT,$4-4 TEXT ·exit(SB),NOSPLIT,$4-4
GO_ARGS
NO_LOCAL_POINTERS
MOVL code+0(FP), AX MOVL code+0(FP), AX
MOVL AX, 0(SP) MOVL AX, 0(SP)
CALL runtime·exit(SB) CALL runtime·exit(SB)
......
...@@ -131,6 +131,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 ...@@ -131,6 +131,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) //func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
TEXT ·seek(SB),NOSPLIT,$0-56 TEXT ·seek(SB),NOSPLIT,$0-56
GO_ARGS
LEAQ newoffset+40(SP), AX LEAQ newoffset+40(SP), AX
MOVQ AX, placeholder+8(SP) MOVQ AX, placeholder+8(SP)
...@@ -161,6 +162,8 @@ copyresult6: ...@@ -161,6 +162,8 @@ copyresult6:
//func exit(code int) //func exit(code int)
// Import runtime·exit for cleanly exiting. // Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),NOSPLIT,$8-8 TEXT ·exit(SB),NOSPLIT,$8-8
GO_ARGS
NO_LOCAL_POINTERS
MOVQ code+0(FP), AX MOVQ code+0(FP), AX
MOVQ AX, 0(SP) MOVQ AX, 0(SP)
CALL runtime·exit(SB) CALL runtime·exit(SB)
......
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