diff options
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r-- | kernel/power/power.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h index bfe999f7b272..eb461b816bf4 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h | |||
@@ -22,7 +22,9 @@ static inline int pm_suspend_disk(void) | |||
22 | return -EPERM; | 22 | return -EPERM; |
23 | } | 23 | } |
24 | #endif | 24 | #endif |
25 | extern struct semaphore pm_sem; | 25 | |
26 | extern struct mutex pm_mutex; | ||
27 | |||
26 | #define power_attr(_name) \ | 28 | #define power_attr(_name) \ |
27 | static struct subsys_attribute _name##_attr = { \ | 29 | static struct subsys_attribute _name##_attr = { \ |
28 | .attr = { \ | 30 | .attr = { \ |
@@ -42,6 +44,7 @@ extern const void __nosave_begin, __nosave_end; | |||
42 | extern unsigned long image_size; | 44 | extern unsigned long image_size; |
43 | extern int in_suspend; | 45 | extern int in_suspend; |
44 | extern dev_t swsusp_resume_device; | 46 | extern dev_t swsusp_resume_device; |
47 | extern sector_t swsusp_resume_block; | ||
45 | 48 | ||
46 | extern asmlinkage int swsusp_arch_suspend(void); | 49 | extern asmlinkage int swsusp_arch_suspend(void); |
47 | extern asmlinkage int swsusp_arch_resume(void); | 50 | extern asmlinkage int swsusp_arch_resume(void); |
@@ -102,8 +105,18 @@ struct snapshot_handle { | |||
102 | extern unsigned int snapshot_additional_pages(struct zone *zone); | 105 | extern unsigned int snapshot_additional_pages(struct zone *zone); |
103 | extern int snapshot_read_next(struct snapshot_handle *handle, size_t count); | 106 | extern int snapshot_read_next(struct snapshot_handle *handle, size_t count); |
104 | extern int snapshot_write_next(struct snapshot_handle *handle, size_t count); | 107 | extern int snapshot_write_next(struct snapshot_handle *handle, size_t count); |
108 | extern void snapshot_write_finalize(struct snapshot_handle *handle); | ||
105 | extern int snapshot_image_loaded(struct snapshot_handle *handle); | 109 | extern int snapshot_image_loaded(struct snapshot_handle *handle); |
106 | extern void snapshot_free_unused_memory(struct snapshot_handle *handle); | 110 | |
111 | /* | ||
112 | * This structure is used to pass the values needed for the identification | ||
113 | * of the resume swap area from a user space to the kernel via the | ||
114 | * SNAPSHOT_SET_SWAP_AREA ioctl | ||
115 | */ | ||
116 | struct resume_swap_area { | ||
117 | loff_t offset; | ||
118 | u_int32_t dev; | ||
119 | } __attribute__((packed)); | ||
107 | 120 | ||
108 | #define SNAPSHOT_IOC_MAGIC '3' | 121 | #define SNAPSHOT_IOC_MAGIC '3' |
109 | #define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1) | 122 | #define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1) |
@@ -117,7 +130,14 @@ extern void snapshot_free_unused_memory(struct snapshot_handle *handle); | |||
117 | #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) | 130 | #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) |
118 | #define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int) | 131 | #define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int) |
119 | #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) | 132 | #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) |
120 | #define SNAPSHOT_IOC_MAXNR 11 | 133 | #define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int) |
134 | #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ | ||
135 | struct resume_swap_area) | ||
136 | #define SNAPSHOT_IOC_MAXNR 13 | ||
137 | |||
138 | #define PMOPS_PREPARE 1 | ||
139 | #define PMOPS_ENTER 2 | ||
140 | #define PMOPS_FINISH 3 | ||
121 | 141 | ||
122 | /** | 142 | /** |
123 | * The bitmap is used for tracing allocated swap pages | 143 | * The bitmap is used for tracing allocated swap pages |
@@ -141,7 +161,7 @@ struct bitmap_page { | |||
141 | 161 | ||
142 | extern void free_bitmap(struct bitmap_page *bitmap); | 162 | extern void free_bitmap(struct bitmap_page *bitmap); |
143 | extern struct bitmap_page *alloc_bitmap(unsigned int nr_bits); | 163 | extern struct bitmap_page *alloc_bitmap(unsigned int nr_bits); |
144 | extern unsigned long alloc_swap_page(int swap, struct bitmap_page *bitmap); | 164 | extern sector_t alloc_swapdev_block(int swap, struct bitmap_page *bitmap); |
145 | extern void free_all_swap_pages(int swap, struct bitmap_page *bitmap); | 165 | extern void free_all_swap_pages(int swap, struct bitmap_page *bitmap); |
146 | 166 | ||
147 | extern int swsusp_check(void); | 167 | extern int swsusp_check(void); |
@@ -153,3 +173,7 @@ extern int swsusp_read(void); | |||
153 | extern int swsusp_write(void); | 173 | extern int swsusp_write(void); |
154 | extern void swsusp_close(void); | 174 | extern void swsusp_close(void); |
155 | extern int suspend_enter(suspend_state_t state); | 175 | extern int suspend_enter(suspend_state_t state); |
176 | |||
177 | struct timeval; | ||
178 | extern void swsusp_show_speed(struct timeval *, struct timeval *, | ||
179 | unsigned int, char *); | ||