1 #ifndef _LINUX_SWSUSP_H
2 #define _LINUX_SWSUSP_H
5 #include <asm/suspend.h>
7 #include <linux/swap.h>
8 #include <linux/notifier.h>
9 #include <linux/config.h>
10 #include <linux/init.h>
14 /* page backup entry */
16 unsigned long address; /* address of the copy */
17 unsigned long orig_address; /* original address of page */
18 swp_entry_t swap_address;
19 swp_entry_t dummy; /* we need scratch space at
20 * end of page (see link, diskpage)
24 #define SWAP_FILENAME_MAXLENGTH 32
26 struct suspend_header {
28 unsigned long num_physpages;
33 suspend_pagedir_t *suspend_pagedir;
34 unsigned int num_pbes;
37 #define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1)
40 extern int shrink_mem(void);
43 extern void drain_local_pages(void);
45 /* kernel/power/swsusp.c */
46 extern int software_suspend(void);
48 extern unsigned int nr_copy_pages __nosavedata;
49 extern suspend_pagedir_t *pagedir_nosave __nosavedata;
51 #else /* CONFIG_SOFTWARE_SUSPEND */
52 static inline int software_suspend(void)
54 printk("Warning: fake suspend called\n");
57 #define software_resume() do { } while(0)
58 #endif /* CONFIG_SOFTWARE_SUSPEND */
62 extern void refrigerator(unsigned long);
63 extern int freeze_processes(void);
64 extern void thaw_processes(void);
66 extern int pm_prepare_console(void);
67 extern void pm_restore_console(void);
70 static inline void refrigerator(unsigned long flag) {}
71 #endif /* CONFIG_PM */
74 extern void disable_nonboot_cpus(void);
75 extern void enable_nonboot_cpus(void);
77 static inline void disable_nonboot_cpus(void) {}
78 static inline void enable_nonboot_cpus(void) {}
81 asmlinkage void do_magic(int is_resume);
82 asmlinkage void do_magic_resume_1(void);
83 asmlinkage void do_magic_resume_2(void);
84 asmlinkage void do_magic_suspend_1(void);
85 asmlinkage void do_magic_suspend_2(void);
87 void save_processor_state(void);
88 void restore_processor_state(void);
90 void __save_processor_state(struct saved_context *ctxt);
91 void __restore_processor_state(struct saved_context *ctxt);
93 #endif /* _LINUX_SWSUSP_H */