aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820_32.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-05-20 23:10:58 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-25 05:35:53 -0400
commitbf62f3981c7076714e3b9f5fa6989a806cad02bf (patch)
tree8c47942af4b670d6381e853ff22f085b336ebc68 /arch/x86/kernel/e820_32.c
parentaafbdf71f1d3aeffd679b1a86e1b28f71515856c (diff)
x86: move e820_mark_nosave_regions to e820.c
and make e820_mark_nosave_regions to take limit_pfn to use max_low_pfn for 32bit and end_pfn for 64bit Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/e820_32.c')
-rw-r--r--arch/x86/kernel/e820_32.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c
index dfe25751038b..db760d4706af 100644
--- a/arch/x86/kernel/e820_32.c
+++ b/arch/x86/kernel/e820_32.c
@@ -9,7 +9,6 @@
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/pfn.h> 10#include <linux/pfn.h>
11#include <linux/uaccess.h> 11#include <linux/uaccess.h>
12#include <linux/suspend.h>
13 12
14#include <asm/pgtable.h> 13#include <asm/pgtable.h>
15#include <asm/page.h> 14#include <asm/page.h>
@@ -208,37 +207,6 @@ void __init init_iomem_resources(struct resource *code_resource,
208 } 207 }
209} 208}
210 209
211#if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION)
212/**
213 * e820_mark_nosave_regions - Find the ranges of physical addresses that do not
214 * correspond to e820 RAM areas and mark the corresponding pages as nosave for
215 * hibernation.
216 *
217 * This function requires the e820 map to be sorted and without any
218 * overlapping entries and assumes the first e820 area to be RAM.
219 */
220void __init e820_mark_nosave_regions(void)
221{
222 int i;
223 unsigned long pfn;
224
225 pfn = PFN_DOWN(e820.map[0].addr + e820.map[0].size);
226 for (i = 1; i < e820.nr_map; i++) {
227 struct e820entry *ei = &e820.map[i];
228
229 if (pfn < PFN_UP(ei->addr))
230 register_nosave_region(pfn, PFN_UP(ei->addr));
231
232 pfn = PFN_DOWN(ei->addr + ei->size);
233 if (ei->type != E820_RAM)
234 register_nosave_region(PFN_UP(ei->addr), pfn);
235
236 if (pfn >= max_low_pfn)
237 break;
238 }
239}
240#endif
241
242/* 210/*
243 * Find the highest page frame number we have available 211 * Find the highest page frame number we have available
244 */ 212 */