summaryrefslogtreecommitdiffstats
path: root/meta/packages/uclibc/uclibc-0.9.30.1/arm-linuxthreads.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/uclibc/uclibc-0.9.30.1/arm-linuxthreads.patch')
-rw-r--r--meta/packages/uclibc/uclibc-0.9.30.1/arm-linuxthreads.patch218
1 files changed, 218 insertions, 0 deletions
diff --git a/meta/packages/uclibc/uclibc-0.9.30.1/arm-linuxthreads.patch b/meta/packages/uclibc/uclibc-0.9.30.1/arm-linuxthreads.patch
new file mode 100644
index 0000000000..e222668a66
--- /dev/null
+++ b/meta/packages/uclibc/uclibc-0.9.30.1/arm-linuxthreads.patch
@@ -0,0 +1,218 @@
1Index: uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S
2===================================================================
3--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4+++ uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S 2008-08-28 00:22:06.278340855 +0200
5@@ -0,0 +1,78 @@
6+/* Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
7+ This file is part of the GNU C Library.
8+ Contributed by Philip Blundell <philb@gnu.org>.
9+
10+ The GNU C Library is free software; you can redistribute it and/or
11+ modify it under the terms of the GNU Lesser General Public
12+ License as published by the Free Software Foundation; either
13+ version 2.1 of the License, or (at your option) any later version.
14+
15+ The GNU C Library is distributed in the hope that it will be useful,
16+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+ Lesser General Public License for more details.
19+
20+ You should have received a copy of the GNU Lesser General Public
21+ License along with the GNU C Library; if not, write to the Free
22+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23+ 02111-1307 USA. */
24+
25+#include <sysdep-cancel.h>
26+#define _ERRNO_H 1
27+#include <bits/errno.h>
28+#include <kernel-features.h>
29+
30+/* Clone the calling process, but without copying the whole address space.
31+ The calling process is suspended until the new process exits or is
32+ replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
33+ and the process ID of the new process to the old process. */
34+
35+ENTRY (__vfork)
36+
37+#ifdef __NR_vfork
38+
39+#ifdef SHARED
40+ ldr ip, 1f
41+ ldr r0, 2f
42+3: add ip, pc, ip
43+ ldr r0, [ip, r0]
44+#else
45+ ldr r0, 1f
46+#endif
47+ movs r0, r0
48+ bne HIDDEN_JUMPTARGET (__fork)
49+
50+ DO_CALL (vfork, 0)
51+ cmn a1, #4096
52+ RETINSTR(cc, lr)
53+
54+#ifndef __ASSUME_VFORK_SYSCALL
55+ /* Check if vfork syscall is known at all. */
56+ cmn a1, #ENOSYS
57+ bne PLTJMP(C_SYMBOL_NAME(__syscall_error))
58+#endif
59+
60+#endif
61+
62+#ifndef __ASSUME_VFORK_SYSCALL
63+ /* If we don't have vfork, fork is close enough. */
64+ DO_CALL (fork, 0)
65+ cmn a1, #4096
66+ RETINSTR(cc, lr)
67+#elif !defined __NR_vfork
68+# error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined"
69+#endif
70+ b PLTJMP(C_SYMBOL_NAME(__syscall_error))
71+
72+#ifdef SHARED
73+1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8
74+2: .word __libc_pthread_functions(GOTOFF)
75+#else
76+ .weak pthread_create
77+1: .word pthread_create
78+#endif
79+
80+PSEUDO_END (__vfork)
81+libc_hidden_def (__vfork)
82+
83+weak_alias (__vfork, vfork)
84Index: uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
85===================================================================
86--- /dev/null 1970-01-01 00:00:00.000000000 +0000
87+++ uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h 2008-08-28 00:28:04.301636993 +0200
88@@ -0,0 +1,130 @@
89+/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
90+ This file is part of the GNU C Library.
91+ Contributed by Phil Blundell <pb@nexus.co.uk>, 2003.
92+
93+ The GNU C Library is free software; you can redistribute it and/or
94+ modify it under the terms of the GNU Lesser General Public
95+ License as published by the Free Software Foundation; either
96+ version 2.1 of the License, or (at your option) any later version.
97+
98+ The GNU C Library is distributed in the hope that it will be useful,
99+ but WITHOUT ANY WARRANTY; without even the implied warranty of
100+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
101+ Lesser General Public License for more details.
102+
103+ You should have received a copy of the GNU Lesser General Public
104+ License along with the GNU C Library; if not, write to the Free
105+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
106+ 02111-1307 USA. */
107+
108+#include <tls.h>
109+#include <pt-machine.h>
110+#ifndef __ASSEMBLER__
111+# include <linuxthreads/internals.h>
112+#endif
113+
114+#if !defined NOT_IN_libc || defined IS_IN_libpthread
115+
116+/* We push lr onto the stack, so we have to use ldmib instead of ldmia
117+ to find the saved arguments. */
118+# ifdef PIC
119+# undef DOARGS_5
120+# undef DOARGS_6
121+# undef DOARGS_7
122+# define DOARGS_5 str r4, [sp, $-4]!; ldr r4, [sp, $8];
123+# define DOARGS_6 mov ip, sp; stmfd sp!, {r4, r5}; ldmib ip, {r4, r5};
124+# define DOARGS_7 mov ip, sp; stmfd sp!, {r4, r5, r6}; ldmib ip, {r4, r5, r6};
125+# endif
126+
127+# undef PSEUDO_RET
128+# define PSEUDO_RET \
129+ ldrcc pc, [sp], $4; \
130+ ldr lr, [sp], $4; \
131+ b PLTJMP(SYSCALL_ERROR)
132+
133+# undef PSEUDO
134+# define PSEUDO(name, syscall_name, args) \
135+ .section ".text"; \
136+ PSEUDO_PROLOGUE; \
137+ ENTRY (name); \
138+ SINGLE_THREAD_P; \
139+ bne .Lpseudo_cancel; \
140+ DO_CALL (syscall_name, args); \
141+ cmn r0, $4096; \
142+ RETINSTR(cc, lr); \
143+ b PLTJMP(SYSCALL_ERROR); \
144+ .Lpseudo_cancel: \
145+ str lr, [sp, $-4]!; \
146+ DOCARGS_##args; /* save syscall args around CENABLE. */ \
147+ CENABLE; \
148+ mov ip, r0; /* put mask in safe place. */ \
149+ UNDOCARGS_##args; /* restore syscall args. */ \
150+ swi SYS_ify (syscall_name); /* do the call. */ \
151+ str r0, [sp, $-4]!; /* save syscall return value. */ \
152+ mov r0, ip; /* get mask back. */ \
153+ CDISABLE; \
154+ ldr r0, [sp], $4; /* retrieve return value. */ \
155+ UNDOC2ARGS_##args; /* fix register damage. */ \
156+ cmn r0, $4096;
157+
158+# define DOCARGS_0
159+# define UNDOCARGS_0
160+# define UNDOC2ARGS_0
161+
162+# define DOCARGS_1 str r0, [sp, #-4]!;
163+# define UNDOCARGS_1 ldr r0, [sp], #4;
164+# define UNDOC2ARGS_1
165+
166+# define DOCARGS_2 str r1, [sp, #-4]!; str r0, [sp, #-4]!;
167+# define UNDOCARGS_2 ldr r0, [sp], #4; ldr r1, [sp], #4;
168+# define UNDOC2ARGS_2
169+
170+# define DOCARGS_3 str r2, [sp, #-4]!; str r1, [sp, #-4]!; str r0, [sp, #-4]!;
171+# define UNDOCARGS_3 ldr r0, [sp], #4; ldr r1, [sp], #4; ldr r2, [sp], #4
172+# define UNDOC2ARGS_3
173+
174+# define DOCARGS_4 stmfd sp!, {r0-r3}
175+# define UNDOCARGS_4 ldmfd sp!, {r0-r3}
176+# define UNDOC2ARGS_4
177+
178+# define DOCARGS_5 stmfd sp!, {r0-r3}
179+# define UNDOCARGS_5 ldmfd sp, {r0-r3}; str r4, [sp, #-4]!; ldr r4, [sp, #24]
180+# define UNDOC2ARGS_5 ldr r4, [sp], #20
181+
182+# ifdef IS_IN_libpthread
183+# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
184+# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)
185+# define __local_multiple_threads __pthread_multiple_threads
186+# else
187+# define CENABLE bl PLTJMP(__libc_enable_asynccancel)
188+# define CDISABLE bl PLTJMP(__libc_disable_asynccancel)
189+# define __local_multiple_threads __libc_multiple_threads
190+# endif
191+
192+# ifndef __ASSEMBLER__
193+extern int __local_multiple_threads attribute_hidden;
194+# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
195+# else
196+# if !defined PIC
197+# define SINGLE_THREAD_P \
198+ ldr ip, =__local_multiple_threads; \
199+ ldr ip, [ip]; \
200+ teq ip, #0;
201+# define PSEUDO_PROLOGUE
202+# else
203+# define SINGLE_THREAD_P \
204+ ldr ip, 1b; \
205+2: \
206+ ldr ip, [pc, ip]; \
207+ teq ip, #0;
208+# define PSEUDO_PROLOGUE \
209+ 1: .word __local_multiple_threads - 2f - 8;
210+# endif
211+# endif
212+
213+#elif !defined __ASSEMBLER__
214+
215+/* This code should never be used but we define it anyhow. */
216+# define SINGLE_THREAD_P (1)
217+
218+#endif