summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/sparc/unified.S
blob: 3cd609da53f28886171848183a34ea4b52d10e80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <dietfeatures.h>

.text
.global __unified_syscall
__unified_syscall:
	ta	0x10

	bcc	1f
	save	%sp, -104, %sp

	neg	%i0, %i0
1:
	add	%i0, 0xff, %l2
	cmp	%l2, 0xfe
	bgu	2f
	neg	%i0, %l3
#ifdef WANT_THREAD_SAVE
	call	__errno_location
	nop
#else
	sethi	%hi(errno), %o0
	or	%o0, %lo(errno), %o0
#endif
	st	%l3, [ %o0 ]
	mov	-1, %i0
2:
	ret
	restore