bump copyright date on affected files and version
[AROS.git] / arch / arm-linux / exec / cachecleare.c
blob3bd78e30a91e30418d68402e94da7d13b56967cb
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CacheClearE() - Clear the caches with extended control, ARM Linux-hosted implementation
6 Lang: english
7 */
9 #include <exec/execbase.h>
10 #include <aros/atomic.h>
11 #include <aros/libcall.h>
12 #include <proto/exec.h>
14 #include <aros/debug.h>
16 AROS_LH3(void, CacheClearE,
17 AROS_LHA(APTR, address, A0),
18 AROS_LHA(ULONG, length, D0),
19 AROS_LHA(ULONG, caches, D1),
20 struct ExecBase *, SysBase, 107, Exec)
22 AROS_LIBFUNC_INIT
24 D(bug("CacheClearE(%08x, %08x, %x)\n", address, length, caches));
26 /* Linux supports only instruction cache flush */
27 if (caches & CACRF_ClearI)
29 /* Forbid(). We inline it because we could use real executable jumptable,
30 in this case this function can be called for validating ExecBase
31 itself. */
32 AROS_ATOMIC_INC(SysBase->TDNestCnt);
34 const int syscall = 0xf0002;
35 __asm __volatile (
36 "mov %%r0, %0\n"
37 "mov %%r1, %1\n"
38 "mov %%r7, %2\n"
39 "mov %%r2, #0x0\n"
40 "svc 0x00000000\n"
42 : "r" (address), "r" ((IPTR)address + length), "r" (syscall)
43 : "r0", "r1", "r2", "r7", "memory"
46 /* It's okay to use library base now */
47 Permit();
50 AROS_LIBFUNC_EXIT
51 } /* CacheClearE */