summaryrefslogtreecommitdiffstats
path: root/lib/libc/arm
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2013-01-19 04:03:18 +0000
committerandrew <andrew@FreeBSD.org>2013-01-19 04:03:18 +0000
commit109e426da134da0aa0a02bfa0f7bc2c02de562df (patch)
treef8de5634d2814d589fcf95133b4f1b9d6f7fbe35 /lib/libc/arm
parent388178c195ed8f369019ba43899e39da72e35e87 (diff)
downloadFreeBSD-src-109e426da134da0aa0a02bfa0f7bc2c02de562df.zip
FreeBSD-src-109e426da134da0aa0a02bfa0f7bc2c02de562df.tar.gz
Update the syscall calling convention for ARM EABI. We store the syscall
in r7 and use ip to store the old version of r7 as it is not guaranteed to be kept when calling a subroutine. The kernel will preserve the register across system calls.
Diffstat (limited to 'lib/libc/arm')
-rw-r--r--lib/libc/arm/SYS.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h
index 584c151..ed1a045 100644
--- a/lib/libc/arm/SYS.h
+++ b/lib/libc/arm/SYS.h
@@ -39,7 +39,15 @@
#include <sys/syscall.h>
#include <machine/swi.h>
+#ifdef __ARM_EABI__
+#define SYSTRAP(x) \
+ mov ip, r7; \
+ ldr r7, =SYS_ ## x; \
+ swi 0; \
+ mov r7, ip
+#else
#define SYSTRAP(x) swi 0 | SYS_ ## x
+#endif
#define CERROR _C_LABEL(cerror)
#define CURBRK _C_LABEL(curbrk)
OpenPOWER on IntegriCloud