github.com/mtsmfm/go/src@v0.0.0-20221020090648-44bdcb9f8fde/runtime/internal/syscall/asm_linux_riscv64.s (about) 1 // Copyright 2022 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 5 #include "textflag.h" 6 7 // func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) 8 TEXT ·Syscall6(SB),NOSPLIT,$0-80 9 MOV num+0(FP), A7 // syscall entry 10 MOV a1+8(FP), A0 11 MOV a2+16(FP), A1 12 MOV a3+24(FP), A2 13 MOV a4+32(FP), A3 14 MOV a5+40(FP), A4 15 MOV a6+48(FP), A5 16 ECALL 17 MOV $-4096, T0 18 BLTU T0, A0, err 19 MOV A0, r1+56(FP) 20 MOV A1, r2+64(FP) 21 MOV ZERO, errno+72(FP) 22 RET 23 err: 24 MOV $-1, T0 25 MOV T0, r1+56(FP) 26 MOV ZERO, r2+64(FP) 27 SUB A0, ZERO, A0 28 MOV A0, errno+72(FP) 29 RET