aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h')
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
index 5f3709f742..38e472d2ba 100644
--- a/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
+++ b/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
@@ -27,6 +27,7 @@
# undef PSEUDO_RET
# define PSEUDO_RET \
ldrcc pc, [sp], $4; \
+ ldr lr, [sp], $4; \
b PLTJMP(SYSCALL_ERROR)
# undef PSEUDO
@@ -34,7 +35,7 @@
.section ".text"; \
PSEUDO_PROLOGUE; \
ENTRY (name) \
- SINGLE_THREAD_P; \
+ SINGLE_THREAD_P_INT; \
bne .Lpseudo_cancel; \
DO_CALL (syscall_name, args); \
cmn r0, $4096; \
@@ -74,7 +75,7 @@
# define UNDOC2ARGS_4
# define DOCARGS_5 stmfd sp!, {r0-r3}
-# define UNDOCARGS_5 str r4, [sp, #-4]!; ldmfd sp, {r0-r4}
+# define UNDOCARGS_5 ldmfd sp, {r0-r3}; str r4, [sp, #-4]!; ldr r4, [sp, #24]
# define UNDOC2ARGS_5 ldr r4, [sp], #20
# ifdef IS_IN_libpthread
@@ -92,10 +93,11 @@ extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
# else
# if !defined PIC
-# define SINGLE_THREAD_P \
+# define SINGLE_THREAD_P_INT \
ldr ip, =__local_multiple_threads; \
ldr ip, [ip]; \
teq ip, #0;
+# define SINGLE_THREAD_P SINGLE_THREAD_P_INT
# define MAYBE_SAVE_LR \
str lr, [sp, $-4]!;
# define PSEUDO_RET_MOV \
@@ -103,14 +105,19 @@ extern int __local_multiple_threads attribute_hidden;
b PLTJMP(SYSCALL_ERROR)
# define PSEUDO_PROLOGUE
# else
-# define SINGLE_THREAD_P \
- str lr, [sp, $-4]!; \
+# define SINGLE_THREAD_P_PIC(reg) \
ldr ip, 1b; \
- ldr lr, 2b; \
+ ldr reg, 2b; \
3: \
add ip, pc, ip; \
ldr ip, [ip, lr]; \
teq ip, #0;
+# define SINGLE_THREAD_P_INT \
+ str lr, [sp, $-4]!; \
+ SINGLE_THREAD_P_PIC(lr)
+# define SINGLE_THREAD_P \
+ SINGLE_THREAD_P_INT; \
+ ldr lr, [sp], $4
# define PSEUDO_PROLOGUE \
1: .word _GLOBAL_OFFSET_TABLE_ - 3f - 8; \
2: .word __local_multiple_threads(GOTOFF);