diff options
author | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:31:57 +0000 |
---|---|---|
committer | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:31:57 +0000 |
commit | 09e967c2d732783b2579e4e120cd9b608404cb00 (patch) | |
tree | 8d2783a6a7e33608c6012efd6a88b8f5694df81d /mdk-stage1/dietlibc/i386/unified.S | |
parent | 18fcff49d3c836697d3b75a3d01d31c700e69974 (diff) | |
download | drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.gz drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.bz2 drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.xz drakx-09e967c2d732783b2579e4e120cd9b608404cb00.zip |
Merge from R9_0-AMD64, most notably:
- AMD64 support to insmod-busybox, minilibc, et al.
- Sync with insmod-modutils 2.4.19 something but everyone should use
dietlibc nowadays
- Factor out compilation and prefix with $(DIET) for dietlibc builds
- 64-bit & varargs fixes
Diffstat (limited to 'mdk-stage1/dietlibc/i386/unified.S')
-rw-r--r-- | mdk-stage1/dietlibc/i386/unified.S | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/mdk-stage1/dietlibc/i386/unified.S b/mdk-stage1/dietlibc/i386/unified.S index f182bdb4b..989bf37b5 100644 --- a/mdk-stage1/dietlibc/i386/unified.S +++ b/mdk-stage1/dietlibc/i386/unified.S @@ -1,13 +1,33 @@ + #include <dietfeatures.h> .text +.global __unified_syscall_256 +.type __unified_syscall_256,@function +__unified_syscall_256: + movzwl %ax,%eax + jmp .L1 +.L2: +.size __unified_syscall_256,.L2-__unified_syscall_256 +.weak exit +exit: +.global _exit +.type _exit,@function +_exit: + movb $1,%al .global __unified_syscall +.type __unified_syscall,@function __unified_syscall: +.size _exit,__unified_syscall-_exit movzbl %al, %eax +.L1: push %edi push %esi push %ebx movl %esp,%edi + /* we use movl instead of pop because otherwise a signal would + destroy the stack frame and crash the program, although it + would save a few bytes. */ movl 0x10(%edi),%ebx movl 0x14(%edi),%ecx movl 0x18(%edi),%edx @@ -16,19 +36,24 @@ __unified_syscall: int $0x80 cmp $-124,%eax jbe .Lnoerror -#ifdef WANT_THREAD_SAVE + neg %eax +#ifdef WANT_THREAD_SAFE movl %eax,%ebx call __errno_location - neg %ebx movl %ebx,(%eax) + orl $-1,%eax #else - neg %eax mov %eax,errno + sbb %eax,%eax # eax = eax - eax - CY = -1 #endif - xor %eax,%eax - dec %eax .Lnoerror: pop %ebx pop %esi pop %edi + +/* here we go and "reuse" the return for weak-void functions */ +#include "dietuglyweaks.h" + ret +.L3: +.size __unified_syscall,.L3-__unified_syscall |