aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2005-11-16 19:03:42 +0000
committerDaniel Jacobowitz <dan@codesourcery.com>2005-11-16 19:03:42 +0000
commit02a9f771e32e1fd39f5338ad111e3adad804b6a2 (patch)
treed53d1cda6d591fa9b08f2d2a578d86c66370b6e8
parentde96d1483f365654270a4291e11ed257a2687322 (diff)
downloadglibc-02a9f771e32e1fd39f5338ad111e3adad804b6a2.tar.xz
glibc-02a9f771e32e1fd39f5338ad111e3adad804b6a2.zip
* sysdeps/arm/bits/setjmp.h, sysdeps/arm/fpu/bits/setjmp.h: Update
include guards. * sysdeps/unix/arm/sysdep.S (syscall_error): Handle USE___THREAD and RTLD_PRIVATE_ERRNO. * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Handle RESET_PID. Handle new arguments. * sysdeps/unix/sysv/linux/arm/vfork.S (__vfork): Use SAVE_PID and RESTORE_PID. Use the right syscall error handler. * sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S (__default_sa_restorer, __default_rt_sa_restorer): Add unwind information. * sysdeps/unix/sysv/linux/arm/eabi/socket.S: Update formatting. Add unwind information. Correct stack alignment typo. * sysdeps/unix/sysv/linux/arm/eabi/sysdep.h (INTERNAL_SYSCALL_NCS): Define. * sysdeps/unix/sysv/linux/arm/sigaction.c (__libc_sigaction): Remove never-valid handling for SA_ONSTACK. * sysdeps/unix/sysv/linux/arm/socket.S: Whitespace cleanup. * sysdeps/unix/sysv/linux/arm/sysdep.h (SYSCALL_ERROR_HANDLER): Handle RTLD_PRIVATE_ERRNO. (INTERNAL_SYSCALL_NCS): Implement. * sysdeps/arm/nptl/Makefile, sysdeps/arm/nptl/jmpbuf-unwind.h, sysdeps/arm/nptl/pthread_spin_lock.S, sysdeps/arm/nptl/pthread_spin_trylock.S, sysdeps/arm/nptl/pthreaddef.h, sysdeps/arm/nptl/tcb-offsets.sym, sysdeps/arm/nptl/tls.h, sysdeps/unix/sysv/linux/arm/eabi/Makefile, sysdeps/unix/sysv/linux/arm/eabi/nptl/Makefile, sysdeps/unix/sysv/linux/arm/eabi/nptl/configure, sysdeps/unix/sysv/linux/arm/eabi/nptl/configure.in, sysdeps/unix/sysv/linux/arm/eabi/nptl/nptl-aeabi_unwind_cpp_pr1.c, sysdeps/unix/sysv/linux/arm/eabi/nptl/rt-aeabi_unwind_cpp_pr1.c, sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h, sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c, sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c, sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h, sysdeps/unix/sysv/linux/arm/nptl/Versions, sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h, sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h, sysdeps/unix/sysv/linux/arm/nptl/clone.S, sysdeps/unix/sysv/linux/arm/nptl/createthread.c, sysdeps/unix/sysv/linux/arm/nptl/fork.c, sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c, sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h, sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S, sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c, sysdeps/unix/sysv/linux/arm/nptl/vfork.S: New files.
-rw-r--r--ChangeLog.arm58
-rw-r--r--sysdeps/arm/bits/setjmp.h9
-rw-r--r--sysdeps/arm/fpu/bits/setjmp.h9
-rw-r--r--sysdeps/arm/nptl/Makefile21
-rw-r--r--sysdeps/arm/nptl/jmpbuf-unwind.h30
-rw-r--r--sysdeps/arm/nptl/pthread_spin_lock.S31
-rw-r--r--sysdeps/arm/nptl/pthread_spin_trylock.S34
-rw-r--r--sysdeps/arm/nptl/pthreaddef.h39
-rw-r--r--sysdeps/arm/nptl/tcb-offsets.sym11
-rw-r--r--sysdeps/arm/nptl/tls.h137
-rw-r--r--sysdeps/unix/arm/sysdep.S35
-rw-r--r--sysdeps/unix/sysv/linux/arm/clone.S56
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/Makefile17
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/configure4
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/configure.in8
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/nptl-aeabi_unwind_cpp_pr1.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/rt-aeabi_unwind_cpp_pr1.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h149
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c113
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c82
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h274
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S21
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/socket.S28
-rw-r--r--sysdeps/unix/sysv/linux/arm/eabi/sysdep.h5
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/Versions6
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h95
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h157
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h38
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/clone.S3
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/createthread.c23
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/fork.c31
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c118
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h268
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S38
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c99
-rw-r--r--sysdeps/unix/sysv/linux/arm/nptl/vfork.S39
-rw-r--r--sysdeps/unix/sysv/linux/arm/sigaction.c15
-rw-r--r--sysdeps/unix/sysv/linux/arm/socket.S16
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.h36
-rw-r--r--sysdeps/unix/sysv/linux/arm/vfork.S14
41 files changed, 2124 insertions, 51 deletions
diff --git a/ChangeLog.arm b/ChangeLog.arm
index 21e15ce897..795b363904 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,5 +1,63 @@
2005-11-16 Daniel Jacobowitz <dan@codesourcery.com>
+ * sysdeps/arm/bits/setjmp.h, sysdeps/arm/fpu/bits/setjmp.h: Update
+ include guards.
+
+ * sysdeps/unix/arm/sysdep.S (syscall_error): Handle USE___THREAD and
+ RTLD_PRIVATE_ERRNO.
+
+ * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Handle RESET_PID.
+ Handle new arguments.
+ * sysdeps/unix/sysv/linux/arm/vfork.S (__vfork): Use SAVE_PID and
+ RESTORE_PID. Use the right syscall error handler.
+
+ * sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+ (__default_sa_restorer, __default_rt_sa_restorer): Add unwind
+ information.
+
+ * sysdeps/unix/sysv/linux/arm/eabi/socket.S: Update formatting.
+ Add unwind information. Correct stack alignment typo.
+
+ * sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
+ (INTERNAL_SYSCALL_NCS): Define.
+
+ * sysdeps/unix/sysv/linux/arm/sigaction.c
+ (__libc_sigaction): Remove never-valid handling for SA_ONSTACK.
+
+ * sysdeps/unix/sysv/linux/arm/socket.S: Whitespace cleanup.
+
+ * sysdeps/unix/sysv/linux/arm/sysdep.h (SYSCALL_ERROR_HANDLER): Handle
+ RTLD_PRIVATE_ERRNO.
+ (INTERNAL_SYSCALL_NCS): Implement.
+
+ * sysdeps/arm/nptl/Makefile, sysdeps/arm/nptl/jmpbuf-unwind.h,
+ sysdeps/arm/nptl/pthread_spin_lock.S,
+ sysdeps/arm/nptl/pthread_spin_trylock.S,
+ sysdeps/arm/nptl/pthreaddef.h, sysdeps/arm/nptl/tcb-offsets.sym,
+ sysdeps/arm/nptl/tls.h, sysdeps/unix/sysv/linux/arm/eabi/Makefile,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/Makefile,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/configure,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/configure.in,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/nptl-aeabi_unwind_cpp_pr1.c,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/rt-aeabi_unwind_cpp_pr1.c,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c,
+ sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind.h,
+ sysdeps/unix/sysv/linux/arm/nptl/Versions,
+ sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h,
+ sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h,
+ sysdeps/unix/sysv/linux/arm/nptl/clone.S,
+ sysdeps/unix/sysv/linux/arm/nptl/createthread.c,
+ sysdeps/unix/sysv/linux/arm/nptl/fork.c,
+ sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c,
+ sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h,
+ sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S,
+ sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c,
+ sysdeps/unix/sysv/linux/arm/nptl/vfork.S: New files.
+
+2005-11-16 Daniel Jacobowitz <dan@codesourcery.com>
+
* sysdeps/arm/dl-machine.h (CLEAR_CACHE): Use INTERNAL_SYSCALL_ARM.
* sysdeps/unix/sysv/linux/arm/brk.c (__brk): Use INLINE_SYSCALL.
* sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use DO_CALL.
diff --git a/sysdeps/arm/bits/setjmp.h b/sysdeps/arm/bits/setjmp.h
index e0a4657b47..9b74906791 100644
--- a/sysdeps/arm/bits/setjmp.h
+++ b/sysdeps/arm/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2005 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
@@ -18,7 +18,10 @@
/* Define the machine-dependent type `jmp_buf'. ARM version. */
-#ifndef _SETJMP_H
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
+
+#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
@@ -34,3 +37,5 @@ typedef int __jmp_buf[10];
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
((void *) (address) < (void *) (jmpbuf[__JMP_BUF_SP]))
+
+#endif
diff --git a/sysdeps/arm/fpu/bits/setjmp.h b/sysdeps/arm/fpu/bits/setjmp.h
index dd85243032..0a19d2c9ab 100644
--- a/sysdeps/arm/fpu/bits/setjmp.h
+++ b/sysdeps/arm/fpu/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2005 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
@@ -18,7 +18,10 @@
/* Define the machine-dependent type `jmp_buf'. ARM version. */
-#ifndef _SETJMP_H
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
+
+#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
@@ -34,3 +37,5 @@ typedef int __jmp_buf[22];
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
((void *) (address) < (void *) (jmpbuf[__JMP_BUF_SP]))
+
+#endif
diff --git a/sysdeps/arm/nptl/Makefile b/sysdeps/arm/nptl/Makefile
new file mode 100644
index 0000000000..0300693783
--- /dev/null
+++ b/sysdeps/arm/nptl/Makefile
@@ -0,0 +1,21 @@
+# Copyright (C) 2005 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, write to the Free
+# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
diff --git a/sysdeps/arm/nptl/jmpbuf-unwind.h b/sysdeps/arm/nptl/jmpbuf-unwind.h
new file mode 100644
index 0000000000..f05e27fd1d
--- /dev/null
+++ b/sysdeps/arm/nptl/jmpbuf-unwind.h
@@ -0,0 +1,30 @@
+/* Copyright (C) 2005 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#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)[__JMP_BUF_SP] - (_adj))
+
+/* We use the normal longjmp for unwinding. */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/sysdeps/arm/nptl/pthread_spin_lock.S b/sysdeps/arm/nptl/pthread_spin_lock.S
new file mode 100644
index 0000000000..bd6adf794a
--- /dev/null
+++ b/sysdeps/arm/nptl/pthread_spin_lock.S
@@ -0,0 +1,31 @@
+/* Copyright (C) 2005 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+
+ .text
+ .align 4
+
+ENTRY (pthread_spin_lock)
+ mov r1, #1
+1: swp r2, r1, [r0]
+ teq r2, #0
+ bne 1b
+ mov r0, #0
+ PSEUDO_RET_NOERRNO
+END (pthread_spin_lock)
diff --git a/sysdeps/arm/nptl/pthread_spin_trylock.S b/sysdeps/arm/nptl/pthread_spin_trylock.S
new file mode 100644
index 0000000000..85931507a7
--- /dev/null
+++ b/sysdeps/arm/nptl/pthread_spin_trylock.S
@@ -0,0 +1,34 @@
+/* Copyright (C) 2005 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+#include <sysdep.h>
+
+ .text
+ .align 4
+
+ENTRY (pthread_spin_trylock)
+ mov r1, #1
+ swp r2, r1, [r0]
+ teq r2, #0
+ moveq r0, #0
+ movne r0, #EBUSY
+ PSEUDO_RET_NOERRNO
+END (pthread_spin_trylock)
diff --git a/sysdeps/arm/nptl/pthreaddef.h b/sysdeps/arm/nptl/pthreaddef.h
new file mode 100644
index 0000000000..783828a400
--- /dev/null
+++ b/sysdeps/arm/nptl/pthreaddef.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2002, 2003, 2005 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Default stack size. */
+#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning. SSE requires 16
+ bytes. */
+#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 __builtin_frame_address (0)
+
+
+/* XXX Until we have a better place keep the definitions here. */
+#define __exit_thread_inline(val) \
+ INLINE_SYSCALL (exit, 1, (val))
diff --git a/sysdeps/arm/nptl/tcb-offsets.sym b/sysdeps/arm/nptl/tcb-offsets.sym
new file mode 100644
index 0000000000..92cc441d3d
--- /dev/null
+++ b/