diff options
Diffstat (limited to 'arch/nios2/mm/cacheflush.c')
-rw-r--r-- | arch/nios2/mm/cacheflush.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/arch/nios2/mm/cacheflush.c b/arch/nios2/mm/cacheflush.c index 223cdcc8203f..87bf88ed04c6 100644 --- a/arch/nios2/mm/cacheflush.c +++ b/arch/nios2/mm/cacheflush.c | |||
@@ -23,22 +23,6 @@ static void __flush_dcache(unsigned long start, unsigned long end) | |||
23 | end += (cpuinfo.dcache_line_size - 1); | 23 | end += (cpuinfo.dcache_line_size - 1); |
24 | end &= ~(cpuinfo.dcache_line_size - 1); | 24 | end &= ~(cpuinfo.dcache_line_size - 1); |
25 | 25 | ||
26 | for (addr = start; addr < end; addr += cpuinfo.dcache_line_size) { | ||
27 | __asm__ __volatile__ (" flushda 0(%0)\n" | ||
28 | : /* Outputs */ | ||
29 | : /* Inputs */ "r"(addr) | ||
30 | /* : No clobber */); | ||
31 | } | ||
32 | } | ||
33 | |||
34 | static void __flush_dcache_all(unsigned long start, unsigned long end) | ||
35 | { | ||
36 | unsigned long addr; | ||
37 | |||
38 | start &= ~(cpuinfo.dcache_line_size - 1); | ||
39 | end += (cpuinfo.dcache_line_size - 1); | ||
40 | end &= ~(cpuinfo.dcache_line_size - 1); | ||
41 | |||
42 | if (end > start + cpuinfo.dcache_size) | 26 | if (end > start + cpuinfo.dcache_size) |
43 | end = start + cpuinfo.dcache_size; | 27 | end = start + cpuinfo.dcache_size; |
44 | 28 | ||
@@ -112,7 +96,7 @@ static void flush_aliases(struct address_space *mapping, struct page *page) | |||
112 | 96 | ||
113 | void flush_cache_all(void) | 97 | void flush_cache_all(void) |
114 | { | 98 | { |
115 | __flush_dcache_all(0, cpuinfo.dcache_size); | 99 | __flush_dcache(0, cpuinfo.dcache_size); |
116 | __flush_icache(0, cpuinfo.icache_size); | 100 | __flush_icache(0, cpuinfo.icache_size); |
117 | } | 101 | } |
118 | 102 | ||
@@ -182,7 +166,7 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page) | |||
182 | */ | 166 | */ |
183 | unsigned long start = (unsigned long)page_address(page); | 167 | unsigned long start = (unsigned long)page_address(page); |
184 | 168 | ||
185 | __flush_dcache_all(start, start + PAGE_SIZE); | 169 | __flush_dcache(start, start + PAGE_SIZE); |
186 | } | 170 | } |
187 | 171 | ||
188 | void flush_dcache_page(struct page *page) | 172 | void flush_dcache_page(struct page *page) |
@@ -268,7 +252,7 @@ void copy_from_user_page(struct vm_area_struct *vma, struct page *page, | |||
268 | { | 252 | { |
269 | flush_cache_page(vma, user_vaddr, page_to_pfn(page)); | 253 | flush_cache_page(vma, user_vaddr, page_to_pfn(page)); |
270 | memcpy(dst, src, len); | 254 | memcpy(dst, src, len); |
271 | __flush_dcache_all((unsigned long)src, (unsigned long)src + len); | 255 | __flush_dcache((unsigned long)src, (unsigned long)src + len); |
272 | if (vma->vm_flags & VM_EXEC) | 256 | if (vma->vm_flags & VM_EXEC) |
273 | __flush_icache((unsigned long)src, (unsigned long)src + len); | 257 | __flush_icache((unsigned long)src, (unsigned long)src + len); |
274 | } | 258 | } |
@@ -279,7 +263,7 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page, | |||
279 | { | 263 | { |
280 | flush_cache_page(vma, user_vaddr, page_to_pfn(page)); | 264 | flush_cache_page(vma, user_vaddr, page_to_pfn(page)); |
281 | memcpy(dst, src, len); | 265 | memcpy(dst, src, len); |
282 | __flush_dcache_all((unsigned long)dst, (unsigned long)dst + len); | 266 | __flush_dcache((unsigned long)dst, (unsigned long)dst + len); |
283 | if (vma->vm_flags & VM_EXEC) | 267 | if (vma->vm_flags & VM_EXEC) |
284 | __flush_icache((unsigned long)dst, (unsigned long)dst + len); | 268 | __flush_icache((unsigned long)dst, (unsigned long)dst + len); |
285 | } | 269 | } |