x32 port (diff against vanilla x86_64)
[musl] / src / thread / x32 / clone.s
1 .text
2 .global __clone
3 .type   __clone,@function
4 __clone:
5         movl $0x40000038,%eax /* SYS_clone */
6         mov %rdi,%r11
7         mov %rdx,%rdi
8         mov %r8,%rdx
9         mov %r9,%r8
10         mov 8(%rsp),%r10
11         mov %r11,%r9
12         and $-16,%rsi
13         sub $8,%rsi
14         mov %rcx,(%rsi)
15         syscall
16         test %eax,%eax
17         jnz 1f
18         xor %ebp,%ebp
19         pop %rdi
20         call *%r9
21         mov %eax,%edi
22         movl $0x4000003c,%eax /* SYS_exit */
23         syscall
24         hlt
25 1:      ret