]> gitweb.factorcode.org Git - factor.git/blob - vm/os-linux-arm.cpp
Merge branch 'master' of git://factorcode.org/git/factor into s3
[factor.git] / vm / os-linux-arm.cpp
1 #include "master.hpp"
2
3 namespace factor
4 {
5
6 void flush_icache(cell start, cell len)
7 {
8         int result;
9
10         /* XXX: why doesn't this work on Nokia n800? It should behave
11         identically to the below assembly. */
12         /* result = syscall(__ARM_NR_cacheflush,start,start + len,0); */
13
14         /* Assembly swiped from
15         http://lists.arm.linux.org.uk/pipermail/linux-arm/2002-July/003931.html
16         */
17         __asm__ __volatile__ (
18                 "mov     r0, %1\n"
19                 "sub     r1, %2, #1\n"
20                 "mov     r2, #0\n"
21                 "swi     " __sys1(__ARM_NR_cacheflush) "\n"
22                 "mov     %0, r0\n"
23                 : "=r" (result)
24                 : "r" (start), "r" (start + len)
25                 : "r0","r1","r2");
26
27         if(result < 0)
28                 critical_error("flush_icache() failed",result);
29 }
30
31 }