asm_linux_386.s 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. //go:build gc
  5. // +build gc
  6. #include "textflag.h"
  7. //
  8. // System calls for 386, Linux
  9. //
  10. // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80
  11. // instead of the glibc-specific "CALL 0x10(GS)".
  12. #define INVOKE_SYSCALL INT $0x80
  13. // Just jump to package syscall's implementation for all these functions.
  14. // The runtime may know about them.
  15. TEXT ·Syscall(SB),NOSPLIT,$0-28
  16. JMP syscall·Syscall(SB)
  17. TEXT ·Syscall6(SB),NOSPLIT,$0-40
  18. JMP syscall·Syscall6(SB)
  19. TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
  20. CALL runtime·entersyscall(SB)
  21. MOVL trap+0(FP), AX // syscall entry
  22. MOVL a1+4(FP), BX
  23. MOVL a2+8(FP), CX
  24. MOVL a3+12(FP), DX
  25. MOVL $0, SI
  26. MOVL $0, DI
  27. INVOKE_SYSCALL
  28. MOVL AX, r1+16(FP)
  29. MOVL DX, r2+20(FP)
  30. CALL runtime·exitsyscall(SB)
  31. RET
  32. TEXT ·RawSyscall(SB),NOSPLIT,$0-28
  33. JMP syscall·RawSyscall(SB)
  34. TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
  35. JMP syscall·RawSyscall6(SB)
  36. TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
  37. MOVL trap+0(FP), AX // syscall entry
  38. MOVL a1+4(FP), BX
  39. MOVL a2+8(FP), CX
  40. MOVL a3+12(FP), DX
  41. MOVL $0, SI
  42. MOVL $0, DI
  43. INVOKE_SYSCALL
  44. MOVL AX, r1+16(FP)
  45. MOVL DX, r2+20(FP)
  46. RET
  47. TEXT ·socketcall(SB),NOSPLIT,$0-36
  48. JMP syscall·socketcall(SB)
  49. TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
  50. JMP syscall·rawsocketcall(SB)
  51. TEXT ·seek(SB),NOSPLIT,$0-28
  52. JMP syscall·seek(SB)