aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swsusp.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/swsusp.c')
-rw-r--r--kernel/power/swsusp.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index f0ee4e7780d6..17f669c83012 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -62,6 +62,16 @@ unsigned long image_size = 500 * 1024 * 1024;
62 62
63int in_suspend __nosavedata = 0; 63int in_suspend __nosavedata = 0;
64 64
65#ifdef CONFIG_HIGHMEM
66unsigned int count_highmem_pages(void);
67int save_highmem(void);
68int restore_highmem(void);
69#else
70static inline int save_highmem(void) { return 0; }
71static inline int restore_highmem(void) { return 0; }
72static inline unsigned int count_highmem_pages(void) { return 0; }
73#endif
74
65/** 75/**
66 * The following functions are used for tracing the allocated 76 * The following functions are used for tracing the allocated
67 * swap pages, so that they can be freed in case of an error. 77 * swap pages, so that they can be freed in case of an error.
@@ -182,7 +192,7 @@ int swsusp_shrink_memory(void)
182 192
183 printk("Shrinking memory... "); 193 printk("Shrinking memory... ");
184 do { 194 do {
185 size = 2 * count_special_pages(); 195 size = 2 * count_highmem_pages();
186 size += size / 50 + count_data_pages(); 196 size += size / 50 + count_data_pages();
187 size += (size + PBES_PER_PAGE - 1) / PBES_PER_PAGE + 197 size += (size + PBES_PER_PAGE - 1) / PBES_PER_PAGE +
188 PAGES_FOR_IO; 198 PAGES_FOR_IO;
@@ -226,7 +236,7 @@ int swsusp_suspend(void)
226 goto Enable_irqs; 236 goto Enable_irqs;
227 } 237 }
228 238
229 if ((error = save_special_mem())) { 239 if ((error = save_highmem())) {
230 printk(KERN_ERR "swsusp: Not enough free pages for highmem\n"); 240 printk(KERN_ERR "swsusp: Not enough free pages for highmem\n");
231 goto Restore_highmem; 241 goto Restore_highmem;
232 } 242 }
@@ -237,7 +247,7 @@ int swsusp_suspend(void)
237 /* Restore control flow magically appears here */ 247 /* Restore control flow magically appears here */
238 restore_processor_state(); 248 restore_processor_state();
239Restore_highmem: 249Restore_highmem:
240 restore_special_mem(); 250 restore_highmem();
241 device_power_up(); 251 device_power_up();
242Enable_irqs: 252Enable_irqs:
243 local_irq_enable(); 253 local_irq_enable();
@@ -263,7 +273,7 @@ int swsusp_resume(void)
263 */ 273 */
264 swsusp_free(); 274 swsusp_free();
265 restore_processor_state(); 275 restore_processor_state();
266 restore_special_mem(); 276 restore_highmem();
267 touch_softlockup_watchdog(); 277 touch_softlockup_watchdog();
268 device_power_up(); 278 device_power_up();
269 local_irq_enable(); 279 local_irq_enable();