summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/arm64/syscall.S
blob: e1004122577d908625a6c049fcc163fd413bef51 (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
/*
 * arch/arm64/syscall.S
 *
 * System call common handling - if the return
 * value from the system call is negative, then
 * extract the magnitude and return it as errno and
 * return -1, if the return value is 0 that is
 * success case.
 */

	.type	__syscall_common,#function
	.globl  __syscall_common
	.balign 8

__syscall_common:
	cmp	x0, #0x0
	b.ge	2f
	neg	x0, x0
	ldr	x8, 1f
	str	w0, [x8]
	mov	x0, #-1
2:
	ret
1:
	.dword	errno