diff options
author | Roland McGrath <roland@gnu.org> | 2006-02-28 09:34:41 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2006-02-28 09:34:41 +0000 |
commit | 8d2e6a0383b6958311f021ee0b8b7eba44110f5a (patch) | |
tree | e995118b74707ad2e2273c46977d9321deb4cbad /sysdeps | |
parent | 88fe017b926bbddc4190f260b61cdf7b0f1d668f (diff) | |
download | glibc-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')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 19 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 20 |
2 files changed, 33 insertions, 6 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. */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index aadbf74c2b..fc80c9ff86 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -1,5 +1,6 @@ /* Assembler macros for 64 bit S/390. - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 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. @@ -150,19 +151,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; \ + lgr %r0,%r7; \ + lg %r7,160(%r15); \ + .endif; \ .if SYS_ify (syscall) < 256; \ svc SYS_ify (syscall); \ .else; \ lghi %r1,SYS_ify (syscall); \ svc 0; \ + .endif; \ + .if args > 5; \ + lgr %r7,%r0; \ .endif #define ret \ @@ -256,6 +266,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 gpr6 asm ("7") = (unsigned long)(arg6); #define ASMFMT_0 #define ASMFMT_1 , "0" (gpr2) @@ -263,6 +276,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. */ #if defined NOT_IN_libc && defined IS_IN_rtld |