2 * Copyright (C) 2017 Hangzhou C-SKY Microsystems co.,ltd.
4 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
12 extern long __syscall_error(int err_no
);
14 extern int __csky_clone (
34 ptid
= va_arg(al
, void *);
35 tls
= va_arg(al
, void *);
36 ctid
= va_arg(al
, void *);
45 /* prepare fn&arg in child_stack */
46 child_stack
= (void *)((unsigned int)child_stack
- 8);
47 *(unsigned int *)child_stack
= (unsigned int)fn
;
48 *(unsigned int *)(child_stack
+ 4) = (unsigned int)arg
;
50 return __csky_clone(flags
, child_stack
, ptid
, ctid
, tls
);
52 return __syscall_error(-err
);
54 weak_alias(__clone
, clone
)