From 4179439de8166ded9bf097c216e6596ead2ee433 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 12 Sep 2014 00:23:03 -0400 Subject: [PATCH] syscall: make func Syscall use pointer maps from Go prototypes Before, Syscall and friends were having their arguments treated conservatively. Now they will use the Go prototype, which will mean the arguments are not considered pointers at all. This is safe because of CL 139360044. The fact that all these non-Solaris systems were using conservative scanning of the Syscall arguments is why the failure that prompted CL 139360044 was only observed on Solaris, which does something completely different. If we'd done this earlier, we'd have seen the Solaris failure in more places. LGTM=khr R=khr CC=golang-codereviews https://golang.org/cl/144730043 --- src/syscall/asm_darwin_386.s | 5 +++++ src/syscall/asm_darwin_amd64.s | 5 +++++ src/syscall/asm_dragonfly_386.s | 5 +++++ src/syscall/asm_dragonfly_amd64.s | 5 +++++ src/syscall/asm_freebsd_386.s | 5 +++++ src/syscall/asm_freebsd_amd64.s | 5 +++++ src/syscall/asm_freebsd_arm.s | 5 +++++ src/syscall/asm_linux_386.s | 4 ++++ src/syscall/asm_linux_amd64.s | 4 ++++ src/syscall/asm_linux_arm.s | 4 ++++ src/syscall/asm_nacl_386.s | 1 + src/syscall/asm_nacl_amd64p32.s | 1 + src/syscall/asm_nacl_arm.s | 1 + src/syscall/asm_netbsd_386.s | 5 +++++ src/syscall/asm_netbsd_amd64.s | 5 +++++ src/syscall/asm_netbsd_arm.s | 5 +++++ src/syscall/asm_openbsd_386.s | 5 +++++ src/syscall/asm_openbsd_amd64.s | 5 +++++ src/syscall/asm_plan9_386.s | 4 ++++ src/syscall/asm_plan9_amd64.s | 4 ++++ 20 files changed, 83 insertions(+) diff --git a/src/syscall/asm_darwin_386.s b/src/syscall/asm_darwin_386.s index dfe94fb526..4d60a817ee 100644 --- a/src/syscall/asm_darwin_386.s +++ b/src/syscall/asm_darwin_386.s @@ -16,6 +16,7 @@ // Trap # in AX, args on stack above caller pc. TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -40,6 +41,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -67,6 +69,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-52 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -97,6 +100,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI @@ -118,6 +122,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI diff --git a/src/syscall/asm_darwin_amd64.s b/src/syscall/asm_darwin_amd64.s index d6f1c96f5f..a3b1bd5346 100644 --- a/src/syscall/asm_darwin_amd64.s +++ b/src/syscall/asm_darwin_amd64.s @@ -6,6 +6,7 @@ // so that go vet can check that they are correct. #include "textflag.h" +#include "funcdata.h" // // System call support for AMD64, Darwin @@ -16,6 +17,7 @@ // Trap # in AX, args in DI SI DX, return in AX DX TEXT ·Syscall(SB),NOSPLIT,$0-56 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -40,6 +42,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -64,6 +67,7 @@ ok6: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX @@ -85,6 +89,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX diff --git a/src/syscall/asm_dragonfly_386.s b/src/syscall/asm_dragonfly_386.s index 37d655fba9..59cb39e447 100644 --- a/src/syscall/asm_dragonfly_386.s +++ b/src/syscall/asm_dragonfly_386.s @@ -13,6 +13,7 @@ // Trap # in AX, args on stack above caller pc. TEXT ·Syscall(SB),NOSPLIT,$0-32 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -37,6 +38,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-44 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -64,6 +66,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-56 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -94,6 +97,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-32 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI @@ -115,6 +119,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-44 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI diff --git a/src/syscall/asm_dragonfly_amd64.s b/src/syscall/asm_dragonfly_amd64.s index c8434f96b7..764c7bda37 100644 --- a/src/syscall/asm_dragonfly_amd64.s +++ b/src/syscall/asm_dragonfly_amd64.s @@ -14,6 +14,7 @@ // Trap # in AX, args in DI SI DX, return in AX DX TEXT ·Syscall(SB),NOSPLIT,$0-64 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -37,6 +38,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-88 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -60,6 +62,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-112 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX MOVQ 16(SP), DI @@ -93,6 +96,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-64 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX @@ -113,6 +117,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX diff --git a/src/syscall/asm_freebsd_386.s b/src/syscall/asm_freebsd_386.s index f50b5a09bf..b711aa5ad6 100644 --- a/src/syscall/asm_freebsd_386.s +++ b/src/syscall/asm_freebsd_386.s @@ -16,6 +16,7 @@ // Trap # in AX, args on stack above caller pc. TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -40,6 +41,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -67,6 +69,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-52 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -97,6 +100,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI @@ -118,6 +122,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI diff --git a/src/syscall/asm_freebsd_amd64.s b/src/syscall/asm_freebsd_amd64.s index 58cbfe1a99..95583b95c4 100644 --- a/src/syscall/asm_freebsd_amd64.s +++ b/src/syscall/asm_freebsd_amd64.s @@ -22,6 +22,7 @@ // Trap # in AX, args in DI SI DX, return in AX DX TEXT ·Syscall(SB),NOSPLIT,$0-56 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -45,6 +46,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -68,6 +70,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-104 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX MOVQ 16(SP), DI @@ -101,6 +104,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX @@ -121,6 +125,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX diff --git a/src/syscall/asm_freebsd_arm.s b/src/syscall/asm_freebsd_arm.s index 5eb40334b9..5588eaaa43 100644 --- a/src/syscall/asm_freebsd_arm.s +++ b/src/syscall/asm_freebsd_arm.s @@ -13,6 +13,7 @@ // func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, errno uintptr) TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS BL runtime·entersyscall(SB) MOVW 0(FP), R7 // syscall number MOVW 4(FP), R0 // a1 @@ -35,6 +36,7 @@ error: RET TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS BL runtime·entersyscall(SB) MOVW 0(FP), R7 // syscall number MOVW 4(FP), R0 // a1 @@ -61,6 +63,7 @@ error6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-52 + GO_ARGS BL runtime·entersyscall(SB) MOVW 0(FP), R7 // syscall number MOVW 4(FP), R0 // a1 @@ -87,6 +90,7 @@ error9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVW 0(FP), R7 // syscall number MOVW 4(FP), R0 // a1 MOVW 8(FP), R1 // a2 @@ -106,6 +110,7 @@ errorr: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVW 0(FP), R7 // syscall number MOVW 4(FP), R0 // a1 MOVW 8(FP), R1 // a2 diff --git a/src/syscall/asm_linux_386.s b/src/syscall/asm_linux_386.s index 05cf89aa22..fb3a3b9bd8 100644 --- a/src/syscall/asm_linux_386.s +++ b/src/syscall/asm_linux_386.s @@ -15,6 +15,7 @@ // Trap # in AX, args in BX CX DX SI DI, return in AX TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry MOVL 8(SP), BX @@ -40,6 +41,7 @@ ok: // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry MOVL 8(SP), BX @@ -66,6 +68,7 @@ ok6: // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVL 4(SP), AX // syscall entry MOVL 8(SP), BX MOVL 12(SP), CX @@ -88,6 +91,7 @@ ok1: // func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVL 4(SP), AX // syscall entry MOVL 8(SP), BX MOVL 12(SP), CX diff --git a/src/syscall/asm_linux_amd64.s b/src/syscall/asm_linux_amd64.s index 514693283b..fb6672624c 100644 --- a/src/syscall/asm_linux_amd64.s +++ b/src/syscall/asm_linux_amd64.s @@ -17,6 +17,7 @@ // would pass 4th arg in CX, not R10. TEXT ·Syscall(SB),NOSPLIT,$0-56 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -42,6 +43,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 16(SP), DI MOVQ 24(SP), SI @@ -67,6 +69,7 @@ ok6: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX @@ -89,6 +92,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX diff --git a/src/syscall/asm_linux_arm.s b/src/syscall/asm_linux_arm.s index 3be0a13e17..edb5b21a74 100644 --- a/src/syscall/asm_linux_arm.s +++ b/src/syscall/asm_linux_arm.s @@ -13,6 +13,7 @@ // func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS BL runtime·entersyscall(SB) MOVW 4(SP), R7 MOVW 8(SP), R0 @@ -44,6 +45,7 @@ ok: // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // Actually Syscall5 but the rest of the code expects it to be named Syscall6. TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS BL runtime·entersyscall(SB) MOVW 4(SP), R7 // syscall entry MOVW 8(SP), R0 @@ -75,6 +77,7 @@ ok6: // func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // Actually RawSyscall5 but the rest of the code expects it to be named RawSyscall6. TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVW 4(SP), R7 // syscall entry MOVW 8(SP), R0 MOVW 12(SP), R1 @@ -134,6 +137,7 @@ okseek: // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVW 4(SP), R7 // syscall entry MOVW 8(SP), R0 MOVW 12(SP), R1 diff --git a/src/syscall/asm_nacl_386.s b/src/syscall/asm_nacl_386.s index 3c86decd39..655248b37f 100644 --- a/src/syscall/asm_nacl_386.s +++ b/src/syscall/asm_nacl_386.s @@ -16,6 +16,7 @@ MOVL $(0x10000 + ((code)<<5)), AX; JMP AX TEXT syscall·Syscall(SB),NOSPLIT,$12-28 + GO_ARGS CALL runtime·entersyscall(SB) MOVL trap+0(FP), AX MOVL a1+4(FP), BX diff --git a/src/syscall/asm_nacl_amd64p32.s b/src/syscall/asm_nacl_amd64p32.s index b91e09bd6d..33f8220134 100644 --- a/src/syscall/asm_nacl_amd64p32.s +++ b/src/syscall/asm_nacl_amd64p32.s @@ -16,6 +16,7 @@ MOVL $(0x10000 + ((code)<<5)), AX; JMP AX TEXT syscall·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS CALL runtime·entersyscall(SB) MOVL trap+0(FP), AX MOVL a1+4(FP), DI diff --git a/src/syscall/asm_nacl_arm.s b/src/syscall/asm_nacl_arm.s index cc4b9cd2d6..536d751b50 100644 --- a/src/syscall/asm_nacl_arm.s +++ b/src/syscall/asm_nacl_arm.s @@ -16,6 +16,7 @@ MOVW $(0x10000 + ((code)<<5)), R8; B (R8) TEXT syscall·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS BL runtime·entersyscall(SB) MOVW trap+0(FP), R8 MOVW a1+4(FP), R0 diff --git a/src/syscall/asm_netbsd_386.s b/src/syscall/asm_netbsd_386.s index c58263254a..9dc6a9242a 100644 --- a/src/syscall/asm_netbsd_386.s +++ b/src/syscall/asm_netbsd_386.s @@ -16,6 +16,7 @@ // Trap # in AX, args on stack above caller pc. TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -40,6 +41,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -67,6 +69,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-52 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -97,6 +100,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI @@ -118,6 +122,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI diff --git a/src/syscall/asm_netbsd_amd64.s b/src/syscall/asm_netbsd_amd64.s index 8285382ce2..d6bb1dd091 100644 --- a/src/syscall/asm_netbsd_amd64.s +++ b/src/syscall/asm_netbsd_amd64.s @@ -17,6 +17,7 @@ // Trap # in AX, args in DI SI DX, return in AX DX TEXT ·Syscall(SB),NOSPLIT,$0-56 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX // syscall entry MOVQ 16(SP), DI @@ -40,6 +41,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX // syscall entry MOVQ 16(SP), DI @@ -63,6 +65,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-104 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX // syscall entry MOVQ 16(SP), DI @@ -95,6 +98,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX @@ -115,6 +119,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX diff --git a/src/syscall/asm_netbsd_arm.s b/src/syscall/asm_netbsd_arm.s index b061180491..357e28d947 100644 --- a/src/syscall/asm_netbsd_arm.s +++ b/src/syscall/asm_netbsd_arm.s @@ -13,6 +13,7 @@ // func Syscall9(trap int32, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int32) TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS BL runtime·entersyscall(SB) MOVW 0(FP), R0 // sigcall num MOVW 4(FP), R1 // a1 @@ -35,6 +36,7 @@ error: RET TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS BL runtime·entersyscall(SB) MOVW 0(FP), R0 // sigcall num MOVW 4(FP), R1 // a1 @@ -60,6 +62,7 @@ error6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-52 + GO_ARGS BL runtime·entersyscall(SB) MOVW 0(FP), R0 // sigcall num MOVW 4(FP), R1 // a1 @@ -85,6 +88,7 @@ error9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVW 0(FP), R0 // sigcall num MOVW 4(FP), R1 // a1 MOVW 8(FP), R2 // a2 @@ -104,6 +108,7 @@ errorr: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVW 0(FP), R0 // sigcall num MOVW 4(FP), R1 // a1 MOVW 8(FP), R2 // a2 diff --git a/src/syscall/asm_openbsd_386.s b/src/syscall/asm_openbsd_386.s index 17fbb65c80..6c51f197ee 100644 --- a/src/syscall/asm_openbsd_386.s +++ b/src/syscall/asm_openbsd_386.s @@ -16,6 +16,7 @@ // Trap # in AX, args on stack above caller pc. TEXT ·Syscall(SB),NOSPLIT,$0-28 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -40,6 +41,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-40 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -67,6 +69,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-52 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -97,6 +100,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI @@ -118,6 +122,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI diff --git a/src/syscall/asm_openbsd_amd64.s b/src/syscall/asm_openbsd_amd64.s index fe61482cd5..4ba5844e49 100644 --- a/src/syscall/asm_openbsd_amd64.s +++ b/src/syscall/asm_openbsd_amd64.s @@ -17,6 +17,7 @@ // Trap # in AX, args in DI SI DX, return in AX DX TEXT ·Syscall(SB),NOSPLIT,$0-56 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX // syscall entry MOVQ 16(SP), DI @@ -40,6 +41,7 @@ ok: RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX // syscall entry MOVQ 16(SP), DI @@ -63,6 +65,7 @@ ok6: RET TEXT ·Syscall9(SB),NOSPLIT,$0-104 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), AX // syscall entry MOVQ 16(SP), DI @@ -95,6 +98,7 @@ ok9: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX @@ -115,6 +119,7 @@ ok1: RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + GO_ARGS MOVQ 16(SP), DI MOVQ 24(SP), SI MOVQ 32(SP), DX diff --git a/src/syscall/asm_plan9_386.s b/src/syscall/asm_plan9_386.s index aaa8b9a692..30726b4d00 100644 --- a/src/syscall/asm_plan9_386.s +++ b/src/syscall/asm_plan9_386.s @@ -18,6 +18,7 @@ // Trap # in AX, args on stack above caller pc. TEXT ·Syscall(SB),NOSPLIT,$0-32 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -53,6 +54,7 @@ copyresult3: RET TEXT ·Syscall6(SB),NOSPLIT,$0-44 + GO_ARGS CALL runtime·entersyscall(SB) MOVL 4(SP), AX // syscall entry // slide args down on top of system call number @@ -91,6 +93,7 @@ copyresult4: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI @@ -106,6 +109,7 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-28 RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + GO_ARGS MOVL 4(SP), AX // syscall entry // slide args down on top of system call number LEAL 8(SP), SI diff --git a/src/syscall/asm_plan9_amd64.s b/src/syscall/asm_plan9_amd64.s index 22dc5f9576..3e61318cd5 100644 --- a/src/syscall/asm_plan9_amd64.s +++ b/src/syscall/asm_plan9_amd64.s @@ -17,6 +17,7 @@ //func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) TEXT ·Syscall(SB),NOSPLIT,$0-64 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), BP // syscall entry // slide args down on top of system call number @@ -52,6 +53,7 @@ copyresult3: RET TEXT ·Syscall6(SB),NOSPLIT,$0-88 + GO_ARGS CALL runtime·entersyscall(SB) MOVQ 8(SP), BP // syscall entry // slide args down on top of system call number @@ -90,6 +92,7 @@ copyresult4: RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + GO_ARGS MOVQ 8(SP), BP // syscall entry // slide args down on top of system call number LEAQ 16(SP), SI @@ -105,6 +108,7 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-56 RET TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + GO_ARGS MOVQ 8(SP), BP // syscall entry // slide args down on top of system call number LEAQ 16(SP), SI