summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps')
-rw-r--r--libpthread/nptl/sysdeps/jmpbuf-unwind.h (renamed from libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h)0
-rw-r--r--libpthread/nptl/sysdeps/pthread_spin_lock.c (renamed from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c)0
-rw-r--r--libpthread/nptl/sysdeps/pthread_spin_trylock.c (renamed from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c)0
-rw-r--r--libpthread/nptl/sysdeps/pthreaddef.h (renamed from libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h)0
-rw-r--r--libpthread/nptl/sysdeps/sparc/Makefile.arch3
-rw-r--r--libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h32
-rw-r--r--libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c (renamed from libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c)17
-rw-r--r--libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c (renamed from libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c)7
-rw-r--r--libpthread/nptl/sysdeps/sparc/pthreaddef.h44
-rw-r--r--libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c38
-rw-r--r--libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c1
-rw-r--r--libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c1
-rw-r--r--libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h27
-rw-r--r--libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c29
-rw-r--r--libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h39
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S7
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S49
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c94
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c (renamed from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c)0
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c (renamed from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c)0
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c (renamed from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c)0
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c (renamed from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c)0
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S44
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c93
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h111
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S48
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S44
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h109
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c1
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S48
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h114
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S53
38 files changed, 373 insertions, 688 deletions
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
index 2f64e7d7c..2f64e7d7c 100644
--- a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
+++ b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/pthread_spin_lock.c
index 2dfcd3c24..2dfcd3c24 100644
--- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
+++ b/libpthread/nptl/sysdeps/pthread_spin_lock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
index c1b7b2397..c1b7b2397 100644
--- a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
+++ b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h b/libpthread/nptl/sysdeps/pthreaddef.h
index 435fedcf3..435fedcf3 100644
--- a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
+++ b/libpthread/nptl/sysdeps/pthreaddef.h
diff --git a/libpthread/nptl/sysdeps/sparc/Makefile.arch b/libpthread/nptl/sysdeps/sparc/Makefile.arch
index 52ac6dbe0..f9662c60c 100644
--- a/libpthread/nptl/sysdeps/sparc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/sparc/Makefile.arch
@@ -4,8 +4,5 @@
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)/sparv9
CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
-
-
diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
index 6cbb37baf..2f64e7d7c 100644
--- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
+++ b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
@@ -1,5 +1,27 @@
-#if defined(__arch64__)
-#include "sparc64/jmpbuf-unwind.h"
-#else
-#include "sparc32/jmpbuf-unwind.h"
-#endif
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
index 023505630..2dfcd3c24 100644
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
+++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
@@ -22,17 +22,18 @@ int
pthread_spin_lock (pthread_spinlock_t *lock)
{
__asm__ __volatile__
- ("1: ldstub [%0], %%g5\n"
- " brnz,pn %%g5, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
+ ("1: ldstub [%0], %%g2\n"
+ " orcc %%g2, 0x0, %%g0\n"
+ " bne,a 2f\n"
+ " ldub [%0], %%g2\n"
".subsection 2\n"
- "2: ldub [%0], %%g5\n"
- " brnz,pt %%g5, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
+ "2: orcc %%g2, 0x0, %%g0\n"
+ " bne,a 2b\n"
+ " ldub [%0], %%g2\n"
+ " b,a 1b\n"
".previous"
: /* no outputs */
: "r" (lock)
- : "g5", "memory");
+ : "g2", "memory", "cc");
return 0;
}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
index b14621b57..c1b7b2397 100644
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
+++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
@@ -23,11 +23,6 @@ int
pthread_spin_trylock (pthread_spinlock_t *lock)
{
int res;
- __asm__ __volatile__
- ("ldstub [%1], %0\n"
- "membar #StoreLoad | #StoreStore"
- : "=r" (res)
- : "r" (lock)
- : "memory");
+ __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
return res == 0 ? 0 : EBUSY;
}
diff --git a/libpthread/nptl/sysdeps/sparc/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
index d4695c47d..435fedcf3 100644
--- a/libpthread/nptl/sysdeps/sparc/pthreaddef.h
+++ b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
@@ -1,5 +1,39 @@
-#if defined(__arch64__)
-#include "sparc64/pthreaddef.h"
-#else
-#include "sparc32/pthreaddef.h"
-#endif
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Default stack size. */
+#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning. */
+#define STACK_ALIGN 16
+
+/* Minimal stack size after allocating thread descriptor and guard size. */
+#define MINIMAL_REST_STACK 2048
+
+/* Alignment requirement for TCB. */
+#define TCB_ALIGNMENT 16
+
+
+/* Location of current stack frame. */
+#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
+register char *stack_pointer __asm__("%sp");
+
+/* XXX Until we have a better place keep the definitions here. */
+
+/* While there is no such syscall. */
+#define __exit_thread_inline(val) \
+ INLINE_SYSCALL (exit, 1, (val))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
deleted file mode 100644
index 3d314be75..000000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "pthreadP.h"
-
-int
-pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " brnz,pn %%g2, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g2\n"
- " brnz,pt %%g2, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g2", "memory");
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
deleted file mode 100644
index 3b20a2180..000000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sparc64/pthread_spin_trylock.c>
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
deleted file mode 100644
index 482cbe3d7..000000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sparc64/pthread_spin_unlock.c>
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d7c..000000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
deleted file mode 100644
index a00fad376..000000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* pthread_spin_unlock -- unlock a spin lock. Generic version.
- Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "pthreadP.h"
-#include <atomic.h>
-
-int
-pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__ ("membar #StoreStore | #LoadStore");
- *lock = 0;
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
deleted file mode 100644
index 845f4bfbb..000000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* Default stack size. */
-#define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024)
-
-/* Required stack pointer alignment at beginning. */
-#define STACK_ALIGN 16
-
-/* Minimal stack size after allocating thread descriptor and guard size. */
-#define MINIMAL_REST_STACK 4096
-
-/* Alignment requirement for TCB. */
-#define TCB_ALIGNMENT 16
-
-
-/* Location of current stack frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
-register char *stack_pointer __asm__("%sp");
-
-/* XXX Until we have a better place keep the definitions here. */
-
-/* While there is no such syscall. */
-#define __exit_thread_inline(val) \
- INLINE_SYSCALL (exit, 1, (val))
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
index dfc5e8261..a6142aafe 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
@@ -1,5 +1,2 @@
-#if defined(__arch64__)
-#include "./sparc64/clone.S"
-#else
-#include "./sparc32/clone.S"
-#endif
+#define RESET_PID
+#include <libc/sysdeps/linux/sparc/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
index e8705c54b..37231a8c3 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
@@ -1,5 +1,44 @@
-#if defined(__arch64__)
-#include "sparc64/pt-vfork.S"
-#else
-#include "sparc32/pt-vfork.S"
-#endif
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <tcb-offsets.h>
+
+ .text
+ .globl __syscall_error
+ENTRY(__vfork)
+ ld [%g7 + PID], %o5
+ sub %g0, %o5, %o4
+ st %o4, [%g7 + PID]
+
+ LOADSYSCALL(vfork)
+ ta 0x10
+ bcc 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 1f
+ st %o5, [%g7 + PID]
+1: retl
+ nop
+END(__vfork)
+
+weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
index 73eaa695e..169f6e784 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
@@ -1 +1,93 @@
-#include "sparc32/pthread_barrier_wait.c"
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <sysdep.h>
+#include <lowlevellock.h>
+#include <pthreadP.h>
+
+/* Wait on barrier. */
+int
+pthread_barrier_wait (
+ pthread_barrier_t *barrier)
+{
+ union sparc_pthread_barrier *ibarrier
+ = (union sparc_pthread_barrier *) barrier;
+ int result = 0;
+ int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
+
+ /* Make sure we are alone. */
+ lll_lock (ibarrier->b.lock, private);
+
+ /* One more arrival. */
+ --ibarrier->b.left;
+
+ /* Are these all? */
+ if (ibarrier->b.left == 0)
+ {
+ /* Yes. Increment the event counter to avoid invalid wake-ups and
+ tell the current waiters that it is their turn. */
+ ++ibarrier->b.curr_event;
+
+ /* Wake up everybody. */
+ lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
+
+ /* This is the thread which finished the serialization. */
+ result = PTHREAD_BARRIER_SERIAL_THREAD;
+ }
+ else
+ {
+ /* The number of the event we are waiting for. The barrier's event
+ number must be bumped before we continue. */
+ unsigned int event = ibarrier->b.curr_event;
+
+ /* Before suspending, make the barrier available to others. */
+ lll_unlock (ibarrier->b.lock, private);
+
+ /* Wait for the event counter of the barrier to change. */
+ do
+ lll_futex_wait (&ibarrier->b.curr_event, event, private);
+ while (event == ibarrier->b.curr_event);
+ }
+
+ /* Make sure the init_count is stored locally or in a register. */
+ unsigned int init_count = ibarrier->b.init_count;
+
+ /* If this was the last woken thread, unlock. */
+ if (__atomic_is_v9 || ibarrier->s.pshared == 0)
+ {
+ if (atomic_increment_val (&ibarrier->b.left) == init_count)
+ /* We are done. */
+ lll_unlock (ibarrier->b.lock, private);
+ }
+ else
+ {
+ unsigned int left;
+ /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
+ is only atomic for threads within the same process, not for
+ multiple processes. */
+ __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
+ left = ++ibarrier->b.left;
+ __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
+ if (left == init_count)
+ /* We are done. */
+ lll_unlock (ibarrier->b.lock, private);
+ }
+
+ return result;
+}
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
index 8da419348..8da419348 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
index 64c9abfc7..64c9abfc7 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
index 36e859ba4..36e859ba4 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
index 5d887ab89..5d887ab89 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
deleted file mode 100644
index a6142aafe..000000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define RESET_PID
-#include <libc/sysdeps/linux/sparc/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
deleted file mode 100644
index 37231a8c3..000000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.