]> err.no Git - linux-2.6/blobdiff - arch/mips/mm/sc-mips.c
x86: printk kernel version in WARN_ON and other dump_stack users
[linux-2.6] / arch / mips / mm / sc-mips.c
index d3f92a9e831056832e4854bcf911c3e018db1080..c13170bc675c6f3483221ced2a7d34a28d0081bf 100644 (file)
  */
 static void mips_sc_wback_inv(unsigned long addr, unsigned long size)
 {
-       unsigned long sc_lsize = cpu_scache_line_size();
-       unsigned long end, a;
-
-       pr_debug("mips_sc_wback_inv[%08lx,%08lx]", addr, size);
-
-       /* Catch bad driver code */
-       BUG_ON(size == 0);
-
-       a = addr & ~(sc_lsize - 1);
-       end = (addr + size - 1) & ~(sc_lsize - 1);
-       while (1) {
-               flush_scache_line(a);           /* Hit_Writeback_Inv_SD */
-               if (a == end)
-                       break;
-               a += sc_lsize;
-       }
+       blast_scache_range(addr, addr + size);
 }
 
 /*
@@ -47,22 +32,7 @@ static void mips_sc_wback_inv(unsigned long addr, unsigned long size)
  */
 static void mips_sc_inv(unsigned long addr, unsigned long size)
 {
-       unsigned long sc_lsize = cpu_scache_line_size();
-       unsigned long end, a;
-
-       pr_debug("mips_sc_inv[%08lx,%08lx]", addr, size);
-
-       /* Catch bad driver code */
-       BUG_ON(size == 0);
-
-       a = addr & ~(sc_lsize - 1);
-       end = (addr + size - 1) & ~(sc_lsize - 1);
-       while (1) {
-               invalidate_scache_line(a);      /* Hit_Invalidate_SD */
-               if (a == end)
-                       break;
-               a += sc_lsize;
-       }
+       blast_inv_scache_range(addr, addr + size);
 }
 
 static void mips_sc_enable(void)
@@ -123,6 +93,7 @@ static inline int __init mips_sc_probe(void)
                return 0;
 
        c->scache.waysize = c->scache.sets * c->scache.linesz;
+       c->scache.waybit = __ffs(c->scache.waysize);
 
        c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
 
@@ -131,7 +102,7 @@ static inline int __init mips_sc_probe(void)
 
 int __init mips_sc_init(void)
 {
-       int found = mips_sc_probe ();
+       int found = mips_sc_probe();
        if (found) {
                mips_sc_enable();
                bcops = &mips_sc_ops;