diff options
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r-- | kernel/power/power.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h new file mode 100644 index 000000000000..cd6a3493cc0d --- /dev/null +++ b/kernel/power/power.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #include <linux/suspend.h> | ||
2 | #include <linux/utsname.h> | ||
3 | |||
4 | /* With SUSPEND_CONSOLE defined, it suspend looks *really* cool, but | ||
5 | we probably do not take enough locks for switching consoles, etc, | ||
6 | so bad things might happen. | ||
7 | */ | ||
8 | #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) | ||
9 | #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1) | ||
10 | #endif | ||
11 | |||
12 | |||
13 | struct swsusp_info { | ||
14 | struct new_utsname uts; | ||
15 | u32 version_code; | ||
16 | unsigned long num_physpages; | ||
17 | int cpus; | ||
18 | unsigned long image_pages; | ||
19 | unsigned long pagedir_pages; | ||
20 | suspend_pagedir_t * suspend_pagedir; | ||
21 | swp_entry_t pagedir[768]; | ||
22 | } __attribute__((aligned(PAGE_SIZE))); | ||
23 | |||
24 | |||
25 | |||
26 | #ifdef CONFIG_SOFTWARE_SUSPEND | ||
27 | extern int pm_suspend_disk(void); | ||
28 | |||
29 | #else | ||
30 | static inline int pm_suspend_disk(void) | ||
31 | { | ||
32 | return -EPERM; | ||
33 | } | ||
34 | #endif | ||
35 | extern struct semaphore pm_sem; | ||
36 | #define power_attr(_name) \ | ||
37 | static struct subsys_attribute _name##_attr = { \ | ||
38 | .attr = { \ | ||
39 | .name = __stringify(_name), \ | ||
40 | .mode = 0644, \ | ||
41 | }, \ | ||
42 | .show = _name##_show, \ | ||
43 | .store = _name##_store, \ | ||
44 | } | ||
45 | |||
46 | extern struct subsystem power_subsys; | ||
47 | |||
48 | extern int freeze_processes(void); | ||
49 | extern void thaw_processes(void); | ||
50 | |||
51 | extern int pm_prepare_console(void); | ||
52 | extern void pm_restore_console(void); | ||