OSDN Git Service

i386 specific bit for nptl
authorAustin Foxley <austinf@cetoncorp.com>
Sat, 17 Oct 2009 20:19:56 +0000 (13:19 -0700)
committerAustin Foxley <austinf@cetoncorp.com>
Sat, 17 Oct 2009 20:19:56 +0000 (13:19 -0700)
 * RESET_PID support for clone.S
 * SAVE_PID, RESTORE_PID in vfork.S
 * fixup syscall assembly constraints to be a little less restrictive
      allows arbitrary variables to be used as the syscall nr

Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
libc/sysdeps/linux/i386/Makefile.arch
libc/sysdeps/linux/i386/bits/syscalls.h
libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
libc/sysdeps/linux/i386/clone.S
libc/sysdeps/linux/i386/vfork.S

index 2bf2b76..668cca7 100644 (file)
@@ -5,8 +5,17 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-CSRC := brk.c sigaction.c __syscall_error.c
+CSRC := brk.c __syscall_error.c
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+CSRC += sigaction.c
+endif
 
 SSRC := \
-       __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
+       __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
        sync_file_range.S syscall.S mmap.S mmap64.S posix_fadvise64.S
+
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += vfork.S clone.S
+endif
index 23d872a..f9ea54a 100644 (file)
@@ -102,7 +102,7 @@ __asm__ (".L__X'%ebx = 1\n\t"
     "int $0x80\n\t"                                                           \
     RESTOREARGS_##nr                                                          \
     : "=a" (resultvar)                                                        \
-    : "i" (name) ASMFMT_##nr(args) : "memory", "cc");                         \
+    : "g" (name) ASMFMT_##nr(args) : "memory", "cc");                         \
      (int) resultvar; })
 
 #define LOADARGS_0
index deeec03..536e9c1 100644 (file)
@@ -37,7 +37,7 @@
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
 /* define if target supports CFI pseudo ops */
-#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
+#define __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
 
 /* define if target supports IEEE signed zero floats */
 #define __UCLIBC_HAVE_SIGNED_ZERO__
index 14fc25c..a7de3fe 100644 (file)
@@ -79,7 +79,10 @@ clone:
        movl    %eax,8(%ecx)
        /* Don't leak any information.  */
        movl    $0,4(%ecx)
+#ifndef RESET_PID
        movl    $0,(%ecx)
+#endif
+
 
        /* Do the system call */
        pushl   %ebx
@@ -90,6 +93,10 @@ clone:
        movl    FLAGS+12(%esp),%ebx
        movl    CTID+12(%esp),%edi
        movl    $__NR_clone,%eax
+#ifdef RESET_PID
+       /* Remember the flag value.  */
+       movl    %ebx, (%ecx)
+#endif
        int     $0x80
        popl    %edi
        popl    %esi
@@ -121,3 +128,4 @@ __error:
        jmp __syscall_error
 
 .size clone,.-clone
+weak_alias(clone, __clone)
index 8005ff1..c9db2f4 100644 (file)
 
 __vfork:
        popl %ecx
+
+#ifdef SAVE_PID
+       SAVE_PID
+#endif
+
        movl $__NR_vfork,%eax
        int $0x80
        pushl %ecx
+
+#ifdef RESTORE_PID
+       RESTORE_PID
+#endif
+
        cmpl $-4095,%eax
        jae __syscall_error
        ret