From f23673fc71f75f509f4b4c0080fb975a939a462f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 15 Dec 2004 17:45:55 +0000 Subject: Update. 2004-12-15 Jakub Jelinek * nis/nis_domain_of_r.c (nis_domain_of_r): Use libnsl_hidden_def, not libnsl_hidden_proto. * sysdeps/unix/sysv/linux/s390/s390-32/clone.S (__clone): Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S (__clone): Save and restore r2 around call to fn. --- sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 2 ++ sysdeps/unix/sysv/linux/s390/s390-32/clone.S | 13 +++++++++++++ sysdeps/unix/sysv/linux/s390/s390-64/clone.S | 15 +++++++++++++++ 3 files changed, 30 insertions(+) (limited to 'sysdeps') diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S index 61a35a2f79..f6ce115077 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S @@ -104,12 +104,14 @@ L(nomoregetpid): L(oldpid): #endif + std r2,40(r1) /* Call procedure. */ ld r0,0(r29) ld r2,8(r29) mtctr r0 mr r3,r31 bctrl + ld r2,40(r1) /* Call _exit with result from procedure. */ #ifdef SHARED b JUMPTARGET(__GI__exit) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S index 442045bf21..70f695a952 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S +++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S @@ -21,6 +21,7 @@ and invokes a function in the right context after its all over. */ #include +#include #define _ERRNO_H 1 #include @@ -54,6 +55,18 @@ error: PSEUDO_END (__clone) thread_start: +#ifdef RESET_PID + tmh %r3,1 /* CLONE_THREAD == 0x00010000 */ + jne 1f + lhi %r2,-1 + tml %r3,256 /* CLONE_VM == 0x00000100 */ + jne 2f + svc SYS_ify(getpid) +2: ear %r3,%a0 + st %r2,PID(%r3) + st %r2,TID(%r3) +1: +#endif /* fn is in gpr 1, arg in gpr 0 */ lr %r2,%r0 /* set first parameter to void *arg */ ahi %r15,-96 /* make room on the stack for the save area */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S index 724ca611ec..cdc6716a1f 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S @@ -22,6 +22,7 @@ and invokes a function in the right context after its all over. */ #include +#include #define _ERRNO_H 1 #include @@ -55,6 +56,20 @@ error: PSEUDO_END (__clone) thread_start: +#ifdef RESET_PID + tmh %r3,1 /* CLONE_THREAD == 0x00010000 */ + jne 1f + lhi %r2,-1 + tml %r3,256 /* CLONE_VM == 0x00000100 */ + jne 2f + svc SYS_ify(getpid) +2: ear %r3,%a0 + sllg %r3,%r3,32 + ear %r3,%a1 + st %r2,PID(%r3) + st %r2,TID(%r3) +1: +#endif /* fn is in gpr 1, arg in gpr 0 */ lgr %r2,%r0 /* set first parameter to void *arg */ aghi %r15,-160 /* make room on the stack for the save area */ -- cgit v1.2.3