]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix code for running on kernel without mmap2 syscall.
authorUlrich Drepper <drepper@redhat.com>
Tue, 4 Jan 2000 00:38:42 +0000 (00:38 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 4 Jan 2000 00:38:42 +0000 (00:38 +0000)
sysdeps/unix/sysv/linux/i386/mmap64.S

index fbe54577036767b42765153fffcfb178b2d189e9..22515a11d28565dc7199f6f3639b553f938998eb 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <sysdep.h>
 
+#include "kernel-features.h"
+
 #define EINVAL 22
 #define ENOSYS 38
 
@@ -60,6 +62,12 @@ L(do_syscall):
        popl %ebx
        popl %ebp
 
+#ifndef __ASSUME_MMAP2_SYSCALL
+2:
+       cmp $-ENOSYS, %eax
+       je 3f
+#endif
+
        /* If 0 > %eax > -4096 there was an error.  */
        cmpl $-4096, %eax
        ja SYSCALL_ERROR_LABEL
@@ -68,10 +76,6 @@ L(do_syscall):
 L(pseudo_end):
        ret
 
-2:
-       cmp $-ENOSYS, %eax
-       je 3f
-
        /* This means the offset value is too large.  */
 L(einval):
        popl %edi
@@ -82,22 +86,22 @@ L(einval):
        jmp SYSCALL_ERROR_LABEL
 #endif
 
+#if !defined __ASSUME_MMAP2_SYSCALL || !defined __NR_mmap2
 
-#ifndef __NR_mmap2
+3:
        /* Save registers.  */
        movl %ebx, %edx
-#endif
-3:
-       cmpl $0, 44(%esp)
+
+       cmpl $0, 28(%esp)
        jne L(einval)
 
        movl $SYS_ify(mmap), %eax       /* System call number in %eax.  */
 
        lea 4(%esp), %ebx               /* Address of args is 1st arg.  */
 
-#ifdef __NR_mmap2
+# ifdef __NR_mmap2
        jmp L(do_syscall)
-#else
+# else
 
        /* Do the system call trap.  */
        int $0x80
@@ -114,8 +118,10 @@ L(pseudo_end):
        ret
 
 L(einval):
+       movl %edx, %ebx
        movl $-EINVAL, %eax
        jmp SYSCALL_ERROR_LABEL
+# endif
 #endif
 
 PSEUDO_END (__mmap64)