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