bionic/libc/arch-sh/syscalls/__sys_clone.S
David 'Digit' Turner 97cf7f3394 Implement clone() C library function properly.
Only provide an implementation for ARM at the moment, since
it requires specific assembly fragments (the standard syscall
stubs cannot be used because the child returns in a different
stack).
2010-01-25 11:18:30 -08:00

36 lines
608 B
ArmAsm

/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __sys_clone, @function
.globl __sys_clone
.align 4
__sys_clone:
/* get ready for additonal arg */
mov.l @r15, r0
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(5 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_clone_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_clone_end:
rts
nop
.align 2
0: .long __NR_clone
1: .long __set_syscall_errno