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