about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/i386/clone.S26
-rw-r--r--sysdeps/unix/sysv/linux/i386/mmap64.S37
2 files changed, 41 insertions, 22 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S
index 7a2025b53c..e22a053208 100644
--- a/sysdeps/unix/sysv/linux/i386/clone.S
+++ b/sysdeps/unix/sysv/linux/i386/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@tamu.edu)
 
@@ -24,21 +24,29 @@
 #define _ERRNO_H	1
 #include <bits/errno.h>
 #include <asm-syntax.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
 
 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
 
+#define PARMS	LINKAGE		/* no space for saved regs */
+#define FUNC	PARMS
+#define STACK	FUNC+4
+#define FLAGS	STACK+PTR_SIZE
+#define ARG	FLAGS+4
+
         .text
-ENTRY(__clone)
+ENTRY (BP_SYM (__clone))
 	/* Sanity check arguments.  */
 	movl	$-EINVAL,%eax
-	movl	4(%esp),%ecx		/* no NULL function pointers */
+	movl	FUNC(%esp),%ecx		/* no NULL function pointers */
 #ifdef PIC
 	jecxz	SYSCALL_ERROR_LABEL
 #else
 	testl	%ecx,%ecx
 	jz	SYSCALL_ERROR_LABEL
 #endif
-	movl	8(%esp),%ecx		/* no NULL stack pointers */
+	movl	STACK(%esp),%ecx	/* no NULL stack pointers */
 #ifdef PIC
 	jecxz	SYSCALL_ERROR_LABEL
 #else
@@ -48,17 +56,17 @@ ENTRY(__clone)
 
 	/* Insert the argument onto the new stack.  */
 	subl	$8,%ecx
-	movl	16(%esp),%eax		/* no negative argument counts */
+	movl	ARG(%esp),%eax		/* no negative argument counts */
 	movl	%eax,4(%ecx)
 
 	/* Save the function pointer as the zeroth argument.
 	   It will be popped off in the child in the ebx frobbing below.  */
-	movl	4(%esp),%eax
+	movl	FUNC(%esp),%eax
 	movl	%eax,0(%ecx)
 
 	/* Do the system call */
 	pushl	%ebx
-	movl	16(%esp),%ebx
+	movl	FLAGS+4(%esp),%ebx
 	movl	$SYS_ify(clone),%eax
 	int	$0x80
 	popl	%ebx
@@ -82,6 +90,6 @@ L(here):
 	pushl	%eax
 	call	JUMPTARGET (_exit)
 
-PSEUDO_END (__clone)
+PSEUDO_END (BP_SYM (__clone))
 
-weak_alias (__clone, clone)
+weak_alias (BP_SYM (__clone), BP_SYM (clone))
diff --git a/sysdeps/unix/sysv/linux/i386/mmap64.S b/sysdeps/unix/sysv/linux/i386/mmap64.S
index 3228420665..349d3501c6 100644
--- a/sysdeps/unix/sysv/linux/i386/mmap64.S
+++ b/sysdeps/unix/sysv/linux/i386/mmap64.S
@@ -17,15 +17,26 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
 
 #include "kernel-features.h"
 
 #define EINVAL	22
 #define ENOSYS	38
 
-	.text
+#define SVRSP	16		/* saved register space */
+#define PARMS	LINKAGE+SVRSP	/* space for 4 saved regs */
+#define ADDR	PARMS
+#define LEN	ADDR+PTR_SIZE
+#define PROT	LEN+4
+#define FLAGS	PROT+4
+#define FD	FLAGS+4
+#define OFFLO	FD+4
+#define OFFHI	OFFLO+4
 
-ENTRY (__mmap64)
+	.text
+ENTRY (BP_SYM (__mmap64))
 
 #ifdef __NR_mmap2
 
@@ -35,8 +46,8 @@ ENTRY (__mmap64)
 	pushl %esi
 	pushl %edi
 
-	movl 40(%esp), %edx
-	movl 44(%esp), %ecx
+	movl OFFLO(%esp), %edx
+	movl OFFHI(%esp), %ecx
 	testl $0x3ff, %edx
 	jne L(einval)
 	shrdl $12, %ecx, %edx		/* mmap2 takes the offset in pages.  */
@@ -44,11 +55,11 @@ ENTRY (__mmap64)
 	jne L(einval)
 	movl %edx, %ebp
 
-	movl 20(%esp), %ebx
-	movl 24(%esp), %ecx
-	movl 28(%esp), %edx
-	movl 32(%esp), %esi
-	movl 36(%esp), %edi
+	movl ADDR(%esp), %ebx
+	movl LEN(%esp), %ecx
+	movl PROT(%esp), %edx
+	movl FLAGS(%esp), %esi
+	movl FD(%esp), %edi
 
 	movl $SYS_ify(mmap2), %eax	/* System call number in %eax.  */
 
@@ -91,12 +102,12 @@ L(einval):
 	/* Save registers.  */
 	movl %ebx, %edx
 
-	cmpl $0, 28(%esp)
+	cmpl $0, OFFHI-SVRSP(%esp)
 	jne L(einval2)
 
 	movl $SYS_ify(mmap), %eax	/* System call number in %eax.  */
 
-	lea 4(%esp), %ebx		/* Address of args is 1st arg.  */
+	lea ADDR-SVRSP(%esp), %ebx	/* Address of args is 1st arg.  */
 
 	/* Do the system call trap.  */
 	int $0x80
@@ -120,6 +131,6 @@ L(einval2):
 	jmp SYSCALL_ERROR_LABEL
 #endif
 
-PSEUDO_END (__mmap64)
+PSEUDO_END (BP_SYM (__mmap64))
 
-weak_alias (__mmap64, mmap64)
+weak_alias (BP_SYM (__mmap64), BP_SYM (mmap64))