summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-12-15 09:53:46 +0000
committerJakub Jelinek <jakub@redhat.com>2004-12-15 09:53:46 +0000
commit14cbd70aa6ab1b1fcb77b4f2ab53e2954ea081e9 (patch)
treedebbaa8f74dc640a05ea11e96091d31bfbfe28ea /sysdeps
parentbefe97e0d0e019ed913a2dddee77c62662349aec (diff)
* 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. nptl/ * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file. * sysdeps/s390/tcb-offsets.sym (TID): Add.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/clone.S12
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/clone.S14
2 files changed, 26 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
index 442045bf21..c0201f8a93 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
@@ -54,6 +54,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..c58155da9c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
@@ -55,6 +55,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 */