diff options
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index bf99bd49f8ef..a45b9f514492 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 |
@@ -49,6 +50,38 @@ void __save_processor_state(struct saved_context *ctxt); | |||
49 | void __restore_processor_state(struct saved_context *ctxt); | 50 | void __restore_processor_state(struct saved_context *ctxt); |
50 | unsigned long get_safe_page(gfp_t gfp_mask); | 51 | unsigned long get_safe_page(gfp_t gfp_mask); |
51 | 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 | |||
52 | /* | 85 | /* |
53 | * XXX: We try to keep some more pages free so that I/O operations succeed | 86 | * XXX: We try to keep some more pages free so that I/O operations succeed |
54 | * without paging. Might this be more? | 87 | * without paging. Might this be more? |