diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 18:26:36 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 18:26:36 +0000 |
commit | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch) | |
tree | 2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | |
parent | 7d58530341304d403a6626d7f7a1913165fe2f32 (diff) | |
download | glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.bz2 glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.zip |
2.5-18.1
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index 154bc06803..9ddec8e041 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 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. @@ -24,6 +25,7 @@ #include <sysdeps/s390/s390-64/sysdep.h> #include <sysdeps/unix/sysdep.h> #include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO. */ +#include <tls.h> /* For Linux we can use the system call table in the header file /usr/include/asm/unistd.h @@ -149,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 \ @@ -255,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 gpr7 asm ("7") = (unsigned long)(arg6); #define ASMFMT_0 #define ASMFMT_1 , "0" (gpr2) @@ -262,5 +276,29 @@ #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 +/* We cannot use the thread descriptor because in ld.so we use setjmp + earlier than the descriptor is initialized. */ +#else +/* For the time being just use stack_guard rather than a separate + pointer_guard. */ +# ifdef __ASSEMBLER__ +# define PTR_MANGLE(reg, tmpreg) \ + ear tmpreg,%a0; \ + sllg tmpreg,tmpreg,32; \ + ear tmpreg,%a1; \ + xg reg,STACK_GUARD(tmpreg) +# define PTR_MANGLE2(reg, tmpreg) \ + xg reg,STACK_GUARD(tmpreg) +# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) +# else +# define PTR_MANGLE(var) \ + (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) +# define PTR_DEMANGLE(var) PTR_MANGLE (var) +# endif +#endif #endif /* _LINUX_S390_SYSDEP_H */ |