This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[patch] libffi EABI sys_cacheflush
- From: Steven Newbury <s_j_newbury at yahoo dot co dot uk>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 3 Aug 2007 16:31:26 +0100 (BST)
- Subject: [patch] libffi EABI sys_cacheflush
The existing code in FFI_INIT_TRAMPOLINE calls sys_cacheflush using only the
OABI syscall interface ie. the syscall number is encoded in the swi
instruction.
This patch passes the syscall number in r7 and calls "swi 0" as is needed by
the EABI Linux syscall ABI.
2007-08-03 Steven Newbury <s_j_newbury@yahoo.co.uk>
* src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use EABI syscall ABI for
sys_cacheflush.
Steve
___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ --- libffi/src/arm/ffi.c.orig 2007-08-03 14:26:32.310000000 +0100
+++ libffi/src/arm/ffi.c 2007-08-03 14:27:24.350000000 +0100
@@ -260,9 +260,16 @@
register unsigned long _beg __asm ("a1") = (unsigned long) (&__tramp[0]); \
register unsigned long _end __asm ("a2") = (unsigned long) (&__tramp[19]); \
register unsigned long _flg __asm ("a3") = 0; \
+#ifdef __ARM_EABI__
+ register unsigned long _scno __asm ("r7") = 0xf0002; \
+ __asm __volatile ("swi 0x0 @ sys_cacheflush" \
+ : "=r" (_beg) \
+ : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno)); \
+#else
__asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \
: "=r" (_beg) \
: "0" (_beg), "r" (_end), "r" (_flg)); \
+#endif
})