diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/clone.S | 7 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/mmap.S | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/socket.S | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/syscall.S | 5 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.S | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.h | 24 |
6 files changed, 23 insertions, 28 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S index d213b80539..7e02f76dfe 100644 --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -66,9 +66,6 @@ ENTRY(__clone) jz thread_start ret -PSEUDO_END (__clone) - - SYSCALL_ERROR_HANDLER thread_start: subl %ebp,%ebp /* terminate the stack frame */ @@ -76,4 +73,6 @@ thread_start: pushl %eax call JUMPTARGET (_exit) -weak_alias(__clone, clone) +PSEUDO_END (__clone) + +weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S index 30b0f76a43..16029d1110 100644 --- a/sysdeps/unix/sysv/linux/i386/mmap.S +++ b/sysdeps/unix/sysv/linux/i386/mmap.S @@ -19,7 +19,6 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> .text - SYSCALL_ERROR_HANDLER ENTRY (__mmap) @@ -42,6 +41,7 @@ ENTRY (__mmap) /* Successful; return the syscall's value. */ ret - .size __mmap,.-__mmap + +PSEUDO_END (__mmap) weak_alias (__mmap, mmap) diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S index 0cf4bfdf9e..78e8b03cce 100644 --- a/sysdeps/unix/sysv/linux/i386/socket.S +++ b/sysdeps/unix/sysv/linux/i386/socket.S @@ -23,8 +23,6 @@ Cambridge, MA 02139, USA. */ #define P2(a, b) a##b .text - SYSCALL_ERROR_HANDLER - /* The socket-oriented system calls are handled unusally in Linux. They are all gated through the single `socketcall' system call number. `socketcall' takes two arguments: the first is the subcode, specifying @@ -52,11 +50,12 @@ ENTRY (P(__,socket)) movl %edx, %ebx /* %eax is < 0 if there was an error. */ - testl %eax, %eax - jl syscall_error + cmpl $-125, %eax + jae syscall_error /* Successful; return the syscall's value. */ ret - .size P(__,socket),.-P(__,socket) + +PSEUDO_END (P(__,socket)) weak_alias (P(__,socket), socket) diff --git a/sysdeps/unix/sysv/linux/i386/syscall.S b/sysdeps/unix/sysv/linux/i386/syscall.S index e7839cd1c0..018a86ee39 100644 --- a/sysdeps/unix/sysv/linux/i386/syscall.S +++ b/sysdeps/unix/sysv/linux/i386/syscall.S @@ -22,8 +22,8 @@ Cambridge, MA 02139, USA. */ more information about the value -125 used below.*/ .text - SYSCALL_ERROR_HANDLER /* Define error handler for PIC. */ ENTRY (syscall) + PUSHARGS_5 /* Save register contents. */ _DOARGS_5(36) /* Load arguments. */ movl 16(%esp), %eax /* Load syscall number into %eax. */ @@ -32,4 +32,5 @@ ENTRY (syscall) cmpl $-125, %eax /* Check %eax for error. */ jae syscall_error /* Jump to error handler if error. */ ret /* Return to caller. */ - .size syscall,.-syscall + +PSEUDO_END (syscall) diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.S b/sysdeps/unix/sysv/linux/i386/sysdep.S index 9727f8976f..742ba2b1a9 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.S +++ b/sysdeps/unix/sysv/linux/i386/sysdep.S @@ -67,4 +67,4 @@ ENTRY (__errno_location) movl $errno, %eax #endif ret - .size __errno_location, .-__errno_location +END (__errno_location) diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index b00c976351..5d378fd179 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -28,11 +28,7 @@ Cambridge, MA 02139, USA. */ of the kernel. But these symbols do not follow the SYS_* syntax so we have to redefine the `SYS_ify' macro here. */ #undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif +#define SYS_ify(syscall_name) __NR_##syscall_name #ifdef ASSEMBLER @@ -51,19 +47,22 @@ Cambridge, MA 02139, USA. */ #undef PSEUDO #define PSEUDO(name, syscall_name, args) \ .text; \ - SYSCALL_ERROR_HANDLER \ ENTRY (name) \ DO_CALL (args, syscall_name); \ cmpl $-125, %eax; \ jae syscall_error; +#undef PSEUDO_END +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER \ + END (name) + #ifndef PIC #define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ #else /* Store (- %eax) into errno through the GOT. */ #ifdef _LIBC_REENTRANT #define SYSCALL_ERROR_HANDLER \ - .type syscall_error,@function; \ syscall_error: \ pushl %ebx; \ call 0f; \ @@ -79,13 +78,11 @@ syscall_error: \ popl %ebx; \ movl %ecx, (%eax); \ movl $-1, %eax; \ - ret; \ - .size syscall_error,.-syscall-error; + ret; /* A quick note: it is assumed that the call to `__errno_location' does not modify the stack! */ #else #define SYSCALL_ERROR_HANDLER \ - .type syscall_error,@function; \ syscall_error: \ call 0f; \ 0:popl %ecx; \ @@ -95,8 +92,7 @@ syscall_error: \ movl errno@GOT(%ecx), %ecx; \ movl %edx, (%ecx); \ movl $-1, %eax; \ - ret; \ - .size syscall_error,.-syscall-error; + ret; #endif /* _LIBC_REENTRANT */ #endif /* PIC */ @@ -121,7 +117,7 @@ syscall_error: \ (Of course a function with say 3 arguments does not have entries for arguments 4 and 5.) - The following code tries hard to be optimal. A general assuption + The following code tries hard to be optimal. A general assumption (which is true according to the data books I have) is that 2 * xchg is more expensive than pushl + movl + popl @@ -136,7 +132,7 @@ syscall_error: \ (2 * movl is less expensive than pushl + popl). Second unlike for the other registers we don't save the content of - %ecx and %edx when we have than 1 and 2 registers resp. + %ecx and %edx when we have more than 1 and 2 registers resp. The code below might look a bit long but we have to take care for the pipelined processors (i586 and up). Here the `pushl' and `popl' |