aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/suspend.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h44
1 files changed, 12 insertions, 32 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 4af270ec2204..083ffea7ba18 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -122,7 +122,7 @@ struct platform_suspend_ops {
122 * suspend_set_ops - set platform dependent suspend operations 122 * suspend_set_ops - set platform dependent suspend operations
123 * @ops: The new suspend operations to set. 123 * @ops: The new suspend operations to set.
124 */ 124 */
125extern void suspend_set_ops(struct platform_suspend_ops *ops); 125extern void suspend_set_ops(const struct platform_suspend_ops *ops);
126extern int suspend_valid_only_mem(suspend_state_t state); 126extern int suspend_valid_only_mem(suspend_state_t state);
127 127
128/** 128/**
@@ -147,7 +147,7 @@ extern int pm_suspend(suspend_state_t state);
147#else /* !CONFIG_SUSPEND */ 147#else /* !CONFIG_SUSPEND */
148#define suspend_valid_only_mem NULL 148#define suspend_valid_only_mem NULL
149 149
150static inline void suspend_set_ops(struct platform_suspend_ops *ops) {} 150static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
151static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } 151static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
152#endif /* !CONFIG_SUSPEND */ 152#endif /* !CONFIG_SUSPEND */
153 153
@@ -245,36 +245,21 @@ extern void swsusp_set_page_free(struct page *);
245extern void swsusp_unset_page_free(struct page *); 245extern void swsusp_unset_page_free(struct page *);
246extern unsigned long get_safe_page(gfp_t gfp_mask); 246extern unsigned long get_safe_page(gfp_t gfp_mask);
247 247
248extern void hibernation_set_ops(struct platform_hibernation_ops *ops); 248extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
249extern int hibernate(void); 249extern int hibernate(void);
250extern bool system_entering_hibernation(void); 250extern bool system_entering_hibernation(void);
251#else /* CONFIG_HIBERNATION */ 251#else /* CONFIG_HIBERNATION */
252static inline void register_nosave_region(unsigned long b, unsigned long e) {}
253static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
252static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } 254static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
253static inline void swsusp_set_page_free(struct page *p) {} 255static inline void swsusp_set_page_free(struct page *p) {}
254static inline void swsusp_unset_page_free(struct page *p) {} 256static inline void swsusp_unset_page_free(struct page *p) {}
255 257
256static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} 258static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {}
257static inline int hibernate(void) { return -ENOSYS; } 259static inline int hibernate(void) { return -ENOSYS; }
258static inline bool system_entering_hibernation(void) { return false; } 260static inline bool system_entering_hibernation(void) { return false; }
259#endif /* CONFIG_HIBERNATION */ 261#endif /* CONFIG_HIBERNATION */
260 262
261#ifdef CONFIG_SUSPEND_NVS
262extern int suspend_nvs_register(unsigned long start, unsigned long size);
263extern int suspend_nvs_alloc(void);
264extern void suspend_nvs_free(void);
265extern void suspend_nvs_save(void);
266extern void suspend_nvs_restore(void);
267#else /* CONFIG_SUSPEND_NVS */
268static inline int suspend_nvs_register(unsigned long a, unsigned long b)
269{
270 return 0;
271}
272static inline int suspend_nvs_alloc(void) { return 0; }
273static inline void suspend_nvs_free(void) {}
274static inline void suspend_nvs_save(void) {}
275static inline void suspend_nvs_restore(void) {}
276#endif /* CONFIG_SUSPEND_NVS */
277
278#ifdef CONFIG_PM_SLEEP 263#ifdef CONFIG_PM_SLEEP
279void save_processor_state(void); 264void save_processor_state(void);
280void restore_processor_state(void); 265void restore_processor_state(void);
@@ -292,9 +277,9 @@ extern int unregister_pm_notifier(struct notifier_block *nb);
292/* drivers/base/power/wakeup.c */ 277/* drivers/base/power/wakeup.c */
293extern bool events_check_enabled; 278extern bool events_check_enabled;
294 279
295extern bool pm_check_wakeup_events(void); 280extern bool pm_wakeup_pending(void);
296extern bool pm_get_wakeup_count(unsigned long *count); 281extern bool pm_get_wakeup_count(unsigned int *count);
297extern bool pm_save_wakeup_count(unsigned long count); 282extern bool pm_save_wakeup_count(unsigned int count);
298#else /* !CONFIG_PM_SLEEP */ 283#else /* !CONFIG_PM_SLEEP */
299 284
300static inline int register_pm_notifier(struct notifier_block *nb) 285static inline int register_pm_notifier(struct notifier_block *nb)
@@ -308,18 +293,13 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)
308} 293}
309 294
310#define pm_notifier(fn, pri) do { (void)(fn); } while (0) 295#define pm_notifier(fn, pri) do { (void)(fn); } while (0)
296
297static inline bool pm_wakeup_pending(void) { return false; }
311#endif /* !CONFIG_PM_SLEEP */ 298#endif /* !CONFIG_PM_SLEEP */
312 299
313extern struct mutex pm_mutex; 300extern struct mutex pm_mutex;
314 301
315#ifndef CONFIG_HIBERNATION 302#ifndef CONFIG_HIBERNATE_CALLBACKS
316static inline void register_nosave_region(unsigned long b, unsigned long e)
317{
318}
319static inline void register_nosave_region_late(unsigned long b, unsigned long e)
320{
321}
322
323static inline void lock_system_sleep(void) {} 303static inline void lock_system_sleep(void) {}
324static inline void unlock_system_sleep(void) {} 304static inline void unlock_system_sleep(void) {}
325 305