about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2006-02-28 09:34:41 +0000
committerRoland McGrath <roland@gnu.org>2006-02-28 09:34:41 +0000
commit8d2e6a0383b6958311f021ee0b8b7eba44110f5a (patch)
treee995118b74707ad2e2273c46977d9321deb4cbad /sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
parent88fe017b926bbddc4190f260b61cdf7b0f1d668f (diff)
downloadglibc-8d2e6a0383b6958311f021ee0b8b7eba44110f5a.tar.gz
glibc-8d2e6a0383b6958311f021ee0b8b7eba44110f5a.tar.xz
glibc-8d2e6a0383b6958311f021ee0b8b7eba44110f5a.zip
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
	(DO_CALL): Add support for 6 system call parameters.
	(DECLARGS_6, ASMFMT_6): Define.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 50c3f42469..b86072bd30 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
@@ -149,19 +149,28 @@
 	arg 3		4	     call-clobbered
 	arg 4		5	     call-clobbered
 	arg 5		6	     call-saved
+	arg 6		7	     call-saved
 
    (Of course a function with say 3 arguments does not have entries for
    arguments 4 and 5.)
-   S390 does not need to do ANY stack operations to get its parameters
-   right.
+   For system calls with 6 parameters a stack operation is required
+   to load the 6th parameter to register 7. Call saved register 7 is
+   moved to register 0 and back to avoid an additional stack frame.
  */
 
 #define DO_CALL(syscall, args)						      \
+  .if args > 5;								      \
+    lr %r0,%r7;								      \
+    l %r7,96(%r15);							      \
+  .endif;								      \
   .if SYS_ify (syscall) < 256;						      \
     svc SYS_ify (syscall);						      \
   .else;								      \
     lhi %r1,SYS_ify (syscall);						      \
     svc 0;								      \
+  .endif;								      \
+  .if args > 5;								      \
+    lr %r7,%r0;								      \
   .endif
 
 #define ret                                                                   \
@@ -255,6 +264,9 @@
 #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
 	DECLARGS_4(arg1, arg2, arg3, arg4) \
 	register unsigned long gpr6 asm ("6") = (unsigned long)(arg5);
+#define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
+	DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
+	register unsigned long gpr7 asm ("7") = (unsigned long)(arg6);
 
 #define ASMFMT_0
 #define ASMFMT_1 , "0" (gpr2)
@@ -262,6 +274,7 @@
 #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)
 #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5)
 #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
+#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
 
 
 /* Pointer mangling support.  */