12 #include <asm/cacheflush.h>
13 #include <asm/cachectl.h>
14 #include <asm/processor.h>
15 #include <asm/uaccess.h>
16 #include <asm/syscalls.h>
22 #define CACHEFLUSH_MAX_LEN 1024
26 unsigned long v, begin,
end, linesz,
mask;
34 begin = (
unsigned long)start;
38 flush_dcache_line(start);
42 flush_dcache_line((
void *)end);
47 for (v = begin; v <
end; v += linesz)
48 invalidate_dcache_line((
void *)v);
54 unsigned long v, begin,
end, linesz;
57 begin = (
unsigned long)start & ~(linesz - 1);
58 end = ((
unsigned long)start + size + linesz - 1) & ~(linesz - 1);
60 for (v = begin; v <
end; v += linesz)
61 clean_dcache_line((
void *)
v);
67 unsigned long v, begin,
end, linesz;
70 begin = (
unsigned long)start & ~(linesz - 1);
71 end = ((
unsigned long)start + size + linesz - 1) & ~(linesz - 1);
73 for (v = begin; v <
end; v += linesz)
74 flush_dcache_line((
void *)
v);
80 unsigned long v, begin,
end, linesz;
83 begin = (
unsigned long)start & ~(linesz - 1);
84 end = ((
unsigned long)start + size + linesz - 1) & ~(linesz - 1);
86 for (v = begin; v <
end; v += linesz)
87 invalidate_icache_line((
void *)
v);
90 static inline void __flush_icache_range(
unsigned long start,
unsigned long end)
92 unsigned long v, linesz;
95 for (v = start; v <
end; v += linesz) {
96 clean_dcache_line((
void *)v);
97 invalidate_icache_line((
void *)v);
108 unsigned long linesz;
111 __flush_icache_range(start & ~(linesz - 1),
112 (end + linesz - 1) & ~(linesz - 1));
122 __flush_icache_range((
unsigned long)v, (
unsigned long)v +
PAGE_SIZE);
143 (
unsigned long)addr + len);
161 (
unsigned long)dst + len);