aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swsusp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 21:41:00 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 21:41:00 -0400
commit3448097fccdce4ea8f0fcad4f37f502a8cd72e68 (patch)
tree583ee97128a9e2657d5bf73def841c460371804a /kernel/power/swsusp.c
parent5503967307f3fa443f5770a4df5ea4fbe9fb3917 (diff)
Revert "swsusp special saveable pages support" commits
This reverts commits 3e3318dee0878d42ed62a19c292a2ac284135db3 [PATCH] swsusp: x86_64 mark special saveable/unsaveable pages b6370d96e09944c6e3ae8d5743ca8a8ab1f79f6c [PATCH] swsusp: i386 mark special saveable/unsaveable pages ce4ab0012b32c1a4a1d6e934aeb73bf3151c48d9 [PATCH] swsusp: add architecture special saveable pages support because not only do they apparently cause page faults on x86, the infrastructure doesn't compile on powerpc. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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();