[PATCH] swsusp: use bytes as image size units
[linux-2.6.git] / kernel / power / power.h
1 #include <linux/suspend.h>
2 #include <linux/utsname.h>
3
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
11
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 } __attribute__((aligned(PAGE_SIZE)));
20
21
22
23 #ifdef CONFIG_SOFTWARE_SUSPEND
24 extern int pm_suspend_disk(void);
25
26 #else
27 static inline int pm_suspend_disk(void)
28 {
29         return -EPERM;
30 }
31 #endif
32 extern struct semaphore pm_sem;
33 #define power_attr(_name) \
34 static struct subsys_attribute _name##_attr = { \
35         .attr   = {                             \
36                 .name = __stringify(_name),     \
37                 .mode = 0644,                   \
38         },                                      \
39         .show   = _name##_show,                 \
40         .store  = _name##_store,                \
41 }
42
43 extern struct subsystem power_subsys;
44
45 extern int pm_prepare_console(void);
46 extern void pm_restore_console(void);
47
48 /* References to section boundaries */
49 extern const void __nosave_begin, __nosave_end;
50
51 extern unsigned int nr_copy_pages;
52 extern struct pbe *pagedir_nosave;
53
54 /* Preferred image size in bytes (default 500 MB) */
55 extern unsigned long image_size;
56
57 extern asmlinkage int swsusp_arch_suspend(void);
58 extern asmlinkage int swsusp_arch_resume(void);
59
60 extern unsigned int count_data_pages(void);
61 extern void free_pagedir(struct pbe *pblist);
62 extern void release_eaten_pages(void);
63 extern struct pbe *alloc_pagedir(unsigned nr_pages, gfp_t gfp_mask, int safe_needed);
64 extern void swsusp_free(void);
65 extern int alloc_data_pages(struct pbe *pblist, gfp_t gfp_mask, int safe_needed);
66 extern unsigned int snapshot_nr_pages(void);
67 extern struct pbe *snapshot_pblist(void);
68 extern void snapshot_pblist_set(struct pbe *pblist);