2 * arch/sh/mm/cache-sh2.c
4 * Copyright (C) 2002 Paul Mundt
6 * Released under the terms of the GNU GPL v2.0.
9 #include <linux/init.h>
12 #include <asm/cache.h>
13 #include <asm/addrspace.h>
14 #include <asm/processor.h>
15 #include <asm/cacheflush.h>
18 void __flush_wback_region(void *start, int size)
21 unsigned long begin, end;
23 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
24 end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
25 & ~(L1_CACHE_BYTES-1);
26 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
27 /* FIXME cache purge */
28 ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
32 void __flush_purge_region(void *start, int size)
35 unsigned long begin, end;
37 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
38 end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
39 & ~(L1_CACHE_BYTES-1);
40 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
41 ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
45 void __flush_invalidate_region(void *start, int size)
48 unsigned long begin, end;
50 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
51 end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
52 & ~(L1_CACHE_BYTES-1);
53 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
54 ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);