]> err.no Git - linux-2.6/blobdiff - kernel/power/power.h
rtl8187: Improve wireless statistics for RTL8187B
[linux-2.6] / kernel / power / power.h
index ef9060576a40a65df08e038f41244b018e4698aa..acc0c101dbd54a510049a329260434d56b3c12f9 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/suspend.h>
 #include <linux/suspend_ioctls.h>
 #include <linux/utsname.h>
+#include <linux/freezer.h>
 
 struct swsusp_info {
        struct new_utsname      uts;
@@ -52,8 +53,6 @@ extern int hibernation_platform_enter(void);
 
 extern int pfn_is_nosave(unsigned long);
 
-extern struct mutex pm_mutex;
-
 #define power_attr(_name) \
 static struct kobj_attribute _name##_attr = {  \
        .attr   = {                             \
@@ -152,7 +151,6 @@ extern int swsusp_swap_in_use(void);
 extern int swsusp_check(void);
 extern int swsusp_shrink_memory(void);
 extern void swsusp_free(void);
-extern int swsusp_resume(void);
 extern int swsusp_read(unsigned int *flags_p);
 extern int swsusp_write(unsigned int flags);
 extern void swsusp_close(void);
@@ -172,11 +170,56 @@ static inline int suspend_devices_and_enter(suspend_state_t state)
 }
 #endif /* !CONFIG_SUSPEND */
 
-/* kernel/power/common.c */
-extern struct blocking_notifier_head pm_chain_head;
+#ifdef CONFIG_PM_SLEEP
+/* kernel/power/main.c */
+extern int pm_notifier_call_chain(unsigned long val);
+#endif
+
+#ifdef CONFIG_HIGHMEM
+unsigned int count_highmem_pages(void);
+int restore_highmem(void);
+#else
+static inline unsigned int count_highmem_pages(void) { return 0; }
+static inline int restore_highmem(void) { return 0; }
+#endif
+
+/*
+ * Suspend test levels
+ */
+enum {
+       /* keep first */
+       TEST_NONE,
+       TEST_CORE,
+       TEST_CPUS,
+       TEST_PLATFORM,
+       TEST_DEVICES,
+       TEST_FREEZER,
+       /* keep last */
+       __TEST_AFTER_LAST
+};
+
+#define TEST_FIRST     TEST_NONE
+#define TEST_MAX       (__TEST_AFTER_LAST - 1)
 
-static inline int pm_notifier_call_chain(unsigned long val)
+extern int pm_test_level;
+
+#ifdef CONFIG_SUSPEND_FREEZER
+static inline int suspend_freeze_processes(void)
+{
+       return freeze_processes();
+}
+
+static inline void suspend_thaw_processes(void)
+{
+       thaw_processes();
+}
+#else
+static inline int suspend_freeze_processes(void)
 {
-       return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
-                       == NOTIFY_BAD) ? -EINVAL : 0;
+       return 0;
 }
+
+static inline void suspend_thaw_processes(void)
+{
+}
+#endif