1// Copyright 2015 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 rawVforkSyscall(trap, a1, a2, a3 uintptr) (r1, err uintptr)
8TEXT ·rawVforkSyscall(SB),NOSPLIT,$0-48
9	MOVD	a1+8(FP), R0
10	MOVD	a2+16(FP), R1
11	MOVD	a3+24(FP), R2
12	MOVD	$0, R3
13	MOVD	$0, R4
14	MOVD	$0, R5
15	MOVD	trap+0(FP), R8	// syscall entry
16	SVC
17	CMN	$4095, R0
18	BCC	ok
19	MOVD	$-1, R4
20	MOVD	R4, r1+32(FP)	// r1
21	NEG	R0, R0
22	MOVD	R0, err+40(FP)	// errno
23	RET
24ok:
25	MOVD	R0, r1+32(FP)	// r1
26	MOVD	ZR, err+40(FP)	// errno
27	RET
28
29// func rawSyscallNoError(trap uintptr, a1, a2, a3 uintptr) (r1, r2 uintptr);
30TEXT ·rawSyscallNoError(SB),NOSPLIT,$0-48
31	MOVD	a1+8(FP), R0
32	MOVD	a2+16(FP), R1
33	MOVD	a3+24(FP), R2
34	MOVD	$0, R3
35	MOVD	$0, R4
36	MOVD	$0, R5
37	MOVD	trap+0(FP), R8	// syscall entry
38	SVC
39	MOVD	R0, r1+32(FP)
40	MOVD	R1, r2+40(FP)
41	RET
42