]> err.no Git - linux-2.6/commitdiff
[ARM] Cleanup arch/arm/mm a little
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 21 Aug 2006 16:06:38 +0000 (17:06 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 20 Sep 2006 13:58:35 +0000 (14:58 +0100)
Move top_pmd into arch/arm/mm/mm.h - nothing outside arch/arm/mm
references it.

Move the repeated definition of TOP_PTE into mm/mm.h, as well as
a few function prototypes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/copypage-v4mc.c
arch/arm/mm/copypage-v6.c
arch/arm/mm/copypage-xscale.c
arch/arm/mm/flush.c
arch/arm/mm/init.c
arch/arm/mm/mm-armv.c
arch/arm/mm/mm.h [new file with mode: 0644]
include/asm-arm/page.h

index fc69dccdace19cdf7ee6d0f3212318698bc88666..df1645e14b4c11401cc11d454934b8de1b1717ee 100644 (file)
@@ -20,6 +20,8 @@
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
+#include "mm.h"
+
 /*
  * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
  * specific hacks for copying pages efficiently.
@@ -27,8 +29,6 @@
 #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
                                  L_PTE_CACHEABLE)
 
-#define TOP_PTE(x)     pte_offset_kernel(top_pmd, x)
-
 static DEFINE_SPINLOCK(minicache_lock);
 
 /*
index 269ce6913ee95958948b6ce142c8a1773206434f..3d0d3a963d20b6f135bd78c1ad2641aa3d313690 100644 (file)
@@ -17,6 +17,8 @@
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
 
+#include "mm.h"
+
 #if SHMLBA > 16384
 #error FIX ME
 #endif
@@ -24,8 +26,6 @@
 #define from_address   (0xffff8000)
 #define to_address     (0xffffc000)
 
-#define TOP_PTE(x)     pte_offset_kernel(top_pmd, x)
-
 static DEFINE_SPINLOCK(v6_lock);
 
 /*
index 42a6ee255ce0a29a2ae4a53a13c655d3ac4bb802..84ebe0aa379e3b4ae3f017fd28d75ce8474a2665 100644 (file)
@@ -20,6 +20,8 @@
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
+#include "mm.h"
+
 /*
  * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
  * specific hacks for copying pages efficiently.
@@ -29,8 +31,6 @@
 #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
                                  L_PTE_CACHEABLE)
 
-#define TOP_PTE(x)     pte_offset_kernel(top_pmd, x)
-
 static DEFINE_SPINLOCK(minicache_lock);
 
 /*
index d438ce41cdd5c5ef76d8b1b6d9507a35bbfb6205..1efb05c64db3554b83e3c1dc8e6f8f2df865a6e1 100644 (file)
 #include <asm/system.h>
 #include <asm/tlbflush.h>
 
+#include "mm.h"
+
 #ifdef CONFIG_CPU_CACHE_VIPT
 
 #define ALIAS_FLUSH_START      0xffff4000
 
-#define TOP_PTE(x)     pte_offset_kernel(top_pmd, x)
-
 static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
 {
        unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);
index fe3f7f6250085c5c279306ba979cde87407d19d8..1099af6d470ad619be8aa5eeecd64a11705c0282 100644 (file)
@@ -25,6 +25,8 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
+#include "mm.h"
+
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
@@ -44,6 +46,11 @@ static struct meminfo meminfo __initdata = { 0, };
  */
 struct page *empty_zero_page;
 
+/*
+ * The pmd table for the upper-most set of pages.
+ */
+pmd_t *top_pmd;
+
 void show_mem(void)
 {
        int free = 0, total = 0, reserved = 0;
@@ -83,16 +90,6 @@ void show_mem(void)
        printk("%d pages swap cached\n", cached);
 }
 
-static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
-{
-       return pmd_offset(pgd, virt);
-}
-
-static inline pmd_t *pmd_off_k(unsigned long virt)
-{
-       return pmd_off(pgd_offset_k(virt), virt);
-}
-
 #define for_each_nodebank(iter,mi,no)                  \
        for (iter = 0; iter < mi->nr_banks; iter++)     \
                if (mi->bank[iter].node == no)
@@ -229,9 +226,6 @@ static __init void reserve_node_zero(pg_data_t *pgdat)
                reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size);
 }
 
-void __init build_mem_type_table(void);
-void __init create_mapping(struct map_desc *md);
-
 static unsigned long __init
 bootmem_init_node(int node, int initrd_node, struct meminfo *mi)
 {
index 38769f5862bc4f0d414287bfdec754fdd431d2c7..ee9647823fadf2d2ed0a364ea4bb47a0fb248448 100644 (file)
@@ -23,6 +23,8 @@
 
 #include <asm/mach/map.h>
 
+#include "mm.h"
+
 #define CPOLICY_UNCACHED       0
 #define CPOLICY_BUFFERED       1
 #define CPOLICY_WRITETHROUGH   2
@@ -35,8 +37,6 @@ pgprot_t pgprot_kernel;
 
 EXPORT_SYMBOL(pgprot_kernel);
 
-pmd_t *top_pmd;
-
 struct cachepolicy {
        const char      policy[16];
        unsigned int    cr_mask;
@@ -142,16 +142,6 @@ __setup("noalign", noalign_setup);
 
 #define FIRST_KERNEL_PGD_NR    (FIRST_USER_PGD_NR + USER_PTRS_PER_PGD)
 
-static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
-{
-       return pmd_offset(pgd, virt);
-}
-
-static inline pmd_t *pmd_off_k(unsigned long virt)
-{
-       return pmd_off(pgd_offset_k(virt), virt);
-}
-
 /*
  * need to get a 16k page for level 1
  */
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
new file mode 100644 (file)
index 0000000..8d73ffb
--- /dev/null
@@ -0,0 +1,19 @@
+/* the upper-most page table pointer */
+extern pmd_t *top_pmd;
+
+#define TOP_PTE(x)     pte_offset_kernel(top_pmd, x)
+
+static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
+{
+       return pmd_offset(pgd, virt);
+}
+
+static inline pmd_t *pmd_off_k(unsigned long virt)
+{
+       return pmd_off(pgd_offset_k(virt), virt);
+}
+
+struct map_desc;
+
+void __init build_mem_type_table(void);
+void __init create_mapping(struct map_desc *md);
index b721270b9986c15d6dca566ec4d0dc65b6cb2e9d..af9c3fe7588c4c1b3b0808ae59637fecac6a397c 100644 (file)
@@ -174,9 +174,6 @@ typedef unsigned long pgprot_t;
 
 #endif /* STRICT_MM_TYPECHECKS */
 
-/* the upper-most page table pointer */
-extern pmd_t *top_pmd;
-
 #endif /* CONFIG_MMU */
 
 #include <asm/memory.h>