diff options
author | Austin Foxley <austinf@cetoncorp.com> | 2009-05-21 15:25:35 -0700 |
---|---|---|
committer | Austin Foxley <austinf@cetoncorp.com> | 2009-05-21 15:25:35 -0700 |
commit | 9a2837c77c664d32a1fc9860cb193f25e0f3f37e (patch) | |
tree | 1928f5cde7c6c070dbd346a59457006c180aad1e /libpthread/nptl/sysdeps/unix/sysv/linux | |
parent | cdf998b99e1f18e5aa549dc46a1f9ef55d934fff (diff) | |
download | uClibc-alpine-9a2837c77c664d32a1fc9860cb193f25e0f3f37e.tar.bz2 uClibc-alpine-9a2837c77c664d32a1fc9860cb193f25e0f3f37e.tar.xz |
Get sparc64 nptl compiling
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/unix/sysv/linux')
4 files changed, 66 insertions, 57 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S index 410f32017..64e3bfc12 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S @@ -1,2 +1,2 @@ #define RESET_PID -#include <sysdeps/unix/sysv/linux/sparc/sparc64/clone.S> +#include <libc/sysdeps/linux/sparc/sparcv9/clone.S> diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S index e9018b2e9..8941043c3 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S @@ -21,6 +21,7 @@ #include <tcb-offsets.h> .text + .globl __syscall_error ENTRY(__vfork) ld [%g7 + PID], %o5 sub %g0, %o5, %o4 @@ -28,15 +29,17 @@ ENTRY(__vfork) LOADSYSCALL(vfork) ta 0x6d - bcs,a,pn %xcc, __syscall_error_handler - st %o5, [%g7 + PID] - SYSCALL_ERROR_HANDLER - sub %o1, 1, %o1 + bcc,pt %xcc, 2f + mov %o7, %g1 + st %o5, [%g7 + PID] + call __syscall_error + mov %g1, %o7 +2: sub %o1, 1, %o1 andcc %o0, %o1, %o0 bne,a,pt %icc, 1f st %o5, [%g7 + PID] 1: retl nop +END(__vfork) -PSEUDO_END (__vfork) weak_alias (__vfork, vfork) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h index d8c65aeff..aec2d4a86 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -20,55 +20,52 @@ #include <sysdep.h> #include <tls.h> #ifndef __ASSEMBLER__ -# include <nptl/pthreadP.h> +# include <pthreadP.h> #endif #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt # undef PSEUDO -# define PSEUDO(name, syscall_name, args) \ - .text; \ -ENTRY(name) \ - ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \ - brnz,pn %g1, 1f; \ -.type __##syscall_name##_nocancel,@function; \ -.globl __##syscall_name##_nocancel; \ -__##syscall_name##_nocancel: \ - mov SYS_ify(syscall_name), %g1; \ - ta 0x6d; \ - bcs,pn %xcc, __syscall_error_handler; \ - nop; \ -.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ - .subsection 2; \ -1: save %sp, -192, %sp; \ - CENABLE; \ - nop; \ - mov %o0, %l0; \ - COPY_ARGS_##args \ - mov SYS_ify(syscall_name), %g1; \ - ta 0x6d; \ - bcs,pn %xcc, __syscall_error_handler2; \ - mov %o0, %l1; \ - CDISABLE; \ - mov %l0, %o0; \ - jmpl %i7 + 8, %g0; \ - restore %g0, %l1, %o0; \ - .previous; \ - SYSCALL_ERROR_HANDLER \ - SYSCALL_ERROR_HANDLER2 - -#define SYSCALL_ERROR_HANDLER2 \ -SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \ - .global __errno_location; \ - .type __errno_location,@function; \ - CDISABLE; \ - mov %l0, %o0; \ - call __errno_location; \ - nop; \ - st %l1, [%o0]; \ - jmpl %i7 + 8, %g0; \ - restore %g0, -1, %o0; \ - .previous; +# define PSEUDO(name, syscall_name, args) \ + .text; \ + .globl __syscall_error; \ +ENTRY(name) \ + ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\ + brnz,pn %g1, 1f; \ +.type __##syscall_name##_nocancel,@function; \ +.globl __##syscall_name##_nocancel; \ +__##syscall_name##_nocancel: \ + mov SYS_ify(syscall_name), %g1; \ + ta 0x6d; \ + bcc,pt %xcc, 8f; \ + mov %o7, %g1; \ + call __syscall_error; \ + mov %g1, %o7; \ +8: jmpl %o7 + 8, %g0; \ + nop; \ +.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\ +1: save %sp, -192, %sp; \ + cfi_def_cfa_register(%fp); \ + cfi_window_save; \ + cfi_register(%o7, %i7); \ + CENABLE; \ + nop; \ + mov %o0, %l0; \ + COPY_ARGS_##args \ + mov SYS_ify(syscall_name), %g1; \ + ta 0x6d; \ + bcc,pt %xcc, 1f; \ + mov %o0, %l1; \ + CDISABLE; \ + mov %l0, %o0; \ + call __syscall_error; \ + mov %l1, %o0; \ + ba,pt %xcc, 2f; \ + mov -1, %l1; \ +1: CDISABLE; \ + mov %l0, %o0; \ +2: jmpl %i7 + 8, %g0; \ + restore %g0, %l1, %o0; # ifdef IS_IN_libpthread # define CENABLE call __pthread_enable_asynccancel @@ -105,3 +102,9 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \ # define NO_CANCELLATION 1 #endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S index 8de9863e7..b4e89aceb 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S @@ -21,6 +21,7 @@ #include <tcb-offsets.h> .text + .globl __syscall_error ENTRY(__vfork) ld [%g7 + PID], %o5 sethi %hi(0x80000000), %o3 @@ -31,16 +32,18 @@ ENTRY(__vfork) LOADSYSCALL(vfork) ta 0x6d - bcs,a,pn %xcc, __syscall_error_handler - st %o5, [%g7 + PID] - SYSCALL_ERROR_HANDLER - sub %o1, 1, %o1 + bcc,pt %xcc, 2f + mov %o7, %g1 + st %o5, [%g7 + PID] + call __syscall_error + mov %g1, %o7 +2: sub %o1, 1, %o1 andcc %o0, %o1, %o0 bne,a,pt %icc, 1f st %o5, [%g7 + PID] 1: retl nop +END(__vfork) -PSEUDO_END (__vfork) -hidden_def (__vfork) +hidden_def (vfork) weak_alias (__vfork, vfork) |