Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / arch / sh / mm / cache-sh2.c
blob6614033f6be93133a419f262d9091536cc05492e
1 /*
2 * arch/sh/mm/cache-sh2.c
4 * Copyright (C) 2002 Paul Mundt
6 * Released under the terms of the GNU GPL v2.0.
7 */
9 #include <linux/init.h>
10 #include <linux/mm.h>
12 #include <asm/cache.h>
13 #include <asm/addrspace.h>
14 #include <asm/processor.h>
15 #include <asm/cacheflush.h>
16 #include <asm/io.h>
18 void __flush_wback_region(void *start, int size)
20 unsigned long v;
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)
34 unsigned long v;
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)
47 unsigned long v;
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);