diff options
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r-- | arch/powerpc/mm/mem.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 1a6e08f3298f..246eeea40ece 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/highmem.h> | 31 | #include <linux/highmem.h> |
32 | #include <linux/initrd.h> | 32 | #include <linux/initrd.h> |
33 | #include <linux/pagemap.h> | 33 | #include <linux/pagemap.h> |
34 | #include <linux/suspend.h> | ||
34 | 35 | ||
35 | #include <asm/pgalloc.h> | 36 | #include <asm/pgalloc.h> |
36 | #include <asm/prom.h> | 37 | #include <asm/prom.h> |
@@ -276,6 +277,28 @@ void __init do_init_bootmem(void) | |||
276 | init_bootmem_done = 1; | 277 | init_bootmem_done = 1; |
277 | } | 278 | } |
278 | 279 | ||
280 | /* mark pages that don't exist as nosave */ | ||
281 | static int __init mark_nonram_nosave(void) | ||
282 | { | ||
283 | unsigned long lmb_next_region_start_pfn, | ||
284 | lmb_region_max_pfn; | ||
285 | int i; | ||
286 | |||
287 | for (i = 0; i < lmb.memory.cnt - 1; i++) { | ||
288 | lmb_region_max_pfn = | ||
289 | (lmb.memory.region[i].base >> PAGE_SHIFT) + | ||
290 | (lmb.memory.region[i].size >> PAGE_SHIFT); | ||
291 | lmb_next_region_start_pfn = | ||
292 | lmb.memory.region[i+1].base >> PAGE_SHIFT; | ||
293 | |||
294 | if (lmb_region_max_pfn < lmb_next_region_start_pfn) | ||
295 | register_nosave_region(lmb_region_max_pfn, | ||
296 | lmb_next_region_start_pfn); | ||
297 | } | ||
298 | |||
299 | return 0; | ||
300 | } | ||
301 | |||
279 | /* | 302 | /* |
280 | * paging_init() sets up the page tables - in fact we've already done this. | 303 | * paging_init() sets up the page tables - in fact we've already done this. |
281 | */ | 304 | */ |
@@ -307,6 +330,8 @@ void __init paging_init(void) | |||
307 | max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT; | 330 | max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT; |
308 | #endif | 331 | #endif |
309 | free_area_init_nodes(max_zone_pfns); | 332 | free_area_init_nodes(max_zone_pfns); |
333 | |||
334 | mark_nonram_nosave(); | ||
310 | } | 335 | } |
311 | #endif /* ! CONFIG_NEED_MULTIPLE_NODES */ | 336 | #endif /* ! CONFIG_NEED_MULTIPLE_NODES */ |
312 | 337 | ||