You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

asm_linux_riscv64.s 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #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 trap+0(FP), A7 // syscall entry
  21. ECALL
  22. MOV A0, r1+32(FP) // r1
  23. MOV A1, r2+40(FP) // r2
  24. CALL runtime·exitsyscall(SB)
  25. RET
  26. TEXT ·RawSyscall(SB),NOSPLIT,$0-56
  27. JMP syscall·RawSyscall(SB)
  28. TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
  29. JMP syscall·RawSyscall6(SB)
  30. TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
  31. MOV a1+8(FP), A0
  32. MOV a2+16(FP), A1
  33. MOV a3+24(FP), A2
  34. MOV trap+0(FP), A7 // syscall entry
  35. ECALL
  36. MOV A0, r1+32(FP)
  37. MOV A1, r2+40(FP)
  38. RET