diff options
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/clone.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/mmap.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/profil-counter.h | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sigcontext.h | 29 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/socket.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/syscall.S | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.S | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.h | 25 |
8 files changed, 60 insertions, 14 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S index b60bc8ed92..0afbf872d9 100644 --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -65,6 +65,7 @@ ENTRY(__clone) jz thread_start ret + .size __clone,.-__clone SYSCALL_ERROR_HANDLER diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S index 638d548e00..30b0f76a43 100644 --- a/sysdeps/unix/sysv/linux/i386/mmap.S +++ b/sysdeps/unix/sysv/linux/i386/mmap.S @@ -42,5 +42,6 @@ ENTRY (__mmap) /* Successful; return the syscall's value. */ ret + .size __mmap,.-__mmap weak_alias (__mmap, mmap) diff --git a/sysdeps/unix/sysv/linux/i386/profil-counter.h b/sysdeps/unix/sysv/linux/i386/profil-counter.h index 7de3faec0e..96b38e24c0 100644 --- a/sysdeps/unix/sysv/linux/i386/profil-counter.h +++ b/sysdeps/unix/sysv/linux/i386/profil-counter.h @@ -17,10 +17,10 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <asm/sigcontext.h> +#include <sigcontext.h> void -profil_counter (int signo, struct sigcontext_struct sc) +profil_counter (int signo, struct sigcontext sc) { profil_count ((void *) sc.eip); } diff --git a/sysdeps/unix/sysv/linux/i386/sigcontext.h b/sysdeps/unix/sysv/linux/i386/sigcontext.h new file mode 100644 index 0000000000..92733ab447 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/sigcontext.h @@ -0,0 +1,29 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifndef _SIGCONTEXT_H +#define _SIGCONTEXT_H 1 + +/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but + we need sigcontext. */ +#define sigcontext_struct sigcontext + +#include <asm/sigcontext.h> + + +#endif /* sigcontext.h */ diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S index 39db6aa50a..0cf4bfdf9e 100644 --- a/sysdeps/unix/sysv/linux/i386/socket.S +++ b/sysdeps/unix/sysv/linux/i386/socket.S @@ -57,5 +57,6 @@ ENTRY (P(__,socket)) /* Successful; return the syscall's value. */ ret + .size P(__,socket),.-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 b7b44e76da..e7839cd1c0 100644 --- a/sysdeps/unix/sysv/linux/i386/syscall.S +++ b/sysdeps/unix/sysv/linux/i386/syscall.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,6 +18,9 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> +/* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for + more information about the value -125 used below.*/ + .text SYSCALL_ERROR_HANDLER /* Define error handler for PIC. */ ENTRY (syscall) @@ -26,6 +29,7 @@ ENTRY (syscall) movl 16(%esp), %eax /* Load syscall number into %eax. */ int $0x80 /* Do the system call. */ POPARGS_5 /* Restore register contents. */ - testl %eax, %eax /* Check %eax for error. */ - jl syscall_error /* Jump to error handler if negative. */ + cmpl $-125, %eax /* Check %eax for error. */ + jae syscall_error /* Jump to error handler if error. */ ret /* Return to caller. */ + .size syscall,.-syscall diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.S b/sysdeps/unix/sysv/linux/i386/sysdep.S index 213af51548..9727f8976f 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.S +++ b/sysdeps/unix/sysv/linux/i386/sysdep.S @@ -67,5 +67,4 @@ ENTRY (__errno_location) movl $errno, %eax #endif ret -.Lfe1: - .size __errno_location, .Lfe1-__errno_location + .size __errno_location, .-__errno_location diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 1bf20bd718..b00c976351 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -37,16 +37,25 @@ Cambridge, MA 02139, USA. */ #ifdef ASSEMBLER -/* Linux uses a negative return value to indicate syscall errors, unlike - most Unices, which use the condition codes' carry flag. */ +/* Linux uses a negative return value to indicate syscall errors, + unlike most Unices, which use the condition codes' carry flag. + + Since version 2.1 the return value of a system call might be + negative even if the call succeeded. E.g., the `lseek' system call + might return a large offset. Therefore we must not anymore test + for < 0, but test for a real error by making sure the value in %eax + is a real error number. For now (as of 2.1.1) 122 is the largest + defined error number. Given a bit room for development, Linus + chose in <asm/unistd.h> to use the values -125 to -1 for error + values. We follow him here. */ #undef PSEUDO #define PSEUDO(name, syscall_name, args) \ .text; \ SYSCALL_ERROR_HANDLER \ ENTRY (name) \ DO_CALL (args, syscall_name); \ - testl %eax, %eax; \ - jl syscall_error; + cmpl $-125, %eax; \ + jae syscall_error; #ifndef PIC #define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ @@ -70,9 +79,10 @@ syscall_error: \ popl %ebx; \ movl %ecx, (%eax); \ movl $-1, %eax; \ - ret; + ret; \ + .size syscall_error,.-syscall-error; /* A quick note: it is assumed that the call to `__errno_location' does - not modify the parameter value! */ + not modify the stack! */ #else #define SYSCALL_ERROR_HANDLER \ .type syscall_error,@function; \ @@ -85,7 +95,8 @@ syscall_error: \ movl errno@GOT(%ecx), %ecx; \ movl %edx, (%ecx); \ movl $-1, %eax; \ - ret; + ret; \ + .size syscall_error,.-syscall-error; #endif /* _LIBC_REENTRANT */ #endif /* PIC */ |