15 #include <linux/kernel.h>
17 #include <linux/module.h>
20 #include <linux/sched.h>
22 #include <asm/cache.h>
23 #include <asm/cacheflush.h>
24 #include <asm/tlbflush.h>
26 #include <asm/pgalloc.h>
27 #include <asm/processor.h>
28 #include <asm/sections.h>
29 #include <asm/shmparam.h>
82 flush_kernel_dcache_page(page);
84 }
else if (parisc_requires_coherency())
85 flush_kernel_dcache_page(page);
97 seq_printf(m,
"D-cache\t\t: %ld KB (%s%s, %s)\n",
100 (
cache_info.dc_conf.cc_sh ?
", shared I/D":
""),
101 ((
cache_info.dc_loop == 1) ?
"direct mapped" : buf));
102 seq_printf(m,
"ITLB entries\t: %ld\n" "DTLB entries\t: %ld%s\n",
105 cache_info.dt_conf.tc_sh ?
" - shared with ITLB":
""
110 if (btlb_info.max_size==0) {
114 "BTLB fixed\t: max. %d pages, pagesize=%d (%dMB)\n"
115 "BTLB fix-entr.\t: %d instruction, %d data (%d combined)\n"
116 "BTLB var-entr.\t: %d instruction, %d data (%d combined)\n",
117 btlb_info.max_size, (
int)4096,
118 btlb_info.max_size>>8,
119 btlb_info.fixed_range_info.num_i,
120 btlb_info.fixed_range_info.num_d,
121 btlb_info.fixed_range_info.num_comb,
122 btlb_info.variable_range_info.num_i,
123 btlb_info.variable_range_info.num_d,
124 btlb_info.variable_range_info.num_comb
134 panic(
"parisc_cache_init: pdc_cache_info failed");
137 printk(
"ic_size %lx dc_size %lx it_size %lx\n",
142 printk(
"DC base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
148 printk(
"dc_conf = 0x%lx alias %d blk %d line %d shift %d\n",
154 printk(
" wt %d sh %d cst %d hv %d\n",
160 printk(
"IC base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
166 printk(
"ic_conf = 0x%lx alias %d blk %d line %d shift %d\n",
172 printk(
" wt %d sh %d cst %d hv %d\n",
178 printk(
"D-TLB conf: sh %d page %d cst %d aid %d pad1 %d\n",
185 printk(
"I-TLB conf: sh %d page %d cst %d aid %d pad1 %d\n",
197 "Will flush I/D separately (could be optimized).\n");
208 #define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift))
215 memset(&btlb_info, 0,
sizeof btlb_info);
223 panic(
"SMP kernel required to avoid non-equivalent aliasing");
231 unsigned long space_bits;
261 panic(
"pdc_spaceid_bits call failed.\n");
263 panic(
"SpaceID hashing is still on!\n");
267 __flush_cache_page(
struct vm_area_struct *vma,
unsigned long vmaddr,
268 unsigned long physaddr)
280 unsigned long addr, old_addr = 0;
283 if (mapping && !mapping_mapped(mapping)) {
288 flush_kernel_dcache_page(page);
301 vma_interval_tree_foreach(mpnt, &mapping->
i_mmap, pgoff, pgoff) {
315 if (old_addr == 0 || (old_addr & (
SHMLBA - 1)) != (addr & (
SHMLBA - 1))) {
318 printk(
KERN_ERR "INEQUIVALENT ALIASES 0x%lx and 0x%lx in file %s\n", old_addr, addr, mpnt->
vm_file ? (
char *)mpnt->
vm_file->f_path.dentry->d_name.name :
"(null)");
336 extern void __clear_user_page_asm(
void *page,
unsigned long vaddr);
339 __clear_user_page_asm(page, vaddr);
343 #define FLUSH_THRESHOLD 0x80000
348 unsigned long rangetime, alltime;
353 alltime =
mfctl(16) - alltime;
356 rangetime =
mfctl(16);
358 rangetime =
mfctl(16) - rangetime;
360 printk(
KERN_DEBUG "Whole cache flush %lu cycles, flushing %lu bytes %lu cycles\n",
361 alltime, size, rangetime);
364 parisc_cache_flush_threshold = size * alltime / rangetime;
367 if (!parisc_cache_flush_threshold)
370 if (parisc_cache_flush_threshold >
cache_info.dc_size)
371 parisc_cache_flush_threshold =
cache_info.dc_size;
407 if (!parisc_requires_coherency())
414 void kunmap_parisc(
void *
addr)
416 if (parisc_requires_coherency())
425 unsigned long npages;
451 static void cacheflush_h_tmp_function(
void *
dummy)
473 if ((end - start) < parisc_cache_flush_threshold)
482 if ((end - start) < parisc_cache_flush_threshold)
490 unsigned long start,
unsigned long end)
497 if (vma->
vm_mm->context == sr3) {