diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2006-03-23 05:59:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:07 -0500 |
commit | f577eb30afdc68233f25d4d82b04102129262365 (patch) | |
tree | 25d3c2fa8dfbf42fd0d4776a36166736fcc1446a /kernel/power/power.h | |
parent | 2b322ce210aec74ae0d02938d3a01e29fe079469 (diff) |
[PATCH] swsusp: low level interface
Introduce the low level interface that can be used for handling the
snapshot of the system memory by the in-kernel swap-writing/reading code of
swsusp and the userland interface code (to be introduced shortly).
Also change the way in which swsusp records the allocated swap pages and,
consequently, simplifies the in-kernel swap-writing/reading code (this is
necessary for the userland interface too). To this end, it introduces two
helper functions in mm/swapfile.c, so that the swsusp code does not refer
directly to the swap internals.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r-- | kernel/power/power.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h index 388dba680841..ea7132ed029b 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h | |||
@@ -37,21 +37,31 @@ extern struct subsystem power_subsys; | |||
37 | /* References to section boundaries */ | 37 | /* References to section boundaries */ |
38 | extern const void __nosave_begin, __nosave_end; | 38 | extern const void __nosave_begin, __nosave_end; |
39 | 39 | ||
40 | extern unsigned int nr_copy_pages; | ||
41 | extern struct pbe *pagedir_nosave; | 40 | extern struct pbe *pagedir_nosave; |
42 | 41 | ||
43 | /* Preferred image size in bytes (default 500 MB) */ | 42 | /* Preferred image size in bytes (default 500 MB) */ |
44 | extern unsigned long image_size; | 43 | extern unsigned long image_size; |
45 | 44 | ||
45 | extern int in_suspend; | ||
46 | |||
46 | extern asmlinkage int swsusp_arch_suspend(void); | 47 | extern asmlinkage int swsusp_arch_suspend(void); |
47 | extern asmlinkage int swsusp_arch_resume(void); | 48 | extern asmlinkage int swsusp_arch_resume(void); |
48 | 49 | ||
49 | extern unsigned int count_data_pages(void); | 50 | extern unsigned int count_data_pages(void); |
50 | extern void free_pagedir(struct pbe *pblist); | ||
51 | extern void release_eaten_pages(void); | ||
52 | extern struct pbe *alloc_pagedir(unsigned nr_pages, gfp_t gfp_mask, int safe_needed); | ||
53 | extern void swsusp_free(void); | 51 | extern void swsusp_free(void); |
54 | extern int alloc_data_pages(struct pbe *pblist, gfp_t gfp_mask, int safe_needed); | 52 | |
55 | extern unsigned int snapshot_nr_pages(void); | 53 | struct snapshot_handle { |
56 | extern struct pbe *snapshot_pblist(void); | 54 | loff_t offset; |
57 | extern void snapshot_pblist_set(struct pbe *pblist); | 55 | unsigned int page; |
56 | unsigned int page_offset; | ||
57 | unsigned int prev; | ||
58 | struct pbe *pbe; | ||
59 | void *buffer; | ||
60 | unsigned int buf_offset; | ||
61 | }; | ||
62 | |||
63 | #define data_of(handle) ((handle).buffer + (handle).buf_offset) | ||
64 | |||
65 | extern int snapshot_read_next(struct snapshot_handle *handle, size_t count); | ||
66 | extern int snapshot_write_next(struct snapshot_handle *handle, size_t count); | ||
67 | int snapshot_image_loaded(struct snapshot_handle *handle); | ||