Skip to content

Commit 25761b6

Browse files
rjwysockiLinus Torvalds
authored andcommitted
[PATCH] swsusp: move snapshot functionality to separate file
The following patch moves the functionality of swsusp related to creating and handling the snapshot of memory to a separate file, snapshot.c This should enable us to untangle the code in the future and eventually to implement some parts of swsusp.c in the user space. The patch does not change the code. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 351619b commit 25761b6

5 files changed

Lines changed: 492 additions & 437 deletions

File tree

‎include/linux/suspend.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,10 @@ void __restore_processor_state(struct saved_context *ctxt);
7474
extern unsigned long get_usable_page(gfp_t gfp_mask);
7575
extern void free_eaten_memory(void);
7676

77+
/*
78+
* XXX: We try to keep some more pages free so that I/O operations succeed
79+
* without paging. Might this be more?
80+
*/
81+
#define PAGES_FOR_IO 512
82+
7783
#endif /* _LINUX_SWSUSP_H */

‎kernel/power/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ EXTRA_CFLAGS += -DDEBUG
44
endif
55

66
obj-y := main.o process.o console.o pm.o
7-
obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o disk.o
7+
obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o disk.o snapshot.o
88

99
obj-$(CONFIG_SUSPEND_SMP) += smp.o
1010

‎kernel/power/power.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,20 @@ extern void thaw_processes(void);
5353

5454
extern int pm_prepare_console(void);
5555
extern void pm_restore_console(void);
56+
57+
58+
/* References to section boundaries */
59+
extern const void __nosave_begin, __nosave_end;
60+
61+
extern unsigned int nr_copy_pages;
62+
extern suspend_pagedir_t *pagedir_nosave;
63+
extern suspend_pagedir_t *pagedir_save;
64+
65+
extern asmlinkage int swsusp_arch_suspend(void);
66+
extern asmlinkage int swsusp_arch_resume(void);
67+
68+
extern int restore_highmem(void);
69+
extern void free_pagedir(struct pbe *pblist);
70+
extern struct pbe * alloc_pagedir(unsigned nr_pages);
71+
extern void create_pbe_list(struct pbe *pblist, unsigned nr_pages);
72+
extern int enough_swap(void);

0 commit comments

Comments
 (0)