suspend.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef _LINUX_SWSUSP_H
  2. #define _LINUX_SWSUSP_H
  3. #if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32)
  4. #include <asm/suspend.h>
  5. #endif
  6. #include <linux/swap.h>
  7. #include <linux/notifier.h>
  8. #include <linux/init.h>
  9. #include <linux/pm.h>
  10. /* struct pbe is used for creating lists of pages that should be restored
  11. * atomically during the resume from disk, because the page frames they have
  12. * occupied before the suspend are in use.
  13. */
  14. struct pbe {
  15. void *address; /* address of the copy */
  16. void *orig_address; /* original address of a page */
  17. struct pbe *next;
  18. };
  19. /* mm/page_alloc.c */
  20. extern void drain_local_pages(void);
  21. extern void mark_free_pages(struct zone *zone);
  22. #ifdef CONFIG_PM
  23. /* kernel/power/swsusp.c */
  24. extern int software_suspend(void);
  25. #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
  26. extern int pm_prepare_console(void);
  27. extern void pm_restore_console(void);
  28. #else
  29. static inline int pm_prepare_console(void) { return 0; }
  30. static inline void pm_restore_console(void) {}
  31. #endif /* defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) */
  32. #else
  33. static inline int software_suspend(void)
  34. {
  35. printk("Warning: fake suspend called\n");
  36. return -ENOSYS;
  37. }
  38. #endif /* CONFIG_PM */
  39. void save_processor_state(void);
  40. void restore_processor_state(void);
  41. struct saved_context;
  42. void __save_processor_state(struct saved_context *ctxt);
  43. void __restore_processor_state(struct saved_context *ctxt);
  44. unsigned long get_safe_page(gfp_t gfp_mask);
  45. /*
  46. * XXX: We try to keep some more pages free so that I/O operations succeed
  47. * without paging. Might this be more?
  48. */
  49. #define PAGES_FOR_IO 1024
  50. #endif /* _LINUX_SWSUSP_H */