mirror of
https://github.com/golang/go
synced 2024-11-18 10:04:43 -07:00
syscall: record argument size for all assembly functions
While we're here, fix Syscall9 on NetBSD and OpenBSD: it was storing the results into the wrong memory locations. I guess no one uses that function's results on those systems. Part of cleaning up stack traces and argument frame information. R=golang-dev, dvyukov CC=golang-dev https://golang.org/cl/11355044
This commit is contained in:
parent
47b89a37d9
commit
e69082ffdb
@ -10,7 +10,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-44
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -61,7 +61,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -91,7 +91,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-32
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -112,7 +112,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-44
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -10,7 +10,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-64
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-88
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -58,7 +58,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-64
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -79,7 +79,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-88
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -10,7 +10,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-44
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -61,7 +61,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -91,7 +91,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-32
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -112,7 +112,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-44
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -11,7 +11,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-64
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-88
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -57,7 +57,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-112
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX
|
||||
MOVQ 16(SP), DI
|
||||
@ -90,7 +90,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-64
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -110,7 +110,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-88
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -10,7 +10,7 @@
|
||||
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
|
||||
// func Syscall9(trap int32, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int32)
|
||||
|
||||
TEXT ·Syscall(SB),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-28
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
@ -32,7 +32,7 @@ error:
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-40
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
@ -57,7 +57,7 @@ error6:
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-52
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
@ -82,7 +82,7 @@ error9:
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-28
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
@ -101,7 +101,7 @@ errorr:
|
||||
MOVW R0, 24(FP) // err
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-40
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
|
@ -9,7 +9,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
RET
|
||||
|
||||
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-44
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
@ -60,7 +60,7 @@ ok6:
|
||||
RET
|
||||
|
||||
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-32
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
MOVL 12(SP), CX
|
||||
@ -82,7 +82,7 @@ ok1:
|
||||
RET
|
||||
|
||||
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-44
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
MOVL 8(SP), BX
|
||||
MOVL 12(SP), CX
|
||||
@ -108,7 +108,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),7,$0
|
||||
TEXT ·socketcall(SB),7,$0-40
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL $SYS_SOCKETCALL, AX // syscall entry
|
||||
MOVL 4(SP), BX // socket call number
|
||||
@ -132,7 +132,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),7,$0
|
||||
TEXT ·rawsocketcall(SB),7,$0-40
|
||||
MOVL $SYS_SOCKETCALL, AX // syscall entry
|
||||
MOVL 4(SP), BX // socket call number
|
||||
LEAL 8(SP), CX // pointer to call arguments
|
||||
@ -157,7 +157,7 @@ oksock1:
|
||||
// taking the address of the return value newoffset.
|
||||
// Underlying system call is
|
||||
// llseek(int fd, int offhi, int offlo, int64 *result, int whence)
|
||||
TEXT ·Seek(SB),7,$0
|
||||
TEXT ·Seek(SB),7,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL $SYS__LLSEEK, AX // syscall entry
|
||||
MOVL 4(SP), BX // fd
|
||||
|
@ -11,7 +11,7 @@
|
||||
// Note that this differs from "standard" ABI convention, which
|
||||
// would pass 4th arg in CX, not R10.
|
||||
|
||||
TEXT ·Syscall(SB),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-64
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -36,7 +36,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-88
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
@ -61,7 +61,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-64
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -83,7 +83,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-88
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -105,7 +105,7 @@ ok2:
|
||||
MOVQ $0, 80(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·Gettimeofday(SB),7,$0
|
||||
TEXT ·Gettimeofday(SB),7,$0-24
|
||||
MOVQ 8(SP), DI
|
||||
MOVQ $0, SI
|
||||
MOVQ runtime·__vdso_gettimeofday_sym(SB), AX
|
||||
@ -120,7 +120,7 @@ ok7:
|
||||
MOVQ $0, 16(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·Time(SB),7,$0
|
||||
TEXT ·Time(SB),7,$0-32
|
||||
MOVQ 8(SP), DI
|
||||
MOVQ runtime·__vdso_time_sym(SB), AX
|
||||
CALL AX
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
|
||||
|
||||
TEXT ·Syscall(SB),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-28
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 4(SP), R7
|
||||
MOVW 8(SP), R0
|
||||
@ -38,7 +38,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),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-40
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 4(SP), R7 // syscall entry
|
||||
MOVW 8(SP), R0
|
||||
@ -69,7 +69,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),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-40
|
||||
MOVW 4(SP), R7 // syscall entry
|
||||
MOVW 8(SP), R0
|
||||
MOVW 12(SP), R1
|
||||
@ -101,7 +101,7 @@ ok2:
|
||||
// taking the address of the return value newoffset.
|
||||
// Underlying system call is
|
||||
// llseek(int fd, int offhi, int offlo, int64 *result, int whence)
|
||||
TEXT ·Seek(SB),7,$0
|
||||
TEXT ·Seek(SB),7,$0-32
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW $SYS__LLSEEK, R7 // syscall entry
|
||||
MOVW 4(SP), R0 // fd
|
||||
@ -128,7 +128,7 @@ okseek:
|
||||
RET
|
||||
|
||||
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-28
|
||||
MOVW 4(SP), R7 // syscall entry
|
||||
MOVW 8(SP), R0
|
||||
MOVW 12(SP), R1
|
||||
|
@ -10,7 +10,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-44
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -61,7 +61,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -91,7 +91,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-32
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -112,7 +112,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-44
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -11,7 +11,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-64
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-88
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -57,7 +57,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-112
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -76,20 +76,20 @@ TEXT ·Syscall9(SB),7,$0
|
||||
SYSCALL
|
||||
JCC ok9
|
||||
ADDQ $32, SP
|
||||
MOVQ $-1, 64(SP) // r1
|
||||
MOVQ $0, 72(SP) // r2
|
||||
MOVQ AX, 80(SP) // errno
|
||||
MOVQ $-1, 88(SP) // r1
|
||||
MOVQ $0, 96(SP) // r2
|
||||
MOVQ AX, 104(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok9:
|
||||
ADDQ $32, SP
|
||||
MOVQ AX, 64(SP) // r1
|
||||
MOVQ DX, 72(SP) // r2
|
||||
MOVQ $0, 80(SP) // errno
|
||||
MOVQ AX, 88(SP) // r1
|
||||
MOVQ DX, 96(SP) // r2
|
||||
MOVQ $0, 104(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-64
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -109,7 +109,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-88
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -10,7 +10,7 @@
|
||||
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
|
||||
// func Syscall9(trap int32, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int32)
|
||||
|
||||
TEXT ·Syscall(SB),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-28
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
@ -32,7 +32,7 @@ error:
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-40
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
@ -57,7 +57,7 @@ error6:
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-52
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
@ -82,7 +82,7 @@ error9:
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-28
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
@ -101,7 +101,7 @@ errorr:
|
||||
MOVW R0, 24(FP) // err
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-40
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
|
@ -10,7 +10,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-44
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -61,7 +61,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-56
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -91,7 +91,7 @@ ok9:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-32
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -112,7 +112,7 @@ ok1:
|
||||
MOVL $0, 28(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-44
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
|
@ -11,7 +11,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),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-64
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -34,7 +34,7 @@ ok:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-88
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -57,7 +57,7 @@ ok6:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),7,$0
|
||||
TEXT ·Syscall9(SB),7,$0-112
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ 8(SP), AX // syscall entry
|
||||
MOVQ 16(SP), DI
|
||||
@ -76,20 +76,20 @@ TEXT ·Syscall9(SB),7,$0
|
||||
SYSCALL
|
||||
JCC ok9
|
||||
ADDQ $32, SP
|
||||
MOVQ $-1, 64(SP) // r1
|
||||
MOVQ $0, 72(SP) // r2
|
||||
MOVQ AX, 80(SP) // errno
|
||||
MOVQ $-1, 88(SP) // r1
|
||||
MOVQ $0, 96(SP) // r2
|
||||
MOVQ AX, 104(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
ok9:
|
||||
ADDQ $32, SP
|
||||
MOVQ AX, 64(SP) // r1
|
||||
MOVQ DX, 72(SP) // r2
|
||||
MOVQ $0, 80(SP) // errno
|
||||
MOVQ AX, 88(SP) // r1
|
||||
MOVQ DX, 96(SP) // r2
|
||||
MOVQ $0, 104(SP) // errno
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-64
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
@ -109,7 +109,7 @@ ok1:
|
||||
MOVQ $0, 56(SP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-88
|
||||
MOVQ 16(SP), DI
|
||||
MOVQ 24(SP), SI
|
||||
MOVQ 32(SP), DX
|
||||
|
@ -12,7 +12,7 @@
|
||||
//func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
|
||||
|
||||
// Trap # in AX, args on stack above caller pc.
|
||||
TEXT ·Syscall(SB),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-32
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -47,7 +47,7 @@ copyresult3:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-44
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -85,7 +85,7 @@ copyresult4:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-32
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -100,7 +100,7 @@ TEXT ·RawSyscall(SB),7,$0
|
||||
MOVL AX, err+28(SP)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-44
|
||||
MOVL 4(SP), AX // syscall entry
|
||||
// slide args down on top of system call number
|
||||
LEAL 8(SP), SI
|
||||
@ -121,7 +121,7 @@ TEXT ·RawSyscall6(SB),7,$0
|
||||
#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),7,$0
|
||||
TEXT ·seek(SB),7,$0-40
|
||||
LEAL newoffset+24(SP), AX
|
||||
MOVL AX, placeholder+4(SP)
|
||||
|
||||
@ -152,7 +152,7 @@ copyresult6:
|
||||
|
||||
//func exit(code int)
|
||||
// Import runtime·exit for cleanly exiting.
|
||||
TEXT ·exit(SB),7,$4
|
||||
TEXT ·exit(SB),7,$4-4
|
||||
MOVL code+0(FP), AX
|
||||
MOVL AX, 0(SP)
|
||||
CALL runtime·exit(SB)
|
||||
|
@ -14,7 +14,7 @@
|
||||
// Trap # in BP, args on stack above caller pc.
|
||||
// NxM requires that Plan 9 system calls be
|
||||
// marked with $0x8000 in AX.
|
||||
TEXT ·Syscall(SB),7,$0
|
||||
TEXT ·Syscall(SB),7,$0-64
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ $0x8000, AX // for NxM
|
||||
MOVQ 8(SP), BP // syscall entry
|
||||
@ -50,7 +50,7 @@ copyresult3:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),7,$0
|
||||
TEXT ·Syscall6(SB),7,$0-88
|
||||
CALL runtime·entersyscall(SB)
|
||||
MOVQ $0x8000, AX // for NxM
|
||||
MOVQ 8(SP), BP // syscall entry
|
||||
@ -89,7 +89,7 @@ copyresult4:
|
||||
CALL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),7,$0
|
||||
TEXT ·RawSyscall(SB),7,$0-64
|
||||
MOVQ $0x8000, AX // for NxM
|
||||
MOVQ 8(SP), BP // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -105,7 +105,7 @@ TEXT ·RawSyscall(SB),7,$0
|
||||
MOVQ AX, err+56(SP)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),7,$0
|
||||
TEXT ·RawSyscall6(SB),7,$0-88
|
||||
MOVQ $0x8000, AX // for NxM
|
||||
MOVQ 8(SP), BP // syscall entry
|
||||
// slide args down on top of system call number
|
||||
@ -127,7 +127,7 @@ TEXT ·RawSyscall6(SB),7,$0
|
||||
#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),7,$0
|
||||
TEXT ·seek(SB),7,$0-64
|
||||
LEAQ newoffset+40(SP), AX
|
||||
MOVQ AX, placeholder+8(SP)
|
||||
|
||||
@ -158,7 +158,7 @@ copyresult6:
|
||||
|
||||
//func exit(code int)
|
||||
// Import runtime·exit for cleanly exiting.
|
||||
TEXT ·exit(SB),7,$8
|
||||
TEXT ·exit(SB),7,$8-4
|
||||
MOVQ code+0(FP), AX
|
||||
MOVQ AX, 0(SP)
|
||||
CALL runtime·exit(SB)
|
||||
|
Loading…
Reference in New Issue
Block a user