diff options
Diffstat (limited to 'mdk-stage1/dietlibc/i386')
-rw-r--r-- | mdk-stage1/dietlibc/i386/cos.S | 21 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/i386/dyn_syscalls.S | 1 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/i386/ldexp.S | 23 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/i386/libm2.S | 23 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/i386/memchr.S | 2 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/i386/mmap64.S | 11 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/i386/sin.S | 20 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/i386/vfork.S | 9 |
8 files changed, 70 insertions, 40 deletions
diff --git a/mdk-stage1/dietlibc/i386/cos.S b/mdk-stage1/dietlibc/i386/cos.S index 73ba03355..f95c81ca7 100644 --- a/mdk-stage1/dietlibc/i386/cos.S +++ b/mdk-stage1/dietlibc/i386/cos.S @@ -7,16 +7,27 @@ cosf: flds 4(%esp) - jmp .Lcos + jmp 1f cos: fldl 4(%esp) -.Lcos: - call __fmod2pi +1: fcos - ret + fnstsw %ax + testb $0x04, %ah + je 3f + fldpi + fadd %st + fxch %st(1) +2: fprem1 + fnstsw %ax + testb $0x04, %ah + jne 2b + fstp %st(1) + fcos +3: ret cosl: fldt 4(%esp) - jmp .Lcos + jmp 1b .Lende: .size cos,.Lende-cos diff --git a/mdk-stage1/dietlibc/i386/dyn_syscalls.S b/mdk-stage1/dietlibc/i386/dyn_syscalls.S index 28d668b6c..c4fd2fff5 100644 --- a/mdk-stage1/dietlibc/i386/dyn_syscalls.S +++ b/mdk-stage1/dietlibc/i386/dyn_syscalls.S @@ -59,7 +59,6 @@ /* OK this is basicaly unified.S */ .text .type __unified_syscall_256,@function -.global __unified_syscall_256 __unified_syscall_256: movzwl %ax, %eax jmp .L23 diff --git a/mdk-stage1/dietlibc/i386/ldexp.S b/mdk-stage1/dietlibc/i386/ldexp.S index 4429b6e22..51d9bae89 100644 --- a/mdk-stage1/dietlibc/i386/ldexp.S +++ b/mdk-stage1/dietlibc/i386/ldexp.S @@ -1,15 +1,28 @@ .text -.type ldexp,@function -.global ldexp +.global ldexpf,ldexp,ldexpl + .type ldexpf,@function + .type ldexp,@function + .type ldexpl,@function -# double ldexp ( double value, int expo ); +ldexpf: + fildl 8(%esp) + flds 4(%esp) + fscale + ret ldexp: fildl 12(%esp) fldl 4(%esp) fscale - fstp %st(1) + ret + +ldexpl: + fildl 16(%esp) + fldt 4(%esp) + fscale ret .ende: -.size ldexp,.ende-ldexp +.size ldexpl,.ende-ldexpl +.size ldexp,ldexpl-ldexp +.size ldexpf,ldexp-ldexpf diff --git a/mdk-stage1/dietlibc/i386/libm2.S b/mdk-stage1/dietlibc/i386/libm2.S index 8ad85b7f2..91c4437cd 100644 --- a/mdk-stage1/dietlibc/i386/libm2.S +++ b/mdk-stage1/dietlibc/i386/libm2.S @@ -598,29 +598,6 @@ frexpl: movl 16(%esp),%eax jmp __frexp -.global ldexpf,ldexp,ldexpl - .type ldexpf,@function - .type ldexp,@function - .type ldexpl,@function - -ldexpf: - fildl 8(%esp) - flds 4(%esp) - fscale - ret - -ldexp: - fildl 12(%esp) - fldl 4(%esp) - fscale - ret - -ldexpl: - fildl 16(%esp) - fldt 4(%esp) - fscale - ret - .global logbf,logb,logbl .type logbf,@function .type logb,@function diff --git a/mdk-stage1/dietlibc/i386/memchr.S b/mdk-stage1/dietlibc/i386/memchr.S index de01aa47f..7d04f990b 100644 --- a/mdk-stage1/dietlibc/i386/memchr.S +++ b/mdk-stage1/dietlibc/i386/memchr.S @@ -8,7 +8,7 @@ memchr: movl 12(%esp),%eax movl 16(%esp),%ecx cld - jcxz .Lnotfound + jecxz .Lnotfound repne scasb diff --git a/mdk-stage1/dietlibc/i386/mmap64.S b/mdk-stage1/dietlibc/i386/mmap64.S index 210fec6ce..421325260 100644 --- a/mdk-stage1/dietlibc/i386/mmap64.S +++ b/mdk-stage1/dietlibc/i386/mmap64.S @@ -1,6 +1,13 @@ +#include <dietfeatures.h> #include <syscalls.h> #include <errno.h> +#ifdef __DYN_LIB +#ifndef WANT_THREAD_SAFE +#define WANT_THREAD_SAFE +#endif +#endif + .text .global mmap64 .type mmap64,@function @@ -32,7 +39,11 @@ mmap64: .Lerror: #ifdef WANT_THREAD_SAFE movl %eax,%ebx +#ifdef __DYN_LIB + call __errno_location@PLT +#else call __errno_location +#endif movl %ebx,(%eax) orl $-1,%eax #else diff --git a/mdk-stage1/dietlibc/i386/sin.S b/mdk-stage1/dietlibc/i386/sin.S index 1c99b2d12..404bf5eed 100644 --- a/mdk-stage1/dietlibc/i386/sin.S +++ b/mdk-stage1/dietlibc/i386/sin.S @@ -7,16 +7,26 @@ .type sinl,@function sinf: flds 4(%esp) - jmp __sin + jmp 1f sin: fldl 4(%esp) -__sin: - call __fmod2pi +1: fsin + fnstsw %ax + testb $0x04, %ah + je 3f + fldpi + fadd %st + fxch %st(1) +2: fprem1 + fnstsw %ax + testb $0x04, %ah + jne 2b + fstp %st(1) fsin - ret +3: ret sinl: fldt 4(%esp) - jmp __sin + jmp 1b .ende: .size sin,.ende-sin diff --git a/mdk-stage1/dietlibc/i386/vfork.S b/mdk-stage1/dietlibc/i386/vfork.S new file mode 100644 index 000000000..c07c5f6af --- /dev/null +++ b/mdk-stage1/dietlibc/i386/vfork.S @@ -0,0 +1,9 @@ +.text +.globl vfork +vfork: + popl %edx + xorl %eax,%eax + movb $190, %al + int $0x80 + jmpl *%edx +.size vfork, . - vfork |