]> git.hungrycats.org Git - linux/commitdiff
[ARM] Move flush_dcache_page
authorRussell King <rmk@flint.arm.linux.org.uk>
Tue, 7 Sep 2004 15:12:01 +0000 (16:12 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Tue, 7 Sep 2004 15:12:01 +0000 (16:12 +0100)
Move flush_dcache_page into flush.c - it shouldn't be in the middle
of the VIVT mmap alias coherency code.

arch/arm/mm/Makefile
arch/arm/mm/fault-armv.c
arch/arm/mm/flush.c [new file with mode: 0644]

index fc764e17ef42653cae9b1e12b33b26fe1da75e7c..ccf316c11e02523f65b3cd21e3c13fe2afd71e59 100644 (file)
@@ -3,7 +3,8 @@
 #
 
 obj-y                          := consistent.o extable.o fault-armv.o \
-                                  fault.o init.o ioremap.o mmap.o mm-armv.o
+                                  fault.o flush.o init.o ioremap.o mmap.o \
+                                  mm-armv.o
 
 obj-$(CONFIG_MODULES)          += proc-syms.o
 
index b6225a35fea46095130e1a0aa0a89b8759da49bc..e2efe7f3506f0388c0952c73318be0139ebd0304 100644 (file)
@@ -76,52 +76,6 @@ no_pmd:
        return 0;
 }
 
-static void __flush_dcache_page(struct page *page)
-{
-       struct address_space *mapping = page_mapping(page);
-       struct mm_struct *mm = current->active_mm;
-       struct vm_area_struct *mpnt;
-       struct prio_tree_iter iter;
-       unsigned long offset;
-       pgoff_t pgoff;
-
-       __cpuc_flush_dcache_page(page_address(page));
-
-       if (!mapping)
-               return;
-
-       /*
-        * With a VIVT cache, we need to also write back
-        * and invalidate any user data.
-        */
-       pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
-
-       flush_dcache_mmap_lock(mapping);
-       vma_prio_tree_foreach(mpnt, &iter, &mapping->i_mmap, pgoff, pgoff) {
-               /*
-                * If this VMA is not in our MM, we can ignore it.
-                */
-               if (mpnt->vm_mm != mm)
-                       continue;
-               if (!(mpnt->vm_flags & VM_MAYSHARE))
-                       continue;
-               offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
-               flush_cache_page(mpnt, mpnt->vm_start + offset);
-       }
-       flush_dcache_mmap_unlock(mapping);
-}
-
-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
-               __flush_dcache_page(page);
-}
-EXPORT_SYMBOL(flush_dcache_page);
-
 static void
 make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page, int dirty)
 {
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
new file mode 100644 (file)
index 0000000..a087635
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ *  linux/arch/arm/mm/flush.c
+ *
+ *  Copyright (C) 1995-2002 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/module.h>
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+
+#include <asm/cacheflush.h>
+
+static void __flush_dcache_page(struct page *page)
+{
+       struct address_space *mapping = page_mapping(page);
+       struct mm_struct *mm = current->active_mm;
+       struct vm_area_struct *mpnt;
+       struct prio_tree_iter iter;
+       unsigned long offset;
+       pgoff_t pgoff;
+
+       __cpuc_flush_dcache_page(page_address(page));
+
+       if (!mapping)
+               return;
+
+       /*
+        * With a VIVT cache, we need to also write back
+        * and invalidate any user data.
+        */
+       pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
+
+       flush_dcache_mmap_lock(mapping);
+       vma_prio_tree_foreach(mpnt, &iter, &mapping->i_mmap, pgoff, pgoff) {
+               /*
+                * If this VMA is not in our MM, we can ignore it.
+                */
+               if (mpnt->vm_mm != mm)
+                       continue;
+               if (!(mpnt->vm_flags & VM_MAYSHARE))
+                       continue;
+               offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
+               flush_cache_page(mpnt, mpnt->vm_start + offset);
+       }
+       flush_dcache_mmap_unlock(mapping);
+}
+
+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
+               __flush_dcache_page(page);
+}
+EXPORT_SYMBOL(flush_dcache_page);