diff options
author | Dave Carroll <dcarroll@astekcorp.com> | 2011-06-18 03:36:39 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-06-30 01:28:05 -0400 |
commit | 2773fcc8c48b947c997ff345f3e453917883cdb5 (patch) | |
tree | d0b526f25efa465236bce0ab31c3e89dc79a1462 /arch/powerpc/mm/init_32.c | |
parent | 6da49a292534d31ca391928ea97f8225774dc1e0 (diff) |
powerpc: Move free_initmem to common code
The free_initmem function is basically duplicated in mm/init_32,
and init_64, and is moved to the common 32/64-bit mm/mem.c.
All other sections except init were removed in v2.6.15 by
6c45ab992e4299c869fb26427944a8f8ea177024 (powerpc: Remove section
free() and linker script bits), and therefore the bulk of the executed
code is identical.
This patch also removes updating ppc_md.progress to NULL in the powermac
late_initcall.
Suggested-by: Milton Miller <miltonm@bga.com>
Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Carroll <dcarroll@astekcorp.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/init_32.c')
-rw-r--r-- | arch/powerpc/mm/init_32.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c index 5de0f254dbb5..c77fef56dad6 100644 --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c | |||
@@ -191,38 +191,6 @@ void __init *early_get_page(void) | |||
191 | return __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE)); | 191 | return __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE)); |
192 | } | 192 | } |
193 | 193 | ||
194 | /* Free up now-unused memory */ | ||
195 | static void free_sec(unsigned long start, unsigned long end, const char *name) | ||
196 | { | ||
197 | unsigned long cnt = 0; | ||
198 | |||
199 | while (start < end) { | ||
200 | ClearPageReserved(virt_to_page(start)); | ||
201 | init_page_count(virt_to_page(start)); | ||
202 | free_page(start); | ||
203 | cnt++; | ||
204 | start += PAGE_SIZE; | ||
205 | } | ||
206 | if (cnt) { | ||
207 | printk(" %ldk %s", cnt << (PAGE_SHIFT - 10), name); | ||
208 | totalram_pages += cnt; | ||
209 | } | ||
210 | } | ||
211 | |||
212 | void free_initmem(void) | ||
213 | { | ||
214 | #define FREESEC(TYPE) \ | ||
215 | free_sec((unsigned long)(&__ ## TYPE ## _begin), \ | ||
216 | (unsigned long)(&__ ## TYPE ## _end), \ | ||
217 | #TYPE); | ||
218 | |||
219 | printk ("Freeing unused kernel memory:"); | ||
220 | FREESEC(init); | ||
221 | printk("\n"); | ||
222 | ppc_md.progress = NULL; | ||
223 | #undef FREESEC | ||
224 | } | ||
225 | |||
226 | #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */ | 194 | #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */ |
227 | void setup_initial_memory_limit(phys_addr_t first_memblock_base, | 195 | void setup_initial_memory_limit(phys_addr_t first_memblock_base, |
228 | phys_addr_t first_memblock_size) | 196 | phys_addr_t first_memblock_size) |