Date: Sat, 19 Jan 2013 04:03:19 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245650 - head/lib/libc/arm Message-ID: <201301190403.r0J43JpQ070271@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Sat Jan 19 04:03:18 2013 New Revision: 245650 URL: http://svnweb.freebsd.org/changeset/base/245650 Log: 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. Modified: head/lib/libc/arm/SYS.h Modified: head/lib/libc/arm/SYS.h ============================================================================== --- head/lib/libc/arm/SYS.h Sat Jan 19 03:47:18 2013 (r245649) +++ head/lib/libc/arm/SYS.h Sat Jan 19 04:03:18 2013 (r245650) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301190403.r0J43JpQ070271>