diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-05-08 05:23:49 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-09 02:34:56 -0400 |
commit | 940d67f6b95166475ff6e600ef7658e1cd441278 (patch) | |
tree | 390f7e30228ae2f22d0009831f80fb909df1e177 /kernel/power/snapshot.c | |
parent | de372ecd80a42c4fb485c7232475301a18d05184 (diff) |
[POWERPC] swsusp: Introduce register_nosave_region_late
This patch introduces a new register_nosave_region_late function that
can be called from initcalls when register_nosave_region can no longer
be used because it uses bootmem.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r-- | kernel/power/snapshot.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index b7039772b05c..59fb89ba9a4d 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -607,7 +607,8 @@ static LIST_HEAD(nosave_regions); | |||
607 | */ | 607 | */ |
608 | 608 | ||
609 | void __init | 609 | void __init |
610 | register_nosave_region(unsigned long start_pfn, unsigned long end_pfn) | 610 | __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, |
611 | int use_kmalloc) | ||
611 | { | 612 | { |
612 | struct nosave_region *region; | 613 | struct nosave_region *region; |
613 | 614 | ||
@@ -623,8 +624,13 @@ register_nosave_region(unsigned long start_pfn, unsigned long end_pfn) | |||
623 | goto Report; | 624 | goto Report; |
624 | } | 625 | } |
625 | } | 626 | } |
626 | /* This allocation cannot fail */ | 627 | if (use_kmalloc) { |
627 | region = alloc_bootmem_low(sizeof(struct nosave_region)); | 628 | /* during init, this shouldn't fail */ |
629 | region = kmalloc(sizeof(struct nosave_region), GFP_KERNEL); | ||
630 | BUG_ON(!region); | ||
631 | } else | ||
632 | /* This allocation cannot fail */ | ||
633 | region = alloc_bootmem_low(sizeof(struct nosave_region)); | ||
628 | region->start_pfn = start_pfn; | 634 | region->start_pfn = start_pfn; |
629 | region->end_pfn = end_pfn; | 635 | region->end_pfn = end_pfn; |
630 | list_add_tail(®ion->list, &nosave_regions); | 636 | list_add_tail(®ion->list, &nosave_regions); |