asm_linux_riscv64.s 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2019 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 riscv64,!gccgo
  5. #include "textflag.h"
  6. //
  7. // System calls for linux/riscv64.
  8. //
  9. // Where available, just jump to package syscall's implementation of
  10. // these functions.
  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. MOV a1+8(FP), A0
  18. MOV a2+16(FP), A1
  19. MOV a3+24(FP), A2
  20. MOV $0, A3
  21. MOV $0, A4
  22. MOV $0, A5
  23. MOV $0, A6
  24. MOV trap+0(FP), A7 // syscall entry
  25. ECALL
  26. MOV A0, r1+32(FP) // r1
  27. MOV A1, r2+40(FP) // r2
  28. CALL runtime·exitsyscall(SB)
  29. RET
  30. TEXT ·RawSyscall(SB),NOSPLIT,$0-56
  31. JMP syscall·RawSyscall(SB)
  32. TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
  33. JMP syscall·RawSyscall6(SB)
  34. TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
  35. MOV a1+8(FP), A0
  36. MOV a2+16(FP), A1
  37. MOV a3+24(FP), A2
  38. MOV ZERO, A3
  39. MOV ZERO, A4
  40. MOV ZERO, A5
  41. MOV trap+0(FP), A7 // syscall entry
  42. ECALL
  43. MOV A0, r1+32(FP)
  44. MOV A1, r2+40(FP)
  45. RET