aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/power.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r--kernel/power/power.h42
1 files changed, 18 insertions, 24 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 33bd94ceba32..34b43542785a 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -14,8 +14,18 @@ struct swsusp_info {
14 14
15 15
16#ifdef CONFIG_SOFTWARE_SUSPEND 16#ifdef CONFIG_SOFTWARE_SUSPEND
17extern int pm_suspend_disk(void); 17/*
18 * Keep some memory free so that I/O operations can succeed without paging
19 * [Might this be more than 4 MB?]
20 */
21#define PAGES_FOR_IO ((4096 * 1024) >> PAGE_SHIFT)
22/*
23 * Keep 1 MB of memory free so that device drivers can allocate some pages in
24 * their .suspend() routines without breaking the suspend to disk.
25 */
26#define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT)
18 27
28extern int pm_suspend_disk(void);
19#else 29#else
20static inline int pm_suspend_disk(void) 30static inline int pm_suspend_disk(void)
21{ 31{
@@ -48,6 +58,8 @@ extern sector_t swsusp_resume_block;
48extern asmlinkage int swsusp_arch_suspend(void); 58extern asmlinkage int swsusp_arch_suspend(void);
49extern asmlinkage int swsusp_arch_resume(void); 59extern asmlinkage int swsusp_arch_resume(void);
50 60
61extern int create_basic_memory_bitmaps(void);
62extern void free_basic_memory_bitmaps(void);
51extern unsigned int count_data_pages(void); 63extern unsigned int count_data_pages(void);
52 64
53/** 65/**
@@ -138,30 +150,12 @@ struct resume_swap_area {
138#define PMOPS_ENTER 2 150#define PMOPS_ENTER 2
139#define PMOPS_FINISH 3 151#define PMOPS_FINISH 3
140 152
141/** 153/* If unset, the snapshot device cannot be open. */
142 * The bitmap is used for tracing allocated swap pages 154extern atomic_t snapshot_device_available;
143 *
144 * The entire bitmap consists of a number of bitmap_page
145 * structures linked with the help of the .next member.
146 * Thus each page can be allocated individually, so we only
147 * need to make 0-order memory allocations to create
148 * the bitmap.
149 */
150
151#define BITMAP_PAGE_SIZE (PAGE_SIZE - sizeof(void *))
152#define BITMAP_PAGE_CHUNKS (BITMAP_PAGE_SIZE / sizeof(long))
153#define BITS_PER_CHUNK (sizeof(long) * 8)
154#define BITMAP_PAGE_BITS (BITMAP_PAGE_CHUNKS * BITS_PER_CHUNK)
155
156struct bitmap_page {
157 unsigned long chunks[BITMAP_PAGE_CHUNKS];
158 struct bitmap_page *next;
159};
160 155
161extern void free_bitmap(struct bitmap_page *bitmap); 156extern sector_t alloc_swapdev_block(int swap);
162extern struct bitmap_page *alloc_bitmap(unsigned int nr_bits); 157extern void free_all_swap_pages(int swap);
163extern sector_t alloc_swapdev_block(int swap, struct bitmap_page *bitmap); 158extern int swsusp_swap_in_use(void);
164extern void free_all_swap_pages(int swap, struct bitmap_page *bitmap);
165 159
166extern int swsusp_check(void); 160extern int swsusp_check(void);
167extern int swsusp_shrink_memory(void); 161extern int swsusp_shrink_memory(void);