asm_linux_amd64.s 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 AMD64, Linux
  8. //
  9. // Just jump to package syscall's implementation for all these functions.
  10. // The runtime may know about them.
  11. TEXT ·Syscall(SB),NOSPLIT,$0-56
  12. JMP syscall·Syscall(SB)
  13. TEXT ·Syscall6(SB),NOSPLIT,$0-80
  14. JMP syscall·Syscall6(SB)
  15. TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
  16. CALL runtime·entersyscall(SB)
  17. MOVQ a1+8(FP), DI
  18. MOVQ a2+16(FP), SI
  19. MOVQ a3+24(FP), DX
  20. MOVQ $0, R10
  21. MOVQ $0, R8
  22. MOVQ $0, R9
  23. MOVQ trap+0(FP), AX // syscall entry
  24. SYSCALL
  25. MOVQ AX, r1+32(FP)
  26. MOVQ DX, r2+40(FP)
  27. CALL runtime·exitsyscall(SB)
  28. RET
  29. TEXT ·RawSyscall(SB),NOSPLIT,$0-56
  30. JMP syscall·RawSyscall(SB)
  31. TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
  32. JMP syscall·RawSyscall6(SB)
  33. TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
  34. MOVQ a1+8(FP), DI
  35. MOVQ a2+16(FP), SI
  36. MOVQ a3+24(FP), DX
  37. MOVQ $0, R10
  38. MOVQ $0, R8
  39. MOVQ $0, R9
  40. MOVQ trap+0(FP), AX // syscall entry
  41. SYSCALL
  42. MOVQ AX, r1+32(FP)
  43. MOVQ DX, r2+40(FP)
  44. RET
  45. TEXT ·gettimeofday(SB),NOSPLIT,$0-16
  46. JMP syscall·gettimeofday(SB)