aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-05-07 23:37:51 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-07 23:37:51 -0400
commit02bbc0f09c90cefdb2837605c96a66c5ce4ba2e1 (patch)
tree04ef573cd4de095c500c9fc3477f4278c0b36300 /include/linux/suspend.h
parent7487a2245b8841c77ba9db406cf99a483b9334e9 (diff)
parent5b94f675f57e4ff16c8fda09088d7480a84dcd91 (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h35
1 files changed, 16 insertions, 19 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index a34835ae0e75..9d2aa1a12aa0 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -8,6 +8,7 @@
8#include <linux/notifier.h> 8#include <linux/notifier.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/pm.h> 10#include <linux/pm.h>
11#include <linux/mm.h>
11 12
12/* struct pbe is used for creating lists of pages that should be restored 13/* struct pbe is used for creating lists of pages that should be restored
13 * atomically during the resume from disk, because the page frames they have 14 * atomically during the resume from disk, because the page frames they have
@@ -23,36 +24,32 @@ struct pbe {
23extern void drain_local_pages(void); 24extern void drain_local_pages(void);
24extern void mark_free_pages(struct zone *zone); 25extern void mark_free_pages(struct zone *zone);
25 26
26#ifdef CONFIG_PM 27#if defined(CONFIG_PM) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
27/* kernel/power/swsusp.c */
28extern int software_suspend(void);
29
30#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
31extern int pm_prepare_console(void); 28extern int pm_prepare_console(void);
32extern void pm_restore_console(void); 29extern void pm_restore_console(void);
33#else 30#else
34static inline int pm_prepare_console(void) { return 0; } 31static inline int pm_prepare_console(void) { return 0; }
35static inline void pm_restore_console(void) {} 32static inline void pm_restore_console(void) {}
36#endif /* defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) */ 33#endif
34
35#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND)
36/* kernel/power/snapshot.c */
37extern void __init register_nosave_region(unsigned long, unsigned long);
38extern int swsusp_page_is_forbidden(struct page *);
39extern void swsusp_set_page_free(struct page *);
40extern void swsusp_unset_page_free(struct page *);
41extern unsigned long get_safe_page(gfp_t gfp_mask);
37#else 42#else
38static inline int software_suspend(void) 43static inline void register_nosave_region(unsigned long b, unsigned long e) {}
39{ 44static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
40 printk("Warning: fake suspend called\n"); 45static inline void swsusp_set_page_free(struct page *p) {}
41 return -ENOSYS; 46static inline void swsusp_unset_page_free(struct page *p) {}
42} 47#endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */
43#endif /* CONFIG_PM */
44 48
45void save_processor_state(void); 49void save_processor_state(void);
46void restore_processor_state(void); 50void restore_processor_state(void);
47struct saved_context; 51struct saved_context;
48void __save_processor_state(struct saved_context *ctxt); 52void __save_processor_state(struct saved_context *ctxt);
49void __restore_processor_state(struct saved_context *ctxt); 53void __restore_processor_state(struct saved_context *ctxt);
50unsigned long get_safe_page(gfp_t gfp_mask);
51
52/*
53 * XXX: We try to keep some more pages free so that I/O operations succeed
54 * without paging. Might this be more?
55 */
56#define PAGES_FOR_IO 1024
57 54
58#endif /* _LINUX_SWSUSP_H */ 55#endif /* _LINUX_SWSUSP_H */