1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build gc
6 // +build gc
7
8 #include "textflag.h"
9
10 //
11 // System calls for 386, Linux
12 //
13
14 // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80
15 // instead of the glibc-specific "CALL 0x10(GS)".
16 #define INVOKE_SYSCALL INT $0x80
17
18 // Just jump to package syscall's implementation for all these functions.
19 // The runtime may know about them.
20
21 TEXT ·Syscall(SB),NOSPLIT,$0-28
22 JMP syscall·Syscall(SB)
23
24 TEXT ·Syscall6(SB),NOSPLIT,$0-40
25 JMP syscall·Syscall6(SB)
26
27 TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
28 CALL runtime·entersyscall(SB)
29 MOVL trap+0(FP), AX // syscall entry
30 MOVL a1+4(FP), BX
31 MOVL a2+8(FP), CX
32 MOVL a3+12(FP), DX
33 MOVL $0, SI
34 MOVL $0, DI
35 INVOKE_SYSCALL
36 MOVL AX, r1+16(FP)
37 MOVL DX, r2+20(FP)
38 CALL runtime·exitsyscall(SB)
39 RET
40
41 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
42 JMP syscall·RawSyscall(SB)
43
44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
45 JMP syscall·RawSyscall6(SB)
46
47 TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
48 MOVL trap+0(FP), AX // syscall entry
49 MOVL a1+4(FP), BX
50 MOVL a2+8(FP), CX
51 MOVL a3+12(FP), DX
52 MOVL $0, SI
53 MOVL $0, DI
54 INVOKE_SYSCALL
55 MOVL AX, r1+16(FP)
56 MOVL DX, r2+20(FP)
57 RET
58
59 TEXT ·socketcall(SB),NOSPLIT,$0-36
60 JMP syscall·socketcall(SB)
61
62 TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
63 JMP syscall·rawsocketcall(SB)
64
65 TEXT ·seek(SB),NOSPLIT,$0-28
66 JMP syscall·seek(SB)
67
View as plain text