aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/setup.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2006-09-27 04:49:51 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:26:11 -0400
commit4cfee88ad30acc47f02b8b7ba3db8556262dce1e (patch)
treea336e6774143c869ec4e945f176368792355478b /arch/i386/kernel/setup.c
parentc67c3cb4c99fb2ee63c8733943c353d745f45b84 (diff)
[PATCH] Have x86 use add_active_range() and free_area_init_nodes
Size zones and holes in an architecture independent manner for x86. [akpm@osdl.org: build fix] Signed-off-by: Mel Gorman <mel@csn.ul.ie> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: Andy Whitcroft <apw@shadowen.org> Cc: Andi Kleen <ak@muc.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: "Keith Mannthey" <kmannth@gmail.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/setup.c')
-rw-r--r--arch/i386/kernel/setup.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 76a524b4c90f..814cdebf7377 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1089,22 +1089,20 @@ static unsigned long __init setup_memory(void)
1089 1089
1090void __init zone_sizes_init(void) 1090void __init zone_sizes_init(void)
1091{ 1091{
1092 unsigned long zones_size[MAX_NR_ZONES] = { 0, };
1093 unsigned int max_dma, low;
1094
1095 max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
1096 low = max_low_pfn;
1097
1098 if (low < max_dma)
1099 zones_size[ZONE_DMA] = low;
1100 else {
1101 zones_size[ZONE_DMA] = max_dma;
1102 zones_size[ZONE_NORMAL] = low - max_dma;
1103#ifdef CONFIG_HIGHMEM 1092#ifdef CONFIG_HIGHMEM
1104 zones_size[ZONE_HIGHMEM] = highend_pfn - low; 1093 unsigned long max_zone_pfns[MAX_NR_ZONES] = {
1094 virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT,
1095 max_low_pfn,
1096 highend_pfn};
1097 add_active_range(0, 0, highend_pfn);
1098#else
1099 unsigned long max_zone_pfns[MAX_NR_ZONES] = {
1100 virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT,
1101 max_low_pfn};
1102 add_active_range(0, 0, max_low_pfn);
1105#endif 1103#endif
1106 } 1104
1107 free_area_init(zones_size); 1105 free_area_init_nodes(max_zone_pfns);
1108} 1106}
1109#else 1107#else
1110extern unsigned long __init setup_memory(void); 1108extern unsigned long __init setup_memory(void);