Factor was using the following code to flush the instruction cache:
syscall(__ARM_NR_cacheflush,start,start + len,0);
Now I wasn't checking the return value of this... silly me. After adding a check for the return value, Chris's tablet was returning "operation not permitted" from the above call.
After some Googling, I came across a post on the Parrot mailing list. Here, they were flushing the instruction cache by calling the system call directly, without using the
syscallwrapper. I asked Chris to try their code, and it worked. Here it is:
__asm__ __volatile__ (
"mov r0, %1\n"
"sub r1, %2, #1\n"
"mov r2, #0\n"
"swi " __sys1(__ARM_NR_cacheflush) "\n"
"mov %0, r0\n"
: "=r" (result)
: "r" (start), "r" (start + len)
Now, I'm pretty confused by this. In theory, the
syscallfunction should do the same thing as the above. So either the
syscallfunction in the version of libc shipped by Nokia is broken, or I'm stupid and missing something obvious.
Either way, it appears that Factor works on the n800 now.