mirror of
https://github.com/golang/go
synced 2024-11-23 14:50:07 -07:00
syscall: fix stack frame sizes in assembly
for GOOS in darwin freebsd linux nacl netbsd openbsd plan9 solaris windows do for GOARCH in 386 amd64 amd64p32 arm do go vet done done These are all real mistakes being corrected, but none of them should be able to cause problems today due to the NOSPLIT on the functions. However, vet has also identified a few important problems. I'm sending this CL to get rid of the trivial 'go vet' results before attacking the real ones. LGTM=r R=golang-codereviews, r, bradfitz CC=golang-codereviews https://golang.org/cl/95460046
This commit is contained in:
parent
42ea2eda49
commit
7ad60b7283
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -12,7 +15,7 @@
|
||||
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
|
||||
// Trap # in AX, args on stack above caller pc.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -63,7 +66,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-56
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -93,7 +96,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -114,7 +117,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -12,7 +15,7 @@
|
||||
// func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64);
|
||||
// Trap # in AX, args in DI SI DX, return in AX DX
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -60,7 +63,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -81,7 +84,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -12,7 +15,7 @@
|
||||
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
|
||||
// Trap # in AX, args on stack above caller pc.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -63,7 +66,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-56
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -93,7 +96,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -114,7 +117,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -18,7 +21,7 @@
|
||||
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64)
|
||||
// Trap # in AX, args in DI SI DX, return in AX DX
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -41,7 +44,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -64,7 +67,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-112
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX
|
||||
MOVQ 16(SP), DI
|
||||
@ -97,7 +100,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -117,7 +120,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -11,7 +14,7 @@
|
||||
// func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
|
||||
// Trap # in AX, args in BX CX DX SI DI, return in AX
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
RET
|
||||
|
||||
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
@ -62,7 +65,7 @@ ok6:
|
||||
RET
|
||||
|
||||
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
MOVL 12(SP), CX
|
||||
@ -84,7 +87,7 @@ ok1:
|
||||
RET
|
||||
|
||||
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
MOVL 12(SP), CX
|
||||
@ -110,7 +113,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-40
|
||||
TEXT ·socketcall(SB),NOSPLIT,$0-36
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL $SYS_SOCKETCALL, AX // syscall entry
|
||||
MOVL 4(SP), BX // socket call number
|
||||
@ -134,7 +137,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-40
|
||||
TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
|
||||
MOVL $SYS_SOCKETCALL, AX // syscall entry
|
||||
MOVL 4(SP), BX // socket call number
|
||||
LEAL 8(SP), CX // pointer to call arguments
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -13,7 +16,7 @@
|
||||
// Note that this differs from "standard" ABI convention, which
|
||||
// would pass 4th arg in CX, not R10.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -38,7 +41,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -63,7 +66,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -85,7 +88,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define NACL_SYSJMP(code) \
|
||||
MOVL $(0x10000 + ((code)<<5)), AX; JMP AX
|
||||
|
||||
TEXT syscall·Syscall(SB),NOSPLIT,$12-32
|
||||
TEXT syscall·Syscall(SB),NOSPLIT,$12-28
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL trap+0(FP), AX
|
||||
MOVL a1+4(FP), BX
|
||||
@ -32,12 +32,12 @@ TEXT syscall·Syscall(SB),NOSPLIT,$12-32
|
||||
MOVL $-1, r1+16(FP)
|
||||
MOVL $-1, r2+20(FP)
|
||||
NEGL AX
|
||||
MOVL AX, errno+24(FP)
|
||||
MOVL AX, err+24(FP)
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok:
|
||||
MOVL AX, r1+16(FP)
|
||||
MOVL DX, r2+20(FP)
|
||||
MOVL $0, errno+24(FP)
|
||||
MOVL $0, err+24(FP)
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define NACL_SYSJMP(code) \
|
||||
MOVL $(0x10000 + ((code)<<5)), AX; JMP AX
|
||||
|
||||
TEXT syscall·Syscall(SB),NOSPLIT,$0-32
|
||||
TEXT syscall·Syscall(SB),NOSPLIT,$0-28
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL trap+0(FP), AX
|
||||
MOVL a1+4(FP), DI
|
||||
@ -30,12 +30,12 @@ TEXT syscall·Syscall(SB),NOSPLIT,$0-32
|
||||
MOVL $-1, r1+16(FP)
|
||||
MOVL $-1, r2+20(FP)
|
||||
NEGL AX
|
||||
MOVL AX, errno+24(FP)
|
||||
MOVL AX, err+24(FP)
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok:
|
||||
MOVL AX, r1+16(FP)
|
||||
MOVL DX, r2+20(FP)
|
||||
MOVL $0, errno+24(FP)
|
||||
MOVL $0, err+24(FP)
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -12,7 +15,7 @@
|
||||
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
|
||||
// Trap # in AX, args on stack above caller pc.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -63,7 +66,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-56
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -93,7 +96,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -114,7 +117,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -13,7 +16,7 @@
|
||||
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64);
|
||||
// Trap # in AX, args in DI SI DX, return in AX DX
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -59,7 +62,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-112
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -91,7 +94,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -111,7 +114,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -12,7 +15,7 @@
|
||||
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
|
||||
// Trap # in AX, args on stack above caller pc.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -63,7 +66,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-56
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -93,7 +96,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -114,7 +117,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -13,7 +16,7 @@
|
||||
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64);
|
||||
// Trap # in AX, args in DI SI DX, return in AX DX
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -36,7 +39,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -59,7 +62,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-112
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -91,7 +94,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -111,7 +114,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -87,7 +90,7 @@ copyresult4:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -102,7 +105,7 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-32
|
||||
MOVL AX, err+28(SP)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -123,7 +126,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
|
||||
#define SYS_SEEK 39 /* from zsysnum_plan9_386.go */
|
||||
|
||||
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
|
||||
TEXT ·seek(SB),NOSPLIT,$0-40
|
||||
TEXT ·seek(SB),NOSPLIT,$0-36
|
||||
LEAL newoffset+24(SP), AX
|
||||
MOVL AX, placeholder+4(SP)
|
||||
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
#include "../../cmd/ld/textflag.h"
|
||||
|
||||
//
|
||||
@ -91,7 +94,7 @@ copyresult4:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||
MOVQ $0x8000, AX // for NxM
|
||||
MOVQ 8(SP), BP // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -107,7 +110,7 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
||||
MOVQ AX, err+56(SP)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||
MOVQ $0x8000, AX // for NxM
|
||||
MOVQ 8(SP), BP // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -129,7 +132,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
||||
#define SYS_SEEK 39 /* from zsysnum_plan9_amd64.go */
|
||||
|
||||
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
|
||||
TEXT ·seek(SB),NOSPLIT,$0-64
|
||||
TEXT ·seek(SB),NOSPLIT,$0-56
|
||||
LEAQ newoffset+40(SP), AX
|
||||
MOVQ AX, placeholder+8(SP)
|
||||
|
||||
@ -160,7 +163,7 @@ copyresult6:
|
||||
|
||||
//func exit(code int)
|
||||
// Import runtime·exit for cleanly exiting.
|
||||
TEXT ·exit(SB),NOSPLIT,$8-4
|
||||
TEXT ·exit(SB),NOSPLIT,$8-8
|
||||
MOVQ code+0(FP), AX
|
||||
MOVQ AX, 0(SP)
|
||||
CALL runtime·exit(SB)
|
||||
|
@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
|
||||
// so that go vet can check that they are correct.
|
||||
|
||||
package syscall
|
||||
|
||||
import "unsafe"
|
||||
|
@ -83,7 +83,7 @@ func errstr() string {
|
||||
}
|
||||
|
||||
// Implemented in assembly to import from runtime.
|
||||
func exit(int)
|
||||
func exit(code int)
|
||||
|
||||
func Exit(code int) { exit(code) }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user