svn commit: r245650 - head/lib/libc/arm

Andrew Turner andrew at FreeBSD.org
Sat Jan 19 04:03:19 UTC 2013


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)


More information about the svn-src-all mailing list