X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fi386%2Fclone.s;h=bebf01a3a16f03df03831e78bb7ff662cdcf8606;hb=f143458223f90262a9c2d929f9e815a74e3aa139;hp=53405cf19736aa1f86dbbe138bfc587731561d05;hpb=0b2006c8fea021b7fa1fd267bf270cb8c279f230;p=musl diff --git a/src/thread/i386/clone.s b/src/thread/i386/clone.s index 53405cf1..bebf01a3 100644 --- a/src/thread/i386/clone.s +++ b/src/thread/i386/clone.s @@ -1,27 +1,51 @@ .text -.global __uniclone -.type __uniclone,%function -__uniclone: - movl 4(%esp),%ecx - subl $24,%ecx - movl 8(%esp),%eax - movl %eax,16(%ecx) - movl 12(%esp),%eax - movl %eax,24(%ecx) - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl %eax,8(%eax) - leal 20(%eax),%edx - leal 4(%eax),%esi - movl %edx,%edi - movl $0x7d0f00,%ebx - movl $120,%eax - int $128 - popl %ebp - popl %edi - popl %esi - popl %ebx +.global __clone +.weak clone +.type __clone,@function +.type clone,@function +__clone: +clone: + push %ebp + mov %esp,%ebp + push %ebx + push %esi + push %edi + + xor %eax,%eax + push $0x51 + mov %gs,%ax + push $0xfffff + shr $3,%eax + push 28(%ebp) + push %eax + mov $120,%al + + mov 12(%ebp),%ecx + mov 16(%ebp),%ebx + and $-16,%ecx + sub $16,%ecx + mov 20(%ebp),%edi + mov %edi,(%ecx) + mov 24(%ebp),%edx + mov %esp,%esi + mov 32(%ebp),%edi + mov 8(%ebp),%ebp + int $128 + test %eax,%eax + jnz 1f + + mov %ebp,%eax + xor %ebp,%ebp + call *%eax + mov %eax,%ebx + xor %eax,%eax + inc %eax + int $128 + hlt + +1: add $16,%esp + pop %edi + pop %esi + pop %ebx + pop %ebp ret -.size __uniclone,.-__uniclone