x86: Consolidate NPTL/non versions of clone

This commit is contained in:
Roland McGrath 2014-05-14 10:16:27 -07:00
parent 1b731c35e6
commit 941d7dfd24
5 changed files with 6 additions and 29 deletions

View File

@ -1,5 +1,11 @@
2014-05-14 Roland McGrath <roland@hack.frob.com> 2014-05-14 Roland McGrath <roland@hack.frob.com>
* sysdeps/unix/sysv/linux/x86_64/clone.S: Deconditionalize the code
that was previously under [RESET_PID].
* sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
* nptl/sysdeps/unix/sysv/linux/x86_64/clone.S: File removed.
* nptl/sysdeps/unix/sysv/linux/i386/clone.S: File removed.
* sysdeps/i386/nptl/Implies: New file. * sysdeps/i386/nptl/Implies: New file.
* sysdeps/x86_64/nptl/Implies: New file. * sysdeps/x86_64/nptl/Implies: New file.
* nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h: Moved ... * nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h: Moved ...

View File

@ -1,9 +0,0 @@
/* We want an #include_next, but we are the main source file.
So, #include ourselves and in that incarnation we can use #include_next. */
#ifndef INCLUDED_SELF
# define INCLUDED_SELF
# include <clone.S>
#else
# define RESET_PID
# include_next <clone.S>
#endif

View File

@ -1,9 +0,0 @@
/* We want an #include_next, but we are the main source file.
So, #include ourselves and in that incarnation we can use #include_next. */
#ifndef INCLUDED_SELF
# define INCLUDED_SELF
# include <clone.S>
#else
# define RESET_PID
# include_next <clone.S>
#endif

View File

@ -74,9 +74,6 @@ ENTRY (__clone)
movl %eax,8(%ecx) movl %eax,8(%ecx)
/* Don't leak any information. */ /* Don't leak any information. */
movl $0,4(%ecx) movl $0,4(%ecx)
#ifndef RESET_PID
movl $0,(%ecx)
#endif
/* Do the system call */ /* Do the system call */
pushl %ebx pushl %ebx
@ -95,10 +92,8 @@ ENTRY (__clone)
cfi_rel_offset (edi, 0) cfi_rel_offset (edi, 0)
movl $SYS_ify(clone),%eax movl $SYS_ify(clone),%eax
#ifdef RESET_PID
/* Remember the flag value. */ /* Remember the flag value. */
movl %ebx, (%ecx) movl %ebx, (%ecx)
#endif
/* End FDE now, because in the child the unwind info will be /* End FDE now, because in the child the unwind info will be
wrong. */ wrong. */
@ -121,11 +116,9 @@ L(thread_start):
cfi_undefined (eip); cfi_undefined (eip);
/* Note: %esi is zero. */ /* Note: %esi is zero. */
movl %esi,%ebp /* terminate the stack frame */ movl %esi,%ebp /* terminate the stack frame */
#ifdef RESET_PID
testl $CLONE_THREAD, %edi testl $CLONE_THREAD, %edi
je L(newpid) je L(newpid)
L(haspid): L(haspid):
#endif
call *%ebx call *%ebx
#ifdef PIC #ifdef PIC
call L(here) call L(here)
@ -137,7 +130,6 @@ L(here):
movl $SYS_ify(exit), %eax movl $SYS_ify(exit), %eax
ENTER_KERNEL ENTER_KERNEL
#ifdef RESET_PID
.subsection 2 .subsection 2
L(newpid): L(newpid):
testl $CLONE_VM, %edi testl $CLONE_VM, %edi
@ -150,7 +142,6 @@ L(nomoregetpid):
movl %eax, %gs:TID movl %eax, %gs:TID
jmp L(haspid) jmp L(haspid)
.previous .previous
#endif
cfi_endproc; cfi_endproc;
cfi_startproc cfi_startproc

View File

@ -92,7 +92,6 @@ L(thread_start):
the outermost frame obviously. */ the outermost frame obviously. */
xorl %ebp, %ebp xorl %ebp, %ebp
#ifdef RESET_PID
testq $CLONE_THREAD, %rdi testq $CLONE_THREAD, %rdi
jne 1f jne 1f
testq $CLONE_VM, %rdi testq $CLONE_VM, %rdi
@ -103,7 +102,6 @@ L(thread_start):
2: movl %eax, %fs:PID 2: movl %eax, %fs:PID
movl %eax, %fs:TID movl %eax, %fs:TID
1: 1:
#endif
/* Set up arguments for the function call. */ /* Set up arguments for the function call. */
popq %rax /* Function to call. */ popq %rax /* Function to call. */