aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/cache.c')
-rw-r--r--arch/parisc/kernel/cache.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index f46a07a79218..a065349aee37 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -27,6 +27,7 @@
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/pgalloc.h> 28#include <asm/pgalloc.h>
29#include <asm/processor.h> 29#include <asm/processor.h>
30#include <asm/sections.h>
30 31
31int split_tlb; 32int split_tlb;
32int dcache_stride; 33int dcache_stride;
@@ -207,6 +208,9 @@ parisc_cache_init(void)
207 208
208 /* "New and Improved" version from Jim Hull 209 /* "New and Improved" version from Jim Hull
209 * (1 << (cc_block-1)) * (cc_line << (4 + cnf.cc_shift)) 210 * (1 << (cc_block-1)) * (cc_line << (4 + cnf.cc_shift))
211 * The following CAFL_STRIDE is an optimized version, see
212 * http://lists.parisc-linux.org/pipermail/parisc-linux/2004-June/023625.html
213 * http://lists.parisc-linux.org/pipermail/parisc-linux/2004-June/023671.html
210 */ 214 */
211#define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift)) 215#define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift))
212 dcache_stride = CAFL_STRIDE(cache_info.dc_conf); 216 dcache_stride = CAFL_STRIDE(cache_info.dc_conf);
@@ -266,7 +270,6 @@ void flush_dcache_page(struct page *page)
266 unsigned long offset; 270 unsigned long offset;
267 unsigned long addr; 271 unsigned long addr;
268 pgoff_t pgoff; 272 pgoff_t pgoff;
269 pte_t *pte;
270 unsigned long pfn = page_to_pfn(page); 273 unsigned long pfn = page_to_pfn(page);
271 274
272 275
@@ -297,21 +300,16 @@ void flush_dcache_page(struct page *page)
297 * taking a page fault if the pte doesn't exist. 300 * taking a page fault if the pte doesn't exist.
298 * This is just for speed. If the page translation 301 * This is just for speed. If the page translation
299 * isn't there, there's no point exciting the 302 * isn't there, there's no point exciting the
300 * nadtlb handler into a nullification frenzy */ 303 * nadtlb handler into a nullification frenzy.
301 304 *
302 305 * Make sure we really have this page: the private
303 if(!(pte = translation_exists(mpnt, addr)))
304 continue;
305
306 /* make sure we really have this page: the private
307 * mappings may cover this area but have COW'd this 306 * mappings may cover this area but have COW'd this
308 * particular page */ 307 * particular page.
309 if(pte_pfn(*pte) != pfn) 308 */
310 continue; 309 if (translation_exists(mpnt, addr, pfn)) {
311 310 __flush_cache_page(mpnt, addr);
312 __flush_cache_page(mpnt, addr); 311 break;
313 312 }
314 break;
315 } 313 }
316 flush_dcache_mmap_unlock(mapping); 314 flush_dcache_mmap_unlock(mapping);
317} 315}
@@ -339,17 +337,15 @@ int parisc_cache_flush_threshold = FLUSH_THRESHOLD;
339void parisc_setup_cache_timing(void) 337void parisc_setup_cache_timing(void)
340{ 338{
341 unsigned long rangetime, alltime; 339 unsigned long rangetime, alltime;
342 extern char _text; /* start of kernel code, defined by linker */
343 extern char _end; /* end of BSS, defined by linker */
344 unsigned long size; 340 unsigned long size;
345 341
346 alltime = mfctl(16); 342 alltime = mfctl(16);
347 flush_data_cache(); 343 flush_data_cache();
348 alltime = mfctl(16) - alltime; 344 alltime = mfctl(16) - alltime;
349 345
350 size = (unsigned long)(&_end - _text); 346 size = (unsigned long)(_end - _text);
351 rangetime = mfctl(16); 347 rangetime = mfctl(16);
352 flush_kernel_dcache_range((unsigned long)&_text, size); 348 flush_kernel_dcache_range((unsigned long)_text, size);
353 rangetime = mfctl(16) - rangetime; 349 rangetime = mfctl(16) - rangetime;
354 350
355 printk(KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n", 351 printk(KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n",