asm_linux_386.s 1.4 KB

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