fix validators
[factor/jcg.git] / vm / os-linux-arm.c
blob39a3da0b3f5b77b4996a2c05fefa8ab437b877d0
1 #include "master.h"
3 void flush_icache(CELL start, CELL len)
5 int result;
7 /* XXX: why doesn't this work on Nokia n800? It should behave
8 identically to the below assembly. */
9 /* result = syscall(__ARM_NR_cacheflush,start,start + len,0); */
11 /* Assembly swiped from
12 http://lists.arm.linux.org.uk/pipermail/linux-arm/2002-July/003931.html
14 __asm__ __volatile__ (
15 "mov r0, %1\n"
16 "sub r1, %2, #1\n"
17 "mov r2, #0\n"
18 "swi " __sys1(__ARM_NR_cacheflush) "\n"
19 "mov %0, r0\n"
20 : "=r" (result)
21 : "r" (start), "r" (start + len)
22 : "r0","r1","r2");
24 if(result < 0)
25 critical_error("flush_icache() failed",result);