* src/vm/jit/arm/asmpart.S (asm_cacheflush): Code cleanup and support for EABI
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Thu, 13 Sep 2007 11:06:51 +0000 (13:06 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Thu, 13 Sep 2007 11:06:51 +0000 (13:06 +0200)
syscall calling conventions.

--HG--
branch : michi

src/vm/jit/arm/asmpart.S

index a5154c1db68acfab4b245681f82630ce3f34e21f..d5da48d87c8f1ee8388ad56fb82e9cb36202fd03 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "config.h"
 
+#include <sys/syscall.h>
+
 #include "vm/jit/arm/md-asm.h"
 
 #include "vm/jit/methodheader.h"
@@ -313,24 +315,35 @@ asm_abstractmethoderror:
 *                                                                              *
 *******************************************************************************/
 
-#if 1
-.equ sys_cacheflush, 0x9f0002
+.equ sys_cacheflush,__ARM_NR_cacheflush /* syscall number for cache flushing  */
+
 asm_cacheflush:
        add   a1, a0, a1
        mov   a2, #0
 
+#if defined(__ARM_EABI__)
+       /* According to EABI, the syscall number should be passed via R7,
+          see "http://wiki.debian.org/ArmEabiPort" for additional details. */
+
+       stmfd sp!, {r7}
+       mov   r7, #0x0f0000
+       add   r7, r7, #0x000002
+#endif
+
 #if 0
        /* TWISTI: required on iyonix, maybe a linux-2.4 bug */
-       /* TODO: repeair this! */
-       /* cacheflush is messed up beyond all repair! */
-       mov a0, #0x0
-       mov a1, #0xff000000
+       mov   a0, #0x0
+       mov   a1, #0xff000000
 #endif
 
-       swi   #sys_cacheflush
-       mov   pc, lr
+       swi   sys_cacheflush
+
+#if defined(__ARM_EABI__)
+       ldmfd sp!, {r7}
 #endif
 
+       mov   pc, lr
+
 
 /* disable exec-stacks ********************************************************/