summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/bits
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-08-14 13:27:46 +0000
committerMike Frysinger <vapier@gentoo.org>2005-08-14 13:27:46 +0000
commit3e8c046f98134be9c6ddd954141b6b13bf919199 (patch)
treeebb0dd6986b5baa76b7fef83121b5e9ca9a383f8 /libc/sysdeps/linux/arm/bits
parent78b940333901de079d3a0de702441530939ec501 (diff)
import thumb support from jbowler in Bug 385
Diffstat (limited to 'libc/sysdeps/linux/arm/bits')
-rw-r--r--libc/sysdeps/linux/arm/bits/syscalls.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h
index 245266730..21e5b8146 100644
--- a/libc/sysdeps/linux/arm/bits/syscalls.h
+++ b/libc/sysdeps/linux/arm/bits/syscalls.h
@@ -97,6 +97,7 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
#undef INTERNAL_SYSCALL
+#if !defined(__thumb__)
#define INTERNAL_SYSCALL(name, err, nr, args...) \
({ unsigned int _sys_result; \
{ \
@@ -109,6 +110,21 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
_sys_result = _a1; \
} \
(int) _sys_result; })
+#else
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ unsigned int _sys_result; \
+ { \
+ register int _a1 asm ("a1"); \
+ LOAD_ARGS_##nr (args) \
+ register int _r7 asm ("r7") = (int) (SYS_ify(name)); \
+ asm volatile ("swi 0 @ syscall " #name \
+ : "=r" (_a1) \
+ : "r" (_r7) ASM_ARGS_##nr \
+ : "memory"); \
+ _sys_result = _a1; \
+ } \
+ (int) _sys_result; })
+#endif
#undef INTERNAL_SYSCALL_ERROR_P
#define INTERNAL_SYSCALL_ERROR_P(val, err) \