aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-10-18 06:04:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:18 -0400
commit74f270af0c1ed5b9d4413784256959dcfe3593ce (patch)
tree5b74248167be086b0050a84f9ebe072bbb43fdb3 /include
parentf242d9196fd1ef4e6bf0e50d2e7f32866fb145c2 (diff)
PM: Rework struct hibernation_ops
During hibernation we also need to tell the ACPI core that we're going to put the system into the S4 sleep state. For this reason, an additional method in 'struct hibernation_ops' is needed, playing the role of set_target() in 'struct platform_suspend_operations'. Moreover, the role of the .prepare() method is now different, so it's better to introduce another method, that in general may be different from .prepare(), that will be used to prepare the platform for creating the hibernation image (.prepare() is used anyway to notify the platform that we're going to enter the low power state after the image has been saved). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/suspend.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index dee416c5477f..0044483dd477 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -134,16 +134,42 @@ extern void mark_free_pages(struct zone *zone);
134 * 134 *
135 * All three methods must be assigned. 135 * All three methods must be assigned.
136 * 136 *
137 * @prepare: prepare system for hibernation 137 * @start: Tell the platform driver that we're starting hibernation.
138 * @enter: shut down system after state has been saved to disk 138 * Called right after shrinking memory and before freezing devices.
139 * @finish: finish/clean up after state has been reloaded 139 *
140 * @pre_restore: prepare system for the restoration from a hibernation image 140 * @pre_snapshot: Prepare the platform for creating the hibernation image.
141 * @restore_cleanup: clean up after a failing image restoration 141 * Called right after devices have been frozen and before the nonboot
142 * CPUs are disabled (runs with IRQs on).
143 *
144 * @finish: Restore the previous state of the platform after the hibernation
145 * image has been created *or* put the platform into the normal operation
146 * mode after the hibernation (the same method is executed in both cases).
147 * Called right after the nonboot CPUs have been enabled and before
148 * thawing devices (runs with IRQs on).
149 *
150 * @prepare: Prepare the platform for entering the low power state.
151 * Called right after the hibernation image has been saved and before
152 * devices are prepared for entering the low power state.
153 *
154 * @enter: Put the system into the low power state after the hibernation image
155 * has been saved to disk.
156 * Called after the nonboot CPUs have been disabled and all of the low
157 * level devices have been shut down (runs with IRQs off).
158 *
159 * @pre_restore: Prepare system for the restoration from a hibernation image.
160 * Called right after devices have been frozen and before the nonboot
161 * CPUs are disabled (runs with IRQs on).
162 *
163 * @restore_cleanup: Clean up after a failing image restoration.
164 * Called right after the nonboot CPUs have been enabled and before
165 * thawing devices (runs with IRQs on).
142 */ 166 */
143struct hibernation_ops { 167struct hibernation_ops {
168 int (*start)(void);
169 int (*pre_snapshot)(void);
170 void (*finish)(void);
144 int (*prepare)(void); 171 int (*prepare)(void);
145 int (*enter)(void); 172 int (*enter)(void);
146 void (*finish)(void);
147 int (*pre_restore)(void); 173 int (*pre_restore)(void);
148 void (*restore_cleanup)(void); 174 void (*restore_cleanup)(void);
149}; 175};