diff options
Diffstat (limited to 'arch/x86_64/kernel/e820.c')
-rw-r--r-- | arch/x86_64/kernel/e820.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index be8965427a93..13c6c37610e0 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/kexec.h> | 17 | #include <linux/kexec.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
20 | #include <linux/suspend.h> | ||
21 | #include <linux/pfn.h> | ||
20 | 22 | ||
21 | #include <asm/pgtable.h> | 23 | #include <asm/pgtable.h> |
22 | #include <asm/page.h> | 24 | #include <asm/page.h> |
@@ -256,22 +258,6 @@ void __init e820_reserve_resources(void) | |||
256 | } | 258 | } |
257 | } | 259 | } |
258 | 260 | ||
259 | /* Mark pages corresponding to given address range as nosave */ | ||
260 | static void __init | ||
261 | e820_mark_nosave_range(unsigned long start, unsigned long end) | ||
262 | { | ||
263 | unsigned long pfn, max_pfn; | ||
264 | |||
265 | if (start >= end) | ||
266 | return; | ||
267 | |||
268 | printk("Nosave address range: %016lx - %016lx\n", start, end); | ||
269 | max_pfn = end >> PAGE_SHIFT; | ||
270 | for (pfn = start >> PAGE_SHIFT; pfn < max_pfn; pfn++) | ||
271 | if (pfn_valid(pfn)) | ||
272 | SetPageNosave(pfn_to_page(pfn)); | ||
273 | } | ||
274 | |||
275 | /* | 261 | /* |
276 | * Find the ranges of physical addresses that do not correspond to | 262 | * Find the ranges of physical addresses that do not correspond to |
277 | * e820 RAM areas and mark the corresponding pages as nosave for software | 263 | * e820 RAM areas and mark the corresponding pages as nosave for software |
@@ -290,13 +276,13 @@ void __init e820_mark_nosave_regions(void) | |||
290 | struct e820entry *ei = &e820.map[i]; | 276 | struct e820entry *ei = &e820.map[i]; |
291 | 277 | ||
292 | if (paddr < ei->addr) | 278 | if (paddr < ei->addr) |
293 | e820_mark_nosave_range(paddr, | 279 | register_nosave_region(PFN_DOWN(paddr), |
294 | round_up(ei->addr, PAGE_SIZE)); | 280 | PFN_UP(ei->addr)); |
295 | 281 | ||
296 | paddr = round_down(ei->addr + ei->size, PAGE_SIZE); | 282 | paddr = round_down(ei->addr + ei->size, PAGE_SIZE); |
297 | if (ei->type != E820_RAM) | 283 | if (ei->type != E820_RAM) |
298 | e820_mark_nosave_range(round_up(ei->addr, PAGE_SIZE), | 284 | register_nosave_region(PFN_UP(ei->addr), |
299 | paddr); | 285 | PFN_DOWN(paddr)); |
300 | 286 | ||
301 | if (paddr >= (end_pfn << PAGE_SHIFT)) | 287 | if (paddr >= (end_pfn << PAGE_SHIFT)) |
302 | break; | 288 | break; |