aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/suspend.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
new file mode 100644
index 000000000000..2bf0d5fabcdb
--- /dev/null
+++ b/include/linux/suspend.h
@@ -0,0 +1,75 @@
1#ifndef _LINUX_SWSUSP_H
2#define _LINUX_SWSUSP_H
3
4#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32)
5#include <asm/suspend.h>
6#endif
7#include <linux/swap.h>
8#include <linux/notifier.h>
9#include <linux/config.h>
10#include <linux/init.h>
11#include <linux/pm.h>
12
13/* page backup entry */
14typedef struct pbe {
15 unsigned long address; /* address of the copy */
16 unsigned long orig_address; /* original address of page */
17 swp_entry_t swap_address;
18
19 struct pbe *next; /* also used as scratch space at
20 * end of page (see link, diskpage)
21 */
22} suspend_pagedir_t;
23
24#define for_each_pbe(pbe, pblist) \
25 for (pbe = pblist ; pbe ; pbe = pbe->next)
26
27#define PBES_PER_PAGE (PAGE_SIZE/sizeof(struct pbe))
28#define PB_PAGE_SKIP (PBES_PER_PAGE-1)
29
30#define for_each_pb_page(pbe, pblist) \
31 for (pbe = pblist ; pbe ; pbe = (pbe+PB_PAGE_SKIP)->next)
32
33
34#define SWAP_FILENAME_MAXLENGTH 32
35
36
37extern dev_t swsusp_resume_device;
38
39/* mm/vmscan.c */
40extern int shrink_mem(void);
41
42/* mm/page_alloc.c */
43extern void drain_local_pages(void);
44extern void mark_free_pages(struct zone *zone);
45
46#ifdef CONFIG_PM
47/* kernel/power/swsusp.c */
48extern int software_suspend(void);
49
50extern int pm_prepare_console(void);
51extern void pm_restore_console(void);
52
53#else
54static inline int software_suspend(void)
55{
56 printk("Warning: fake suspend called\n");
57 return -EPERM;
58}
59#endif
60
61#ifdef CONFIG_SMP
62extern void disable_nonboot_cpus(void);
63extern void enable_nonboot_cpus(void);
64#else
65static inline void disable_nonboot_cpus(void) {}
66static inline void enable_nonboot_cpus(void) {}
67#endif
68
69void save_processor_state(void);
70void restore_processor_state(void);
71struct saved_context;
72void __save_processor_state(struct saved_context *ctxt);
73void __restore_processor_state(struct saved_context *ctxt);
74
75#endif /* _LINUX_SWSUSP_H */