diff options
| author | Patrick Mochel <mochel@linux.site> | 2004-08-01 09:09:39 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@digitalimplant.org> | 2004-08-01 09:09:39 -0700 |
| commit | 11700b3cce269c668d82d5df94934fe17b2dff07 (patch) | |
| tree | 6bb7a18f924f7ef686af05c1b6da3a20b71abf32 | |
| parent | 6bea24b9e60580779f731719811149978ae60ea2 (diff) | |
[swsusp] Make sure we call restore_highmem().
- Also, make highmem calls unconditional, with #ifdef inside functions.
| -rw-r--r-- | kernel/power/swsusp.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 0b0ccb1cfdc4..8971c8aaf4bc 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -467,22 +467,30 @@ static int save_highmem_zone(struct zone *zone) } return 0; } +#endif /* CONFIG_HIGHMEM */ + static int save_highmem(void) { +#ifdef CONFIG_HIGHMEM struct zone *zone; int res = 0; + + pr_debug("swsusp: Saving Highmem\n"); for_each_zone(zone) { if (is_highmem(zone)) res = save_highmem_zone(zone); if (res) return res; } +#endif return 0; } static int restore_highmem(void) { +#ifdef CONFIG_HIGHMEM + printk("swsusp: Restoring Highmem\n"); while (highmem_copy) { struct highmem_page *save = highmem_copy; void *kaddr; @@ -494,9 +502,10 @@ static int restore_highmem(void) free_page((long) save->data); kfree(save); } +#endif return 0; } -#endif + static int pfn_is_nosave(unsigned long pfn) { @@ -780,15 +789,11 @@ int suspend_prepare_image(void) { unsigned int nr_needed_pages = 0; - printk( "/critical section: "); -#ifdef CONFIG_HIGHMEM - printk( "handling highmem" ); + pr_debug("swsusp: critical section: \n"); if (save_highmem()) { printk(KERN_CRIT "%sNot enough free pages for highmem\n", name_suspend); return -ENOMEM; } - printk(", "); -#endif drain_local_pages(); count_data_pages(); @@ -809,7 +814,7 @@ int suspend_prepare_image(void) * touch swap space! Except we must write out our image of course. */ - printk( "critical section/: done (%d pages copied)\n", nr_copy_pages ); + printk("swsusp: critical section/: done (%d pages copied)\n", nr_copy_pages ); return 0; } @@ -876,6 +881,7 @@ int swsusp_resume(void) save_processor_state(); error = swsusp_arch_resume(); restore_processor_state(); + restore_highmem(); local_irq_enable(); return error; } |
