]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/mm/cache-sh7705.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6-omap-h63xx.git] / arch / sh / mm / cache-sh7705.c
index 2808b580d984634ef30a7eb434e8ff52a1387ebc..4896d737692616146f497492b8a399ac1ef7ae3d 100644 (file)
@@ -3,11 +3,11 @@
  *
  * Copyright (C) 1999, 2000  Niibe Yutaka
  * Copyright (C) 2004  Alex Song
- * Copyright (C) 2006  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
+ *
  */
 #include <linux/init.h>
 #include <linux/mman.h>
@@ -32,9 +32,9 @@ static inline void cache_wback_all(void)
 {
        unsigned long ways, waysize, addrstart;
 
-       ways = cpu_data->dcache.ways;
-       waysize = cpu_data->dcache.sets;
-       waysize <<= cpu_data->dcache.entry_shift;
+       ways = current_cpu_data.dcache.ways;
+       waysize = current_cpu_data.dcache.sets;
+       waysize <<= current_cpu_data.dcache.entry_shift;
 
        addrstart = CACHE_OC_ADDRESS_ARRAY;
 
@@ -43,7 +43,7 @@ static inline void cache_wback_all(void)
 
                for (addr = addrstart;
                     addr < addrstart + waysize;
-                    addr += cpu_data->dcache.linesz) {
+                    addr += current_cpu_data.dcache.linesz) {
                        unsigned long data;
                        int v = SH_CACHE_UPDATED | SH_CACHE_VALID;
 
@@ -51,9 +51,10 @@ static inline void cache_wback_all(void)
 
                        if ((data & v) == v)
                                ctrl_outl(data & ~v, addr);
+
                }
 
-               addrstart += cpu_data->dcache.way_incr;
+               addrstart += current_cpu_data.dcache.way_incr;
        } while (--ways);
 }
 
@@ -93,9 +94,9 @@ static void __flush_dcache_page(unsigned long phys)
        local_irq_save(flags);
        jump_to_P2();
 
-       ways = cpu_data->dcache.ways;
-       waysize = cpu_data->dcache.sets;
-       waysize <<= cpu_data->dcache.entry_shift;
+       ways = current_cpu_data.dcache.ways;
+       waysize = current_cpu_data.dcache.sets;
+       waysize <<= current_cpu_data.dcache.entry_shift;
 
        addrstart = CACHE_OC_ADDRESS_ARRAY;
 
@@ -104,7 +105,7 @@ static void __flush_dcache_page(unsigned long phys)
 
                for (addr = addrstart;
                     addr < addrstart + waysize;
-                    addr += cpu_data->dcache.linesz) {
+                    addr += current_cpu_data.dcache.linesz) {
                        unsigned long data;
 
                        data = ctrl_inl(addr) & (0x1ffffC00 | SH_CACHE_VALID);
@@ -114,7 +115,7 @@ static void __flush_dcache_page(unsigned long phys)
                        }
                }
 
-               addrstart += cpu_data->dcache.way_incr;
+               addrstart += current_cpu_data.dcache.way_incr;
        } while (--ways);
 
        back_to_P1();
@@ -127,11 +128,7 @@ static void __flush_dcache_page(unsigned long phys)
  */
 void flush_dcache_page(struct page *page)
 {
-       struct address_space *mapping = page_mapping(page);
-
-       if (mapping && !mapping_mapped(mapping))
-               set_bit(PG_dcache_dirty, &page->flags);
-       else
+       if (test_bit(PG_mapped, &page->flags))
                __flush_dcache_page(PHYSADDR(page_address(page)));
 }