summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/sparc/fork.S
blob: 150839971dcd42b24777313252b25d52a1f94983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "syscalls.h"

.text
.global fork
fork:
	mov	2, %g1
	ta	0x10
	bcc,a	1f
	nop

	sethi   %hi(errno), %o3
	or      %o3, %lo(errno), %o3
	st	%i0, [%o3]

	retl
	mov	-1, %o0
1:	dec	%o1
	retl
	and	%o0, %o1, %o0