diff options
author | Pekka Enberg <penberg@kernel.org> | 2011-11-01 09:58:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-11-11 04:22:55 -0500 |
commit | 176239153049a023d060ce95b05f7ef31667e362 (patch) | |
tree | fce64421a695752fc9dfa9fa2331c11f95083146 /arch/x86/mm/init.c | |
parent | 248b52b97da7a712d2263a51d8d84c959f38ef75 (diff) |
x86, mm: Unify zone_sizes_init()
Now that zone_sizes_init() is identical on 32-bit and 64-bit,
move the code to arch/x86/mm/init.c and use it for both
architectures.
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Link: http://lkml.kernel.org/r/1320155902-10424-7-git-send-email-penberg@kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init.c')
-rw-r--r-- | arch/x86/mm/init.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 87488b93a65c..2426b60bb409 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/ioport.h> | 3 | #include <linux/ioport.h> |
4 | #include <linux/swap.h> | 4 | #include <linux/swap.h> |
5 | #include <linux/memblock.h> | 5 | #include <linux/memblock.h> |
6 | #include <linux/bootmem.h> /* for max_low_pfn */ | ||
6 | 7 | ||
7 | #include <asm/cacheflush.h> | 8 | #include <asm/cacheflush.h> |
8 | #include <asm/e820.h> | 9 | #include <asm/e820.h> |
@@ -15,6 +16,7 @@ | |||
15 | #include <asm/tlbflush.h> | 16 | #include <asm/tlbflush.h> |
16 | #include <asm/tlb.h> | 17 | #include <asm/tlb.h> |
17 | #include <asm/proto.h> | 18 | #include <asm/proto.h> |
19 | #include <asm/dma.h> /* for MAX_DMA_PFN */ | ||
18 | 20 | ||
19 | unsigned long __initdata pgt_buf_start; | 21 | unsigned long __initdata pgt_buf_start; |
20 | unsigned long __meminitdata pgt_buf_end; | 22 | unsigned long __meminitdata pgt_buf_end; |
@@ -392,3 +394,24 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
392 | free_init_pages("initrd memory", start, PAGE_ALIGN(end)); | 394 | free_init_pages("initrd memory", start, PAGE_ALIGN(end)); |
393 | } | 395 | } |
394 | #endif | 396 | #endif |
397 | |||
398 | void __init zone_sizes_init(void) | ||
399 | { | ||
400 | unsigned long max_zone_pfns[MAX_NR_ZONES]; | ||
401 | |||
402 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | ||
403 | |||
404 | #ifdef CONFIG_ZONE_DMA | ||
405 | max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN; | ||
406 | #endif | ||
407 | #ifdef CONFIG_ZONE_DMA32 | ||
408 | max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; | ||
409 | #endif | ||
410 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | ||
411 | #ifdef CONFIG_HIGHMEM | ||
412 | max_zone_pfns[ZONE_HIGHMEM] = max_pfn; | ||
413 | #endif | ||
414 | |||
415 | free_area_init_nodes(max_zone_pfns); | ||
416 | } | ||
417 | |||