1 #include <linux/suspend.h>
2 #include <linux/utsname.h>
4 /* With SUSPEND_CONSOLE defined suspend looks *really* cool, but
5 we probably do not take enough locks for switching consoles, etc,
6 so bad things might happen.
8 #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
9 #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
12 #define MAX_PBES ((PAGE_SIZE - sizeof(struct new_utsname) \
13 - 4 - 3*sizeof(unsigned long) - sizeof(int) \
14 - sizeof(void *)) / sizeof(swp_entry_t))
17 struct new_utsname uts
;
19 unsigned long num_physpages
;
21 unsigned long image_pages
;
22 unsigned long pagedir_pages
;
23 suspend_pagedir_t
* suspend_pagedir
;
24 swp_entry_t pagedir
[MAX_PBES
];
25 } __attribute__((aligned(PAGE_SIZE
)));
29 #ifdef CONFIG_SOFTWARE_SUSPEND
30 extern int pm_suspend_disk(void);
33 static inline int pm_suspend_disk(void)
38 extern struct semaphore pm_sem
;
39 #define power_attr(_name) \
40 static struct subsys_attribute _name##_attr = { \
42 .name = __stringify(_name), \
45 .show = _name##_show, \
46 .store = _name##_store, \
49 extern struct subsystem power_subsys
;
51 extern int freeze_processes(void);
52 extern void thaw_processes(void);
54 extern int pm_prepare_console(void);
55 extern void pm_restore_console(void);
58 /* References to section boundaries */
59 extern const void __nosave_begin
, __nosave_end
;
61 extern unsigned int nr_copy_pages
;
62 extern suspend_pagedir_t
*pagedir_nosave
;
63 extern suspend_pagedir_t
*pagedir_save
;
65 extern asmlinkage
int swsusp_arch_suspend(void);
66 extern asmlinkage
int swsusp_arch_resume(void);
68 extern void free_pagedir(struct pbe
*pblist
);
69 extern struct pbe
*alloc_pagedir(unsigned nr_pages
, gfp_t gfp_mask
, int safe_needed
);
70 extern void create_pbe_list(struct pbe
*pblist
, unsigned nr_pages
);
71 extern void swsusp_free(void);
72 extern int alloc_data_pages(struct pbe
*pblist
, gfp_t gfp_mask
, int safe_needed
);