Commit db324ccd authored by Keith Randall's avatar Keith Randall

syscall: Convert textflags from numbers to symbols.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12773043
parent ac0df6ce
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for 386, Darwin // System call support for 386, Darwin
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),7,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -61,7 +63,7 @@ ok6: ...@@ -61,7 +63,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-56 TEXT ·Syscall9(SB),NOSPLIT,$0-56
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -91,7 +93,7 @@ ok9: ...@@ -91,7 +93,7 @@ ok9:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-32 TEXT ·RawSyscall(SB),NOSPLIT,$0-32
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -112,7 +114,7 @@ ok1: ...@@ -112,7 +114,7 @@ ok1:
MOVL $0, 28(SP) // errno MOVL $0, 28(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for AMD64, Darwin // System call support for AMD64, Darwin
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64); // 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 // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),7,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -58,7 +60,7 @@ ok6: ...@@ -58,7 +60,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-64 TEXT ·RawSyscall(SB),NOSPLIT,$0-64
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -79,7 +81,7 @@ ok1: ...@@ -79,7 +81,7 @@ ok1:
MOVQ $0, 56(SP) // errno MOVQ $0, 56(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-88 TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for 386, FreeBSD // System call support for 386, FreeBSD
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),7,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -61,7 +63,7 @@ ok6: ...@@ -61,7 +63,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-56 TEXT ·Syscall9(SB),NOSPLIT,$0-56
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -91,7 +93,7 @@ ok9: ...@@ -91,7 +93,7 @@ ok9:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-32 TEXT ·RawSyscall(SB),NOSPLIT,$0-32
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -112,7 +114,7 @@ ok1: ...@@ -112,7 +114,7 @@ ok1:
MOVL $0, 28(SP) // errno MOVL $0, 28(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for AMD64, FreeBSD // System call support for AMD64, FreeBSD
// //
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64) // 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 // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),7,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -57,7 +59,7 @@ ok6: ...@@ -57,7 +59,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-112 TEXT ·Syscall9(SB),NOSPLIT,$0-112
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX MOVQ 8(SP), AX
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -90,7 +92,7 @@ ok9: ...@@ -90,7 +92,7 @@ ok9:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-64 TEXT ·RawSyscall(SB),NOSPLIT,$0-64
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -110,7 +112,7 @@ ok1: ...@@ -110,7 +112,7 @@ ok1:
MOVQ $0, 56(SP) // errno MOVQ $0, 56(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-88 TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for ARM, FreeBSD // System call support for ARM, FreeBSD
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // 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) // func Syscall9(trap int32, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int32)
TEXT ·Syscall(SB),7,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -32,7 +34,7 @@ error: ...@@ -32,7 +34,7 @@ error:
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -57,7 +59,7 @@ error6: ...@@ -57,7 +59,7 @@ error6:
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -82,7 +84,7 @@ error9: ...@@ -82,7 +84,7 @@ error9:
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
MOVW 8(FP), R2 // a2 MOVW 8(FP), R2 // a2
...@@ -101,7 +103,7 @@ errorr: ...@@ -101,7 +103,7 @@ errorr:
MOVW R0, 24(FP) // err MOVW R0, 24(FP) // err
RET RET
TEXT ·RawSyscall6(SB),7,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
MOVW 8(FP), R2 // a2 MOVW 8(FP), R2 // a2
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System calls for 386, Linux // System calls for 386, Linux
// //
...@@ -9,7 +11,7 @@ ...@@ -9,7 +11,7 @@
// func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // 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 // Trap # in AX, args in BX CX DX SI DI, return in AX
TEXT ·Syscall(SB),7,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
RET RET
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
TEXT ·Syscall6(SB),7,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
...@@ -60,7 +62,7 @@ ok6: ...@@ -60,7 +62,7 @@ ok6:
RET RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
TEXT ·RawSyscall(SB),7,$0-32 TEXT ·RawSyscall(SB),NOSPLIT,$0-32
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
MOVL 12(SP), CX MOVL 12(SP), CX
...@@ -82,7 +84,7 @@ ok1: ...@@ -82,7 +84,7 @@ ok1:
RET RET
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
TEXT ·RawSyscall6(SB),7,$0-44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
MOVL 12(SP), CX MOVL 12(SP), CX
...@@ -108,7 +110,7 @@ ok2: ...@@ -108,7 +110,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),7,$0-40 TEXT ·socketcall(SB),NOSPLIT,$0-40
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
...@@ -132,7 +134,7 @@ oksock: ...@@ -132,7 +134,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),7,$0-40 TEXT ·rawsocketcall(SB),NOSPLIT,$0-40
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
...@@ -157,7 +159,7 @@ oksock1: ...@@ -157,7 +159,7 @@ oksock1:
// taking the address of the return value newoffset. // taking the address of the return value newoffset.
// 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),7,$0-32 TEXT ·Seek(SB),NOSPLIT,$0-32
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
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System calls for AMD64, Linux // System calls for AMD64, Linux
// //
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
// Note that this differs from "standard" ABI convention, which // Note that this differs from "standard" ABI convention, which
// would pass 4th arg in CX, not R10. // would pass 4th arg in CX, not R10.
TEXT ·Syscall(SB),7,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -36,7 +38,7 @@ ok: ...@@ -36,7 +38,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -61,7 +63,7 @@ ok6: ...@@ -61,7 +63,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-64 TEXT ·RawSyscall(SB),NOSPLIT,$0-64
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -83,7 +85,7 @@ ok1: ...@@ -83,7 +85,7 @@ ok1:
MOVQ $0, 56(SP) // errno MOVQ $0, 56(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-88 TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -105,7 +107,7 @@ ok2: ...@@ -105,7 +107,7 @@ ok2:
MOVQ $0, 80(SP) // errno MOVQ $0, 80(SP) // errno
RET RET
TEXT ·Gettimeofday(SB),7,$0-24 TEXT ·Gettimeofday(SB),NOSPLIT,$0-24
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
...@@ -120,7 +122,7 @@ ok7: ...@@ -120,7 +122,7 @@ ok7:
MOVQ $0, 16(SP) // errno MOVQ $0, 16(SP) // errno
RET RET
TEXT ·Time(SB),7,$0-32 TEXT ·Time(SB),NOSPLIT,$0-32
MOVQ 8(SP), DI MOVQ 8(SP), DI
MOVQ runtime·__vdso_time_sym(SB), AX MOVQ runtime·__vdso_time_sym(SB), AX
CALL AX CALL AX
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System calls for arm, Linux // System calls for arm, Linux
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
TEXT ·Syscall(SB),7,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 4(SP), R7 MOVW 4(SP), R7
MOVW 8(SP), R0 MOVW 8(SP), R0
...@@ -38,7 +40,7 @@ ok: ...@@ -38,7 +40,7 @@ ok:
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // 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. // Actually Syscall5 but the rest of the code expects it to be named Syscall6.
TEXT ·Syscall6(SB),7,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
...@@ -69,7 +71,7 @@ ok6: ...@@ -69,7 +71,7 @@ ok6:
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // 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. // Actually RawSyscall5 but the rest of the code expects it to be named RawSyscall6.
TEXT ·RawSyscall6(SB),7,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
MOVW 12(SP), R1 MOVW 12(SP), R1
...@@ -101,7 +103,7 @@ ok2: ...@@ -101,7 +103,7 @@ ok2:
// taking the address of the return value newoffset. // taking the address of the return value newoffset.
// 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),7,$0-32 TEXT ·Seek(SB),NOSPLIT,$0-32
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
...@@ -128,7 +130,7 @@ okseek: ...@@ -128,7 +130,7 @@ okseek:
RET RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
TEXT ·RawSyscall(SB),7,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
MOVW 12(SP), R1 MOVW 12(SP), R1
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for 386, NetBSD // System call support for 386, NetBSD
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),7,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -61,7 +63,7 @@ ok6: ...@@ -61,7 +63,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-56 TEXT ·Syscall9(SB),NOSPLIT,$0-56
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -91,7 +93,7 @@ ok9: ...@@ -91,7 +93,7 @@ ok9:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-32 TEXT ·RawSyscall(SB),NOSPLIT,$0-32
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -112,7 +114,7 @@ ok1: ...@@ -112,7 +114,7 @@ ok1:
MOVL $0, 28(SP) // errno MOVL $0, 28(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for AMD64, NetBSD // System call support for AMD64, NetBSD
// //
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64); // 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 // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),7,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -57,7 +59,7 @@ ok6: ...@@ -57,7 +59,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-112 TEXT ·Syscall9(SB),NOSPLIT,$0-112
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -89,7 +91,7 @@ ok9: ...@@ -89,7 +91,7 @@ ok9:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-64 TEXT ·RawSyscall(SB),NOSPLIT,$0-64
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -109,7 +111,7 @@ ok1: ...@@ -109,7 +111,7 @@ ok1:
MOVQ $0, 56(SP) // errno MOVQ $0, 56(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-88 TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for ARM, NetBSD // System call support for ARM, NetBSD
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // 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) // func Syscall9(trap int32, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int32)
TEXT ·Syscall(SB),7,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -32,7 +34,7 @@ error: ...@@ -32,7 +34,7 @@ error:
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -57,7 +59,7 @@ error6: ...@@ -57,7 +59,7 @@ error6:
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -82,7 +84,7 @@ error9: ...@@ -82,7 +84,7 @@ error9:
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
MOVW 8(FP), R2 // a2 MOVW 8(FP), R2 // a2
...@@ -101,7 +103,7 @@ errorr: ...@@ -101,7 +103,7 @@ errorr:
MOVW R0, 24(FP) // err MOVW R0, 24(FP) // err
RET RET
TEXT ·RawSyscall6(SB),7,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
MOVW 8(FP), R2 // a2 MOVW 8(FP), R2 // a2
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for 386, OpenBSD // System call support for 386, OpenBSD
// //
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),7,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -61,7 +63,7 @@ ok6: ...@@ -61,7 +63,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-56 TEXT ·Syscall9(SB),NOSPLIT,$0-56
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -91,7 +93,7 @@ ok9: ...@@ -91,7 +93,7 @@ ok9:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-32 TEXT ·RawSyscall(SB),NOSPLIT,$0-32
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -112,7 +114,7 @@ ok1: ...@@ -112,7 +114,7 @@ ok1:
MOVL $0, 28(SP) // errno MOVL $0, 28(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for AMD64, OpenBSD // System call support for AMD64, OpenBSD
// //
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64); // 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 // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),7,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -34,7 +36,7 @@ ok: ...@@ -34,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -57,7 +59,7 @@ ok6: ...@@ -57,7 +59,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall9(SB),7,$0-112 TEXT ·Syscall9(SB),NOSPLIT,$0-112
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -89,7 +91,7 @@ ok9: ...@@ -89,7 +91,7 @@ ok9:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-64 TEXT ·RawSyscall(SB),NOSPLIT,$0-64
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -109,7 +111,7 @@ ok1: ...@@ -109,7 +111,7 @@ ok1:
MOVQ $0, 56(SP) // errno MOVQ $0, 56(SP) // errno
RET RET
TEXT ·RawSyscall6(SB),7,$0-88 TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for 386, Plan 9 // System call support for 386, Plan 9
// //
...@@ -12,7 +14,7 @@ ...@@ -12,7 +14,7 @@
//func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) //func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),7,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -47,7 +49,7 @@ copyresult3: ...@@ -47,7 +49,7 @@ copyresult3:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -85,7 +87,7 @@ copyresult4: ...@@ -85,7 +87,7 @@ copyresult4:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-32 TEXT ·RawSyscall(SB),NOSPLIT,$0-32
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -100,7 +102,7 @@ TEXT ·RawSyscall(SB),7,$0-32 ...@@ -100,7 +102,7 @@ TEXT ·RawSyscall(SB),7,$0-32
MOVL AX, err+28(SP) MOVL AX, err+28(SP)
RET RET
TEXT ·RawSyscall6(SB),7,$0-44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -121,7 +123,7 @@ TEXT ·RawSyscall6(SB),7,$0-44 ...@@ -121,7 +123,7 @@ TEXT ·RawSyscall6(SB),7,$0-44
#define SYS_SEEK 39 /* from zsysnum_plan9_386.go */ #define SYS_SEEK 39 /* from zsysnum_plan9_386.go */
//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),7,$0-40 TEXT ·seek(SB),NOSPLIT,$0-40
LEAL newoffset+24(SP), AX LEAL newoffset+24(SP), AX
MOVL AX, placeholder+4(SP) MOVL AX, placeholder+4(SP)
...@@ -152,7 +154,7 @@ copyresult6: ...@@ -152,7 +154,7 @@ copyresult6:
//func exit(code int) //func exit(code int)
// Import runtime·exit for cleanly exiting. // Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),7,$4-4 TEXT ·exit(SB),NOSPLIT,$4-4
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)
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include "../../cmd/ld/textflag.h"
// //
// System call support for Plan 9 // System call support for Plan 9
// //
...@@ -14,7 +16,7 @@ ...@@ -14,7 +16,7 @@
// Trap # in BP, args on stack above caller pc. // Trap # in BP, args on stack above caller pc.
// NxM requires that Plan 9 system calls be // NxM requires that Plan 9 system calls be
// marked with $0x8000 in AX. // marked with $0x8000 in AX.
TEXT ·Syscall(SB),7,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ $0x8000, AX // for NxM MOVQ $0x8000, AX // for NxM
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
...@@ -50,7 +52,7 @@ copyresult3: ...@@ -50,7 +52,7 @@ copyresult3:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·Syscall6(SB),7,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ $0x8000, AX // for NxM MOVQ $0x8000, AX // for NxM
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
...@@ -89,7 +91,7 @@ copyresult4: ...@@ -89,7 +91,7 @@ copyresult4:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),7,$0-64 TEXT ·RawSyscall(SB),NOSPLIT,$0-64
MOVQ $0x8000, AX // for NxM MOVQ $0x8000, AX // for NxM
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -105,7 +107,7 @@ TEXT ·RawSyscall(SB),7,$0-64 ...@@ -105,7 +107,7 @@ TEXT ·RawSyscall(SB),7,$0-64
MOVQ AX, err+56(SP) MOVQ AX, err+56(SP)
RET RET
TEXT ·RawSyscall6(SB),7,$0-88 TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
MOVQ $0x8000, AX // for NxM MOVQ $0x8000, AX // for NxM
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -127,7 +129,7 @@ TEXT ·RawSyscall6(SB),7,$0-88 ...@@ -127,7 +129,7 @@ TEXT ·RawSyscall6(SB),7,$0-88
#define SYS_SEEK 39 /* from zsysnum_plan9_amd64.go */ #define SYS_SEEK 39 /* from zsysnum_plan9_amd64.go */
//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),7,$0-64 TEXT ·seek(SB),NOSPLIT,$0-64
LEAQ newoffset+40(SP), AX LEAQ newoffset+40(SP), AX
MOVQ AX, placeholder+8(SP) MOVQ AX, placeholder+8(SP)
...@@ -158,7 +160,7 @@ copyresult6: ...@@ -158,7 +160,7 @@ copyresult6:
//func exit(code int) //func exit(code int)
// Import runtime·exit for cleanly exiting. // Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),7,$8-4 TEXT ·exit(SB),NOSPLIT,$8-4
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