diff options
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 58 |
1 files changed, 18 insertions, 40 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index a45b9f514492..3cc4d6394c07 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -24,63 +24,41 @@ struct pbe { | |||
24 | extern void drain_local_pages(void); | 24 | extern void drain_local_pages(void); |
25 | extern void mark_free_pages(struct zone *zone); | 25 | extern void mark_free_pages(struct zone *zone); |
26 | 26 | ||
27 | #ifdef CONFIG_PM | 27 | #if defined(CONFIG_PM) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) |
28 | /* kernel/power/swsusp.c */ | ||
29 | extern int software_suspend(void); | ||
30 | |||
31 | #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) | ||
32 | extern int pm_prepare_console(void); | 28 | extern int pm_prepare_console(void); |
33 | extern void pm_restore_console(void); | 29 | extern void pm_restore_console(void); |
34 | #else | 30 | #else |
35 | static inline int pm_prepare_console(void) { return 0; } | 31 | static inline int pm_prepare_console(void) { return 0; } |
36 | static inline void pm_restore_console(void) {} | 32 | static inline void pm_restore_console(void) {} |
37 | #endif /* defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) */ | 33 | #endif |
34 | |||
35 | #if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) | ||
36 | /* kernel/power/swsusp.c */ | ||
37 | extern int software_suspend(void); | ||
38 | /* kernel/power/snapshot.c */ | ||
39 | extern void __init register_nosave_region(unsigned long, unsigned long); | ||
40 | extern int swsusp_page_is_forbidden(struct page *); | ||
41 | extern void swsusp_set_page_free(struct page *); | ||
42 | extern void swsusp_unset_page_free(struct page *); | ||
43 | extern unsigned long get_safe_page(gfp_t gfp_mask); | ||
38 | #else | 44 | #else |
39 | static inline int software_suspend(void) | 45 | static inline int software_suspend(void) |
40 | { | 46 | { |
41 | printk("Warning: fake suspend called\n"); | 47 | printk("Warning: fake suspend called\n"); |
42 | return -ENOSYS; | 48 | return -ENOSYS; |
43 | } | 49 | } |
44 | #endif /* CONFIG_PM */ | 50 | |
51 | static inline void register_nosave_region(unsigned long b, unsigned long e) {} | ||
52 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | ||
53 | static inline void swsusp_set_page_free(struct page *p) {} | ||
54 | static inline void swsusp_unset_page_free(struct page *p) {} | ||
55 | #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ | ||
45 | 56 | ||
46 | void save_processor_state(void); | 57 | void save_processor_state(void); |
47 | void restore_processor_state(void); | 58 | void restore_processor_state(void); |
48 | struct saved_context; | 59 | struct saved_context; |
49 | void __save_processor_state(struct saved_context *ctxt); | 60 | void __save_processor_state(struct saved_context *ctxt); |
50 | void __restore_processor_state(struct saved_context *ctxt); | 61 | void __restore_processor_state(struct saved_context *ctxt); |
51 | unsigned long get_safe_page(gfp_t gfp_mask); | ||
52 | |||
53 | /* Page management functions for the software suspend (swsusp) */ | ||
54 | |||
55 | static inline void swsusp_set_page_forbidden(struct page *page) | ||
56 | { | ||
57 | SetPageNosave(page); | ||
58 | } | ||
59 | |||
60 | static inline int swsusp_page_is_forbidden(struct page *page) | ||
61 | { | ||
62 | return PageNosave(page); | ||
63 | } | ||
64 | |||
65 | static inline void swsusp_unset_page_forbidden(struct page *page) | ||
66 | { | ||
67 | ClearPageNosave(page); | ||
68 | } | ||
69 | |||
70 | static inline void swsusp_set_page_free(struct page *page) | ||
71 | { | ||
72 | SetPageNosaveFree(page); | ||
73 | } | ||
74 | |||
75 | static inline int swsusp_page_is_free(struct page *page) | ||
76 | { | ||
77 | return PageNosaveFree(page); | ||
78 | } | ||
79 | |||
80 | static inline void swsusp_unset_page_free(struct page *page) | ||
81 | { | ||
82 | ClearPageNosaveFree(page); | ||
83 | } | ||
84 | 62 | ||
85 | /* | 63 | /* |
86 | * XXX: We try to keep some more pages free so that I/O operations succeed | 64 | * XXX: We try to keep some more pages free so that I/O operations succeed |