diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-10-27 14:37:06 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-10-28 08:54:43 -0400 |
commit | d0e775afb94d9b61ba6c63299169ef7a87b68189 (patch) | |
tree | 39e9739f198e892d91d84792f56007f409906102 /arch/arm/mm/init.c | |
parent | 47ea3c15498154f634c304e08dee284efdd7dceb (diff) |
ARM: move freeing of highmem pages out of mem_init()
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 58b90ad4949f..1b4e0abf113a 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -436,6 +436,22 @@ static void __init free_unused_memmap(struct meminfo *mi) | |||
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | static void __init free_highpages(void) | ||
440 | { | ||
441 | #ifdef CONFIG_HIGHMEM | ||
442 | int i; | ||
443 | |||
444 | /* set highmem page free */ | ||
445 | for_each_bank (i, &meminfo) { | ||
446 | unsigned long start = bank_pfn_start(&meminfo.bank[i]); | ||
447 | unsigned long end = bank_pfn_end(&meminfo.bank[i]); | ||
448 | if (start >= max_low_pfn + PHYS_PFN_OFFSET) | ||
449 | totalhigh_pages += free_area(start, end, NULL); | ||
450 | } | ||
451 | totalram_pages += totalhigh_pages; | ||
452 | #endif | ||
453 | } | ||
454 | |||
439 | /* | 455 | /* |
440 | * mem_init() marks the free areas in the mem_map and tells us how much | 456 | * mem_init() marks the free areas in the mem_map and tells us how much |
441 | * memory is free. This is done after various parts of the system have | 457 | * memory is free. This is done after various parts of the system have |
@@ -465,16 +481,7 @@ void __init mem_init(void) | |||
465 | __phys_to_pfn(__pa(swapper_pg_dir)), NULL); | 481 | __phys_to_pfn(__pa(swapper_pg_dir)), NULL); |
466 | #endif | 482 | #endif |
467 | 483 | ||
468 | #ifdef CONFIG_HIGHMEM | 484 | free_highpages(); |
469 | /* set highmem page free */ | ||
470 | for_each_bank (i, &meminfo) { | ||
471 | unsigned long start = bank_pfn_start(&meminfo.bank[i]); | ||
472 | unsigned long end = bank_pfn_end(&meminfo.bank[i]); | ||
473 | if (start >= max_low_pfn + PHYS_PFN_OFFSET) | ||
474 | totalhigh_pages += free_area(start, end, NULL); | ||
475 | } | ||
476 | totalram_pages += totalhigh_pages; | ||
477 | #endif | ||
478 | 485 | ||
479 | reserved_pages = free_pages = 0; | 486 | reserved_pages = free_pages = 0; |
480 | 487 | ||