aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Lynch <ntl@pobox.com>2008-06-03 18:30:54 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-08 21:32:41 -0400
commit0d5799449f0f373ca12681d86c941ae464146a37 (patch)
treecf61fc411adac7661c7a69ccef1dc6a171cf473e
parent420b5eeaee5b877829c4f0a514a5ad21448596af (diff)
[POWERPC] Make walk_memory_resource available with MEMORY_HOTPLUG=n
The ehea driver was recently changed[1] to use walk_memory_resource() to detect the system's memory layout. However, walk_memory_resource() is available only when memory hotplug is enabled. So CONFIG_EHEA was made to depend on MEMORY_HOTPLUG [2], but it is inappropriate for a network driver to have such a dependency. Make the declaration of walk_memory_resource() and its powerpc implementation (ehea is powerpc-specific) unconditionally available. [1] 48cfb14f8b89d4d5b3df6c16f08b258686fb12ad "ehea: Add DLPAR memory remove support" [2] fb7b6ca2b6b7c23b52be143bdd5f55a23b9780c8 "ehea: Add dependency to Kconfig" Signed-off-by: Nathan Lynch <ntl@pobox.com> Acked-by: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/mm/mem.c3
-rw-r--r--include/linux/memory_hotplug.h16
2 files changed, 9 insertions, 10 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index f67e118116fa..51f82d83bf14 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -151,6 +151,7 @@ out:
151 return ret; 151 return ret;
152} 152}
153#endif /* CONFIG_MEMORY_HOTREMOVE */ 153#endif /* CONFIG_MEMORY_HOTREMOVE */
154#endif /* CONFIG_MEMORY_HOTPLUG */
154 155
155/* 156/*
156 * walk_memory_resource() needs to make sure there is no holes in a given 157 * walk_memory_resource() needs to make sure there is no holes in a given
@@ -184,8 +185,6 @@ walk_memory_resource(unsigned long start_pfn, unsigned long nr_pages, void *arg,
184} 185}
185EXPORT_SYMBOL_GPL(walk_memory_resource); 186EXPORT_SYMBOL_GPL(walk_memory_resource);
186 187
187#endif /* CONFIG_MEMORY_HOTPLUG */
188
189void show_mem(void) 188void show_mem(void)
190{ 189{
191 unsigned long total = 0, reserved = 0; 190 unsigned long total = 0, reserved = 0;
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 73e358612eaf..ea9f5ad9ec8e 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -77,14 +77,6 @@ extern int __add_pages(struct zone *zone, unsigned long start_pfn,
77extern int __remove_pages(struct zone *zone, unsigned long start_pfn, 77extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
78 unsigned long nr_pages); 78 unsigned long nr_pages);
79 79
80/*
81 * Walk through all memory which is registered as resource.
82 * arg is (start_pfn, nr_pages, private_arg_pointer)
83 */
84extern int walk_memory_resource(unsigned long start_pfn,
85 unsigned long nr_pages, void *arg,
86 int (*func)(unsigned long, unsigned long, void *));
87
88#ifdef CONFIG_NUMA 80#ifdef CONFIG_NUMA
89extern int memory_add_physaddr_to_nid(u64 start); 81extern int memory_add_physaddr_to_nid(u64 start);
90#else 82#else
@@ -199,6 +191,14 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
199 191
200#endif /* ! CONFIG_MEMORY_HOTPLUG */ 192#endif /* ! CONFIG_MEMORY_HOTPLUG */
201 193
194/*
195 * Walk through all memory which is registered as resource.
196 * arg is (start_pfn, nr_pages, private_arg_pointer)
197 */
198extern int walk_memory_resource(unsigned long start_pfn,
199 unsigned long nr_pages, void *arg,
200 int (*func)(unsigned long, unsigned long, void *));
201
202extern int add_memory(int nid, u64 start, u64 size); 202extern int add_memory(int nid, u64 start, u64 size);
203extern int arch_add_memory(int nid, u64 start, u64 size); 203extern int arch_add_memory(int nid, u64 start, u64 size);
204extern int remove_memory(u64 start, u64 size); 204extern int remove_memory(u64 start, u64 size);