diff options
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r-- | arch/powerpc/mm/mem.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index e3349ead3959..16def4dcff6d 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -216,9 +216,11 @@ void __init do_init_bootmem(void) | |||
216 | unsigned long total_pages; | 216 | unsigned long total_pages; |
217 | int boot_mapsize; | 217 | int boot_mapsize; |
218 | 218 | ||
219 | max_pfn = total_pages = lmb_end_of_DRAM() >> PAGE_SHIFT; | 219 | max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT; |
220 | total_pages = (lmb_end_of_DRAM() - memstart_addr) >> PAGE_SHIFT; | ||
220 | #ifdef CONFIG_HIGHMEM | 221 | #ifdef CONFIG_HIGHMEM |
221 | total_pages = total_lowmem >> PAGE_SHIFT; | 222 | total_pages = total_lowmem >> PAGE_SHIFT; |
223 | max_low_pfn = lowmem_end_addr >> PAGE_SHIFT; | ||
222 | #endif | 224 | #endif |
223 | 225 | ||
224 | /* | 226 | /* |
@@ -244,18 +246,18 @@ void __init do_init_bootmem(void) | |||
244 | * present. | 246 | * present. |
245 | */ | 247 | */ |
246 | #ifdef CONFIG_HIGHMEM | 248 | #ifdef CONFIG_HIGHMEM |
247 | free_bootmem_with_active_regions(0, total_lowmem >> PAGE_SHIFT); | 249 | free_bootmem_with_active_regions(0, lowmem_end_addr >> PAGE_SHIFT); |
248 | 250 | ||
249 | /* reserve the sections we're already using */ | 251 | /* reserve the sections we're already using */ |
250 | for (i = 0; i < lmb.reserved.cnt; i++) { | 252 | for (i = 0; i < lmb.reserved.cnt; i++) { |
251 | unsigned long addr = lmb.reserved.region[i].base + | 253 | unsigned long addr = lmb.reserved.region[i].base + |
252 | lmb_size_bytes(&lmb.reserved, i) - 1; | 254 | lmb_size_bytes(&lmb.reserved, i) - 1; |
253 | if (addr < total_lowmem) | 255 | if (addr < lowmem_end_addr) |
254 | reserve_bootmem(lmb.reserved.region[i].base, | 256 | reserve_bootmem(lmb.reserved.region[i].base, |
255 | lmb_size_bytes(&lmb.reserved, i), | 257 | lmb_size_bytes(&lmb.reserved, i), |
256 | BOOTMEM_DEFAULT); | 258 | BOOTMEM_DEFAULT); |
257 | else if (lmb.reserved.region[i].base < total_lowmem) { | 259 | else if (lmb.reserved.region[i].base < lowmem_end_addr) { |
258 | unsigned long adjusted_size = total_lowmem - | 260 | unsigned long adjusted_size = lowmem_end_addr - |
259 | lmb.reserved.region[i].base; | 261 | lmb.reserved.region[i].base; |
260 | reserve_bootmem(lmb.reserved.region[i].base, | 262 | reserve_bootmem(lmb.reserved.region[i].base, |
261 | adjusted_size, BOOTMEM_DEFAULT); | 263 | adjusted_size, BOOTMEM_DEFAULT); |
@@ -325,7 +327,7 @@ void __init paging_init(void) | |||
325 | (top_of_ram - total_ram) >> 20); | 327 | (top_of_ram - total_ram) >> 20); |
326 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | 328 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); |
327 | #ifdef CONFIG_HIGHMEM | 329 | #ifdef CONFIG_HIGHMEM |
328 | max_zone_pfns[ZONE_DMA] = total_lowmem >> PAGE_SHIFT; | 330 | max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT; |
329 | max_zone_pfns[ZONE_HIGHMEM] = top_of_ram >> PAGE_SHIFT; | 331 | max_zone_pfns[ZONE_HIGHMEM] = top_of_ram >> PAGE_SHIFT; |
330 | #else | 332 | #else |
331 | max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT; | 333 | max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT; |
@@ -380,7 +382,7 @@ void __init mem_init(void) | |||
380 | { | 382 | { |
381 | unsigned long pfn, highmem_mapnr; | 383 | unsigned long pfn, highmem_mapnr; |
382 | 384 | ||
383 | highmem_mapnr = total_lowmem >> PAGE_SHIFT; | 385 | highmem_mapnr = lowmem_end_addr >> PAGE_SHIFT; |
384 | for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) { | 386 | for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) { |
385 | struct page *page = pfn_to_page(pfn); | 387 | struct page *page = pfn_to_page(pfn); |
386 | if (lmb_is_reserved(pfn << PAGE_SHIFT)) | 388 | if (lmb_is_reserved(pfn << PAGE_SHIFT)) |