diff options
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 1f2f7ba9e709..9c7cb6430666 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -32,6 +32,24 @@ static inline int pm_prepare_console(void) { return 0; } | |||
32 | static inline void pm_restore_console(void) {} | 32 | static inline void pm_restore_console(void) {} |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /** | ||
36 | * struct hibernation_ops - hibernation platform support | ||
37 | * | ||
38 | * The methods in this structure allow a platform to override the default | ||
39 | * mechanism of shutting down the machine during a hibernation transition. | ||
40 | * | ||
41 | * All three methods must be assigned. | ||
42 | * | ||
43 | * @prepare: prepare system for hibernation | ||
44 | * @enter: shut down system after state has been saved to disk | ||
45 | * @finish: finish/clean up after state has been reloaded | ||
46 | */ | ||
47 | struct hibernation_ops { | ||
48 | int (*prepare)(void); | ||
49 | int (*enter)(void); | ||
50 | void (*finish)(void); | ||
51 | }; | ||
52 | |||
35 | #if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) | 53 | #if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) |
36 | /* kernel/power/snapshot.c */ | 54 | /* kernel/power/snapshot.c */ |
37 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); | 55 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); |
@@ -47,12 +65,18 @@ extern int swsusp_page_is_forbidden(struct page *); | |||
47 | extern void swsusp_set_page_free(struct page *); | 65 | extern void swsusp_set_page_free(struct page *); |
48 | extern void swsusp_unset_page_free(struct page *); | 66 | extern void swsusp_unset_page_free(struct page *); |
49 | extern unsigned long get_safe_page(gfp_t gfp_mask); | 67 | extern unsigned long get_safe_page(gfp_t gfp_mask); |
68 | |||
69 | extern void hibernation_set_ops(struct hibernation_ops *ops); | ||
70 | extern int hibernate(void); | ||
50 | #else | 71 | #else |
51 | static inline void register_nosave_region(unsigned long b, unsigned long e) {} | 72 | static inline void register_nosave_region(unsigned long b, unsigned long e) {} |
52 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} | 73 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} |
53 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 74 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
54 | static inline void swsusp_set_page_free(struct page *p) {} | 75 | static inline void swsusp_set_page_free(struct page *p) {} |
55 | static inline void swsusp_unset_page_free(struct page *p) {} | 76 | static inline void swsusp_unset_page_free(struct page *p) {} |
77 | |||
78 | static inline void hibernation_set_ops(struct hibernation_ops *ops) {} | ||
79 | static inline int hibernate(void) { return -ENOSYS; } | ||
56 | #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ | 80 | #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ |
57 | 81 | ||
58 | void save_processor_state(void); | 82 | void save_processor_state(void); |