[PATCH] swsusp: make image size limit tunable
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / kernel / power / power.h
blob273a5b1d70be7fe190fff428f8e85da80b758bb0
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.
7 */
8 #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
9 #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
10 #endif
12 struct swsusp_info {
13 struct new_utsname uts;
14 u32 version_code;
15 unsigned long num_physpages;
16 int cpus;
17 unsigned long image_pages;
18 unsigned long pages;
19 swp_entry_t start;
20 } __attribute__((aligned(PAGE_SIZE)));
24 #ifdef CONFIG_SOFTWARE_SUSPEND
25 extern int pm_suspend_disk(void);
27 #else
28 static inline int pm_suspend_disk(void)
30 return -EPERM;
32 #endif
33 extern struct semaphore pm_sem;
34 #define power_attr(_name) \
35 static struct subsys_attribute _name##_attr = { \
36 .attr = { \
37 .name = __stringify(_name), \
38 .mode = 0644, \
39 }, \
40 .show = _name##_show, \
41 .store = _name##_store, \
44 extern struct subsystem power_subsys;
46 extern int pm_prepare_console(void);
47 extern void pm_restore_console(void);
49 /* References to section boundaries */
50 extern const void __nosave_begin, __nosave_end;
52 extern unsigned int nr_copy_pages;
53 extern struct pbe *pagedir_nosave;
55 /* Preferred image size in MB (default 500) */
56 extern unsigned int image_size;
58 extern asmlinkage int swsusp_arch_suspend(void);
59 extern asmlinkage int swsusp_arch_resume(void);
61 extern unsigned int count_data_pages(void);
62 extern void free_pagedir(struct pbe *pblist);
63 extern void release_eaten_pages(void);
64 extern struct pbe *alloc_pagedir(unsigned nr_pages, gfp_t gfp_mask, int safe_needed);
65 extern void swsusp_free(void);
66 extern int alloc_data_pages(struct pbe *pblist, gfp_t gfp_mask, int safe_needed);
67 extern unsigned int snapshot_nr_pages(void);
68 extern struct pbe *snapshot_pblist(void);
69 extern void snapshot_pblist_set(struct pbe *pblist);