2 * Copyright 2003-2007, Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * François Revol <revol@free.fr>
9 #include <KernelExport.h>
11 #include <arch_platform.h>
12 #include <arch_thread.h>
14 #include <boot/kernel_args.h>
20 /* from arch_030_asm.S */
21 extern void flush_insn_pipeline_030(void);
22 extern void flush_atc_all_030(void);
23 extern void flush_atc_addr_030(addr_t addr
);
34 sync_icache_030(addr_t address
, size_t len
)
40 off
= (unsigned int)address
& (CACHELINE
- 1);
44 p
= (char *)address
- off
;
46 asm volatile ("movec %%cacr,%0" : "=r"(cacr
):);
47 cacr
|= 0x00000004; /* ClearInstructionCacheEntry */
49 /* the 030 invalidates only 1 long of the cache line */
50 //XXX: what about 040 and 060 ?
51 asm volatile ("movec %0,%%caar\n" \
62 :: "r"(p
), "r"(cacr
));
64 } while ((l
-= CACHELINE
) > 0);
69 struct m68k_cpu_ops cpu_ops_030
= {
70 &flush_insn_pipeline_030
,
72 &flush_atc_all_030
, // no global flag, so no useronly flushing
74 &sync_icache_030
, // dcache is the same