diff options
-rw-r--r-- | arch/arm/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/page.h | 2 | ||||
-rw-r--r-- | arch/arm/mm/init.c | 4 | ||||
-rw-r--r-- | include/linux/mmzone.h | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7275009686e6..5be55d950ab5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1516,6 +1516,9 @@ config ARCH_SPARSEMEM_DEFAULT | |||
1516 | config ARCH_SELECT_MEMORY_MODEL | 1516 | config ARCH_SELECT_MEMORY_MODEL |
1517 | def_bool ARCH_SPARSEMEM_ENABLE | 1517 | def_bool ARCH_SPARSEMEM_ENABLE |
1518 | 1518 | ||
1519 | config HAVE_ARCH_PFN_VALID | ||
1520 | def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM | ||
1521 | |||
1519 | config HIGHMEM | 1522 | config HIGHMEM |
1520 | bool "High Memory Support" | 1523 | bool "High Memory Support" |
1521 | depends on MMU | 1524 | depends on MMU |
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h index f51a69595f6e..ac75d0848889 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h | |||
@@ -197,7 +197,7 @@ typedef unsigned long pgprot_t; | |||
197 | 197 | ||
198 | typedef struct page *pgtable_t; | 198 | typedef struct page *pgtable_t; |
199 | 199 | ||
200 | #ifndef CONFIG_SPARSEMEM | 200 | #ifdef CONFIG_HAVE_ARCH_PFN_VALID |
201 | extern int pfn_valid(unsigned long); | 201 | extern int pfn_valid(unsigned long); |
202 | #endif | 202 | #endif |
203 | 203 | ||
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 3f17ea146f0e..bbc3346e8bcd 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -273,13 +273,15 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, | |||
273 | free_area_init_node(0, zone_size, min, zhole_size); | 273 | free_area_init_node(0, zone_size, min, zhole_size); |
274 | } | 274 | } |
275 | 275 | ||
276 | #ifndef CONFIG_SPARSEMEM | 276 | #ifdef CONFIG_HAVE_ARCH_PFN_VALID |
277 | int pfn_valid(unsigned long pfn) | 277 | int pfn_valid(unsigned long pfn) |
278 | { | 278 | { |
279 | return memblock_is_memory(pfn << PAGE_SHIFT); | 279 | return memblock_is_memory(pfn << PAGE_SHIFT); |
280 | } | 280 | } |
281 | EXPORT_SYMBOL(pfn_valid); | 281 | EXPORT_SYMBOL(pfn_valid); |
282 | #endif | ||
282 | 283 | ||
284 | #ifndef CONFIG_SPARSEMEM | ||
283 | static void arm_memory_present(void) | 285 | static void arm_memory_present(void) |
284 | { | 286 | { |
285 | } | 287 | } |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 217bcf6bca77..261f299c9441 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -1056,12 +1056,14 @@ static inline struct mem_section *__pfn_to_section(unsigned long pfn) | |||
1056 | return __nr_to_section(pfn_to_section_nr(pfn)); | 1056 | return __nr_to_section(pfn_to_section_nr(pfn)); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | #ifndef CONFIG_HAVE_ARCH_PFN_VALID | ||
1059 | static inline int pfn_valid(unsigned long pfn) | 1060 | static inline int pfn_valid(unsigned long pfn) |
1060 | { | 1061 | { |
1061 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) | 1062 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) |
1062 | return 0; | 1063 | return 0; |
1063 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); | 1064 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); |
1064 | } | 1065 | } |
1066 | #endif | ||
1065 | 1067 | ||
1066 | static inline int pfn_present(unsigned long pfn) | 1068 | static inline int pfn_present(unsigned long pfn) |
1067 | { | 1069 | { |