asm_linux_riscv64.s 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. //go:build riscv64 && gc
  5. // +build riscv64
  6. // +build gc
  7. #include "textflag.h"
  8. //
  9. // System calls for linux/riscv64.
  10. //
  11. // Where available, just jump to package syscall's implementation of
  12. // these functions.
  13. TEXT ·Syscall(SB),NOSPLIT,$0-56
  14. JMP syscall·Syscall(SB)
  15. TEXT ·Syscall6(SB),NOSPLIT,$0-80
  16. JMP syscall·Syscall6(SB)
  17. TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
  18. CALL runtime·entersyscall(SB)
  19. MOV a1+8(FP), A0
  20. MOV a2+16(FP), A1
  21. MOV a3+24(FP), A2
  22. MOV trap+0(FP), A7 // syscall entry
  23. ECALL
  24. MOV A0, r1+32(FP) // r1
  25. MOV A1, r2+40(FP) // r2
  26. CALL runtime·exitsyscall(SB)
  27. RET
  28. TEXT ·RawSyscall(SB),NOSPLIT,$0-56
  29. JMP syscall·RawSyscall(SB)
  30. TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
  31. JMP syscall·RawSyscall6(SB)
  32. TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
  33. MOV a1+8(FP), A0
  34. MOV a2+16(FP), A1
  35. MOV a3+24(FP), A2
  36. MOV trap+0(FP), A7 // syscall entry
  37. ECALL
  38. MOV A0, r1+32(FP)
  39. MOV A1, r2+40(FP)
  40. RET