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