From: James S. <jsi...@us...> - 2001-10-30 17:47:03
|
Update of /cvsroot/linux-mips/linux/arch/mips/mm In directory usw-pr-cvs1:/tmp/cvs-serv13623 Modified Files: c-r3k.c Log Message: Optimize R3k cache routines mostly by removing useless code. Index: c-r3k.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/mm/c-r3k.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- c-r3k.c 2001/10/23 17:20:14 1.1 +++ c-r3k.c 2001/10/30 17:46:57 1.2 @@ -235,66 +235,23 @@ r3k_flush_icache_range(KSEG0, KSEG0 + icache_size); } -static void r3k_flush_cache_mm(struct mm_struct *mm) +static inline void r3k___flush_cache_all(void) { - if (mm->context != 0) { + r3k_flush_icache_range(KSEG0, KSEG0 + icache_size); +} -#ifdef DEBUG_CACHE - printk("cmm[%d]", (int)mm->context); -#endif - r3k_flush_cache_all(); - } +static void r3k_flush_cache_mm(struct mm_struct *mm) +{ } static void r3k_flush_cache_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - struct vm_area_struct *vma; - - if (mm->context == 0) - return; - - start &= PAGE_MASK; -#ifdef DEBUG_CACHE - printk("crange[%d,%08lx,%08lx]", (int)mm->context, start, end); -#endif - vma = find_vma(mm, start); - if (!vma) - return; - - if (mm->context != current->active_mm->context) { - flush_cache_all(); - } else { - unsigned long flags, physpage; - - save_and_cli(flags); - while (start < end) { - if ((physpage = get_phys_page(start, mm))) - r3k_flush_icache_range(physpage, - physpage + PAGE_SIZE); - start += PAGE_SIZE; - } - restore_flags(flags); - } } static void r3k_flush_cache_page(struct vm_area_struct *vma, unsigned long page) { - struct mm_struct *mm = vma->vm_mm; - - if (mm->context == 0) - return; - -#ifdef DEBUG_CACHE - printk("cpage[%d,%08lx]", (int)mm->context, page); -#endif - if (vma->vm_flags & VM_EXEC) { - unsigned long physpage; - - if ((physpage = get_phys_page(page, vma->vm_mm))) - r3k_flush_icache_range(physpage, physpage + PAGE_SIZE); - } } static void r3k_flush_page_to_ram(struct page * page) @@ -368,7 +325,7 @@ r3k_probe_cache(); _flush_cache_all = r3k_flush_cache_all; - ___flush_cache_all = r3k_flush_cache_all; + ___flush_cache_all = r3k___flush_cache_all; _flush_cache_mm = r3k_flush_cache_mm; _flush_cache_range = r3k_flush_cache_range; _flush_cache_page = r3k_flush_cache_page; |