diff options
Diffstat (limited to 'arch/x86_64/mm/init.c')
-rw-r--r-- | arch/x86_64/mm/init.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 72e4b364ed73..aa4a5189ecee 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -322,18 +322,26 @@ void zap_low_mappings(void) | |||
322 | void __init paging_init(void) | 322 | void __init paging_init(void) |
323 | { | 323 | { |
324 | { | 324 | { |
325 | unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; | 325 | unsigned long zones_size[MAX_NR_ZONES]; |
326 | unsigned long holes[MAX_NR_ZONES]; | ||
326 | unsigned int max_dma; | 327 | unsigned int max_dma; |
327 | 328 | ||
329 | memset(zones_size, 0, sizeof(zones_size)); | ||
330 | memset(holes, 0, sizeof(holes)); | ||
331 | |||
328 | max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; | 332 | max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; |
329 | 333 | ||
330 | if (end_pfn < max_dma) | 334 | if (end_pfn < max_dma) { |
331 | zones_size[ZONE_DMA] = end_pfn; | 335 | zones_size[ZONE_DMA] = end_pfn; |
332 | else { | 336 | holes[ZONE_DMA] = e820_hole_size(0, end_pfn); |
337 | } else { | ||
333 | zones_size[ZONE_DMA] = max_dma; | 338 | zones_size[ZONE_DMA] = max_dma; |
339 | holes[ZONE_DMA] = e820_hole_size(0, max_dma); | ||
334 | zones_size[ZONE_NORMAL] = end_pfn - max_dma; | 340 | zones_size[ZONE_NORMAL] = end_pfn - max_dma; |
341 | holes[ZONE_NORMAL] = e820_hole_size(max_dma, end_pfn); | ||
335 | } | 342 | } |
336 | free_area_init(zones_size); | 343 | free_area_init_node(0, NODE_DATA(0), zones_size, |
344 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, holes); | ||
337 | } | 345 | } |
338 | return; | 346 | return; |
339 | } | 347 | } |