2 * libc/sysdeps/linux/nios2/clone.S -- `clone' syscall for linux/nios2
4 * Copyright (C) 2004 Microtronix Datacom Ltd
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License. See the file COPYING.LIB in the main
8 * directory of this archive for more details.
10 * Written by Wentao Xu <wentao@microtronix.com>
14 #include <bits/errno.h>
15 #include <sys/syscall.h>
18 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
34 beq r8,zero,CLONE_ERROR_LABEL
35 beq r5,zero,CLONE_ERROR_LABEL
38 movi r2,TRAP_ID_SYSCALL
42 /* child call the function */
44 bne r2,zero,CLONE_ERROR_LABEL
47 /* exit if it returns */