[MIPS] Sparsemem fixes
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Tue, 4 Jul 2006 16:22:44 +0000 (01:22 +0900)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 13 Jul 2006 20:26:07 +0000 (21:26 +0100)
1. MIPS should select SPARSEMEM_STATIC since allocating bootmem in
   memory_present() will corrupt bootmap area.
2. pfn_valid() for SPARSEMEM is defined in linux/mmzone.h

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kconfig
include/asm-mips/page.h

index 3ebc5b296dbbaecea85eb0578404a06aedd68ca1..330f6abc7703c0302db441be299eafc842a3ff52 100644 (file)
@@ -1694,6 +1694,7 @@ config ARCH_SPARSEMEM_ENABLE
 
 config ARCH_SPARSEMEM_ENABLE
        bool
+       select SPARSEMEM_STATIC
 
 config NUMA
        bool "NUMA Support"
index 6b97744f00cd7a79bf015daa06a060219dea5bc2..6ed1151a05a36115a9dcb4014cb4b2e21f410b74 100644 (file)
@@ -138,16 +138,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 
 #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
 
-#ifndef CONFIG_SPARSEMEM
-#ifndef CONFIG_NEED_MULTIPLE_NODES
-#define pfn_valid(pfn)         ((pfn) < max_mapnr)
-#endif
-#endif
-
 #ifdef CONFIG_FLATMEM
 
 #define pfn_valid(pfn)         ((pfn) < max_mapnr)
 
+#elif defined(CONFIG_SPARSEMEM)
+
+/* pfn_valid is defined in linux/mmzone.h */
+
 #elif defined(CONFIG_NEED_MULTIPLE_NODES)
 
 #define pfn_valid(pfn)                                                 \
@@ -159,8 +157,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
                    : 0);                                               \
 })
 
-#else
-#error Provide a definition of pfn_valid
 #endif
 
 #define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)