]> gitweb.factorcode.org Git - factor.git/blob - vm/os-linux-arm.cpp
Move vmpp to vm
[factor.git] / vm / os-linux-arm.cpp
1 #include "master.hpp"
2
3 void flush_icache(CELL start, CELL len)
4 {
5         int result;
6
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); */
10
11         /* Assembly swiped from
12         http://lists.arm.linux.org.uk/pipermail/linux-arm/2002-July/003931.html
13         */
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");
23
24         if(result < 0)
25                 critical_error("flush_icache() failed",result);
26 }