summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/bits/syscalls.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-07-14 15:52:27 +0000
committerJoseph Myers <joseph@codesourcery.com>2009-07-14 15:52:27 +0000
commit7c3eebd556a30bb14dc7afba01de9803b40a3da0 (patch)
tree358af30947c43d78437654d226879c1c6cc6fe42 /libc/sysdeps/linux/arm/bits/syscalls.h
parent9952af00f1cc08a5605d6c57578d09a89adb64f4 (diff)
Fix ARM syscall argument loading.
This patch is a uClibc equivalent of <http://sourceware.org/ml/libc-ports/2008-11/msg00006.html>, to compute all syscall arguments on ARM in temporary variables before loading them into register variables. The principle is as for that glibc patch; the problem I actually observed was a GCC internal compiler error building ld.so for Thumb-2. Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Diffstat (limited to 'libc/sysdeps/linux/arm/bits/syscalls.h')
-rw-r--r--libc/sysdeps/linux/arm/bits/syscalls.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h
index 1a854ffab..4aab048cf 100644
--- a/libc/sysdeps/linux/arm/bits/syscalls.h
+++ b/libc/sysdeps/linux/arm/bits/syscalls.h
@@ -99,32 +99,39 @@
#define LOAD_ARGS_0()
#define ASM_ARGS_0
#define LOAD_ARGS_1(a1) \
- _a1 = (int) (a1); \
- LOAD_ARGS_0 ()
+ int _a1tmp = (int) (a1); \
+ LOAD_ARGS_0 () \
+ _a1 = _a1tmp;
#define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1)
#define LOAD_ARGS_2(a1, a2) \
- register int _a2 __asm__ ("a2") = (int) (a2); \
- LOAD_ARGS_1 (a1)
+ int _a2tmp = (int) (a2); \
+ LOAD_ARGS_1 (a1) \
+ register int _a2 __asm__ ("a2") = _a2tmp;
#define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2)
#define LOAD_ARGS_3(a1, a2, a3) \
- register int _a3 __asm__ ("a3") = (int) (a3); \
- LOAD_ARGS_2 (a1, a2)
+ int _a3tmp = (int) (a3); \
+ LOAD_ARGS_2 (a1, a2) \
+ register int _a3 __asm__ ("a3") = _a3tmp;
#define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3)
#define LOAD_ARGS_4(a1, a2, a3, a4) \
- register int _a4 __asm__ ("a4") = (int) (a4); \
- LOAD_ARGS_3 (a1, a2, a3)
+ int _a4tmp = (int) (a4); \
+ LOAD_ARGS_3 (a1, a2, a3) \
+ register int _a4 __asm__ ("a4") = _a4tmp;
#define ASM_ARGS_4 ASM_ARGS_3, "r" (_a4)
#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
- register int _v1 __asm__ ("v1") = (int) (a5); \
- LOAD_ARGS_4 (a1, a2, a3, a4)
+ int _v1tmp = (int) (a5); \
+ LOAD_ARGS_4 (a1, a2, a3, a4) \
+ register int _v1 __asm__ ("v1") = _v1tmp;
#define ASM_ARGS_5 ASM_ARGS_4, "r" (_v1)
#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
- register int _v2 __asm__ ("v2") = (int) (a6); \
- LOAD_ARGS_5 (a1, a2, a3, a4, a5)
+ int _v2tmp = (int) (a6); \
+ LOAD_ARGS_5 (a1, a2, a3, a4, a5) \
+ register int _v2 __asm__ ("v2") = _v2tmp;
#define ASM_ARGS_6 ASM_ARGS_5, "r" (_v2)
#define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \
- register int _v3 __asm__ ("v3") = (int) (a7); \
- LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6)
+ int _v3tmp = (int) (a7); \
+ LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6) \
+ register int _v3 __asm__ ("v3") = _v3tmp;
#define ASM_ARGS_7 ASM_ARGS_6, "r" (_v3)