* 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.
This commit is contained in:
Roland McGrath 2006-02-28 09:34:41 +00:00
parent 88fe017b92
commit 8d2e6a0383
3 changed files with 40 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2006-02-22 Martin Schwidefsky <schwidefsky@de.ibm.com>
* 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.
2006-02-28 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Copy in i386/bits/fcntl.h.

View File

@ -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. */

View File

@ -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