]> err.no Git - linux-2.6/blobdiff - include/linux/suspend.h
KVM: MMU: Avoid calling gfn_to_page() in mmu_set_spte()
[linux-2.6] / include / linux / suspend.h
index dee416c5477fd491cae28e87db2e025586e19de2..40280df2a3dbc5d91d61291f8793f3d98b989cbc 100644 (file)
@@ -127,23 +127,56 @@ extern void drain_local_pages(void);
 extern void mark_free_pages(struct zone *zone);
 
 /**
- * struct hibernation_ops - hibernation platform support
+ * struct platform_hibernation_ops - hibernation platform support
  *
  * The methods in this structure allow a platform to override the default
  * mechanism of shutting down the machine during a hibernation transition.
  *
  * All three methods must be assigned.
  *
- * @prepare: prepare system for hibernation
- * @enter: shut down system after state has been saved to disk
- * @finish: finish/clean up after state has been reloaded
- * @pre_restore: prepare system for the restoration from a hibernation image
- * @restore_cleanup: clean up after a failing image restoration
+ * @start: Tell the platform driver that we're starting hibernation.
+ *     Called right after shrinking memory and before freezing devices.
+ *
+ * @pre_snapshot: Prepare the platform for creating the hibernation image.
+ *     Called right after devices have been frozen and before the nonboot
+ *     CPUs are disabled (runs with IRQs on).
+ *
+ * @finish: Restore the previous state of the platform after the hibernation
+ *     image has been created *or* put the platform into the normal operation
+ *     mode after the hibernation (the same method is executed in both cases).
+ *     Called right after the nonboot CPUs have been enabled and before
+ *     thawing devices (runs with IRQs on).
+ *
+ * @prepare: Prepare the platform for entering the low power state.
+ *     Called right after the hibernation image has been saved and before
+ *     devices are prepared for entering the low power state.
+ *
+ * @enter: Put the system into the low power state after the hibernation image
+ *     has been saved to disk.
+ *     Called after the nonboot CPUs have been disabled and all of the low
+ *     level devices have been shut down (runs with IRQs off).
+ *
+ * @leave: Perform the first stage of the cleanup after the system sleep state
+ *     indicated by @set_target() has been left.
+ *     Called right after the control has been passed from the boot kernel to
+ *     the image kernel, before the nonboot CPUs are enabled and before devices
+ *     are resumed.  Executed with interrupts disabled.
+ *
+ * @pre_restore: Prepare system for the restoration from a hibernation image.
+ *     Called right after devices have been frozen and before the nonboot
+ *     CPUs are disabled (runs with IRQs on).
+ *
+ * @restore_cleanup: Clean up after a failing image restoration.
+ *     Called right after the nonboot CPUs have been enabled and before
+ *     thawing devices (runs with IRQs on).
  */
-struct hibernation_ops {
+struct platform_hibernation_ops {
+       int (*start)(void);
+       int (*pre_snapshot)(void);
+       void (*finish)(void);
        int (*prepare)(void);
        int (*enter)(void);
-       void (*finish)(void);
+       void (*leave)(void);
        int (*pre_restore)(void);
        void (*restore_cleanup)(void);
 };
@@ -164,23 +197,20 @@ extern void swsusp_set_page_free(struct page *);
 extern void swsusp_unset_page_free(struct page *);
 extern unsigned long get_safe_page(gfp_t gfp_mask);
 
-extern void hibernation_set_ops(struct hibernation_ops *ops);
+extern void hibernation_set_ops(struct platform_hibernation_ops *ops);
 extern int hibernate(void);
 #else /* CONFIG_HIBERNATION */
 static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
 static inline void swsusp_set_page_free(struct page *p) {}
 static inline void swsusp_unset_page_free(struct page *p) {}
 
-static inline void hibernation_set_ops(struct hibernation_ops *ops) {}
+static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {}
 static inline int hibernate(void) { return -ENOSYS; }
 #endif /* CONFIG_HIBERNATION */
 
 #ifdef CONFIG_PM_SLEEP
 void save_processor_state(void);
 void restore_processor_state(void);
-struct saved_context;
-void __save_processor_state(struct saved_context *ctxt);
-void __restore_processor_state(struct saved_context *ctxt);
 
 /* kernel/power/main.c */
 extern struct blocking_notifier_head pm_chain_head;