aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-20 18:59:08 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-20 18:59:08 +0000
commitd5b6c8179917acad6e8b46110179298b47dcaf5c (patch)
tree81e3f3da880e9bcd16c129cca50bedb2b6ab78d2 /sysdeps/unix/sysv
parent4a9b34fe010debca945da57e04c519b51140045d (diff)
downloadglibc-d5b6c8179917acad6e8b46110179298b47dcaf5c.tar
glibc-d5b6c8179917acad6e8b46110179298b47dcaf5c.tar.gz
glibc-d5b6c8179917acad6e8b46110179298b47dcaf5c.tar.bz2
glibc-d5b6c8179917acad6e8b46110179298b47dcaf5c.zip
Update.
2003-01-20 Martin Schwidefsky <schwidefsky@de.ibm.com> * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL): Fix inline assembler constraints. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL): Likewise. * sysdeps/s390/s390-64/Makefile (pic-ccflag): Use -fpic instead of -fPIC.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h79
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h39
2 files changed, 29 insertions, 89 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 28600feec0..e89e6a1425 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -132,15 +132,13 @@
#define INTERNAL_SYSCALL(name, err, nr, args...) \
({ \
DECLARGS_##nr(args) \
- int _ret; \
+ register int _ret asm("2"); \
asm volatile ( \
- LOADARGS_##nr \
"svc %b1\n\t" \
- "lr %0,%%r2\n\t" \
: "=d" (_ret) \
- : "I" (__NR_##name) ASMFMT_##nr \
- : "memory", "cc", "2", "3", "4", "5", "6"); \
- (int) _ret; })
+ : "i" (__NR_##name) ASMFMT_##nr \
+ : "memory" ); \
+ _ret; })
#undef INTERNAL_SYSCALL_ERROR_P
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
@@ -151,74 +149,25 @@
#define DECLARGS_0()
#define DECLARGS_1(arg1) \
- unsigned int gpr2 = (unsigned int) (arg1);
-#define DECLARGS_2(arg1, arg2) \
- DECLARGS_1(arg1) \
- unsigned int gpr3 = (unsigned int) (arg2);
-#define DECLARGS_3(arg1, arg2, arg3) \
- DECLARGS_2(arg1, arg2) \
- unsigned int gpr4 = (unsigned int) (arg3);
-#define DECLARGS_4(arg1, arg2, arg3, arg4) \
- DECLARGS_3(arg1, arg2, arg3) \
- unsigned int gpr5 = (unsigned int) (arg4);
-#define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
- DECLARGS_4(arg1, arg2, arg3, arg4) \
- unsigned int gpr6 = (unsigned int) (arg5);
-
-#define LOADARGS_0
-#define LOADARGS_1 "L 2,%2\n\t"
-#define LOADARGS_2 LOADARGS_1 "L 3,%3\n\t"
-#define LOADARGS_3 LOADARGS_2 "L 4,%4\n\t"
-#define LOADARGS_4 LOADARGS_3 "L 5,%5\n\t"
-#define LOADARGS_5 LOADARGS_4 "L 6,%6\n\t"
-
-#define ASMFMT_0
-#define ASMFMT_1 , "m" (gpr2)
-#define ASMFMT_2 , "m" (gpr2), "m" (gpr3)
-#define ASMFMT_3 , "m" (gpr2), "m" (gpr3), "m" (gpr4)
-#define ASMFMT_4 , "m" (gpr2), "m" (gpr3), "m" (gpr4), "m" (gpr5)
-#define ASMFMT_5 , "m" (gpr2), "m" (gpr3), "m" (gpr4), "m" (gpr5), "m" (gpr6)
-
-#if 0
-#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
- ({ \
- DECLARGS_##nr(args) \
- asm volatile ( \
- "svc %b1\n\t" \
- : "+d" (gpr2) \
- : "I" (__NR_##name) ASMFMT_##nr : "memory", "cc"); \
- if (gpr2 >= 0xfffff001) \
- { \
- __set_errno(-gpr2); \
- gpr2 = 0xffffffff; \
- } \
- (int) gpr2; })
-
-#define DECLARGS_0() \
- register unsigned int gpr2 asm("2");
-#define DECLARGS_1(arg1) \
- register unsigned int gpr2 asm("2") = (unsigned int) (arg1);
+ register unsigned long gpr2 asm ("2") = (unsigned long)(arg1);
#define DECLARGS_2(arg1, arg2) \
DECLARGS_1(arg1) \
- register unsigned int gpr3 asm("3") = (unsigned int) (arg2);
+ register unsigned long gpr3 asm ("3") = (unsigned long)(arg2);
#define DECLARGS_3(arg1, arg2, arg3) \
DECLARGS_2(arg1, arg2) \
- register unsigned int gpr4 asm("4") = (unsigned int) (arg3);
+ register unsigned long gpr4 asm ("4") = (unsigned long)(arg3);
#define DECLARGS_4(arg1, arg2, arg3, arg4) \
DECLARGS_3(arg1, arg2, arg3) \
- register unsigned int gpr5 asm("5") = (unsigned int) (arg4);
+ register unsigned long gpr5 asm ("5") = (unsigned long)(arg4);
#define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
DECLARGS_4(arg1, arg2, arg3, arg4) \
- register unsigned int gpr6 asm("6") = (unsigned int) (arg5);
+ register unsigned long gpr6 asm ("6") = (unsigned long)(arg5);
#define ASMFMT_0
-#define ASMFMT_1
-#define ASMFMT_2 , "d" (gpr3)
-#define ASMFMT_3 , "d" (gpr3), "d" (gpr4)
-#define ASMFMT_4 , "d" (gpr3), "d" (gpr4), "d" (gpr5)
-#define ASMFMT_5 , "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
-
-#endif /* 0 */
+#define ASMFMT_1 , "0" (gpr2)
+#define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
+#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)
#endif /* _LINUX_S390_SYSDEP_H */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
index 5f0c9fdb98..dbe77df979 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
@@ -19,7 +19,7 @@
02111-1307 USA. */
#ifndef _LINUX_S390_SYSDEP_H
-#define _LINUX_S390_SYSEDP_H
+#define _LINUX_S390_SYSDEP_H
#include <sysdeps/s390/s390-64/sysdep.h>
#include <sysdeps/unix/sysdep.h>
@@ -126,15 +126,13 @@
#define INTERNAL_SYSCALL(name, err, nr, args...) \
({ \
DECLARGS_##nr(args) \
- int _ret; \
+ register int _ret asm("2"); \
asm volatile ( \
- LOADARGS_##nr \
"svc %b1\n\t" \
- "lgr %0,%%r2\n\t" \
: "=d" (_ret) \
- : "I" (__NR_##name) ASMFMT_##nr \
- : "memory", "cc", "2", "3", "4", "5", "6"); \
- (int) _ret; })
+ : "i" (__NR_##name) ASMFMT_##nr \
+ : "memory" ); \
+ _ret; })
#undef INTERNAL_SYSCALL_ERROR_P
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
@@ -145,32 +143,25 @@
#define DECLARGS_0()
#define DECLARGS_1(arg1) \
- unsigned long gpr2 = (unsigned long) (arg1);
+ register unsigned long gpr2 asm ("2") = (unsigned long)(arg1);
#define DECLARGS_2(arg1, arg2) \
DECLARGS_1(arg1) \
- unsigned long gpr3 = (unsigned long) (arg2);
+ register unsigned long gpr3 asm ("3") = (unsigned long)(arg2);
#define DECLARGS_3(arg1, arg2, arg3) \
DECLARGS_2(arg1, arg2) \
- unsigned long gpr4 = (unsigned long) (arg3);
+ register unsigned long gpr4 asm ("4") = (unsigned long)(arg3);
#define DECLARGS_4(arg1, arg2, arg3, arg4) \
DECLARGS_3(arg1, arg2, arg3) \
- unsigned long gpr5 = (unsigned long) (arg4);
+ register unsigned long gpr5 asm ("5") = (unsigned long)(arg4);
#define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
DECLARGS_4(arg1, arg2, arg3, arg4) \
- unsigned long gpr6 = (unsigned long) (arg5);
-
-#define LOADARGS_0
-#define LOADARGS_1 "LG 2,%2\n\t"
-#define LOADARGS_2 LOADARGS_1 "LG 3,%3\n\t"
-#define LOADARGS_3 LOADARGS_2 "LG 4,%4\n\t"
-#define LOADARGS_4 LOADARGS_3 "LG 5,%5\n\t"
-#define LOADARGS_5 LOADARGS_4 "LG 6,%6\n\t"
+ register unsigned long gpr6 asm ("6") = (unsigned long)(arg5);
#define ASMFMT_0
-#define ASMFMT_1 , "m" (gpr2)
-#define ASMFMT_2 , "m" (gpr2), "m" (gpr3)
-#define ASMFMT_3 , "m" (gpr2), "m" (gpr3), "m" (gpr4)
-#define ASMFMT_4 , "m" (gpr2), "m" (gpr3), "m" (gpr4), "m" (gpr5)
-#define ASMFMT_5 , "m" (gpr2), "m" (gpr3), "m" (gpr4), "m" (gpr5), "m" (gpr6)
+#define ASMFMT_1 , "0" (gpr2)
+#define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
+#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)
#endif /* _LINUX_S390_SYSDEP_H */