Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | #ifndef _LINUX_SWSUSP_H |
2 | #define _LINUX_SWSUSP_H |
||
3 | |||
4 | #ifdef CONFIG_X86 |
||
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 | #ifdef CONFIG_PM |
||
14 | /* page backup entry */ |
||
15 | typedef struct pbe { |
||
16 | unsigned long address; /* address of the copy */ |
||
17 | unsigned long orig_address; /* original address of page */ |
||
18 | swp_entry_t swap_address; |
||
19 | swp_entry_t dummy; /* we need scratch space at |
||
20 | * end of page (see link, diskpage) |
||
21 | */ |
||
22 | } suspend_pagedir_t; |
||
23 | |||
24 | #define SWAP_FILENAME_MAXLENGTH 32 |
||
25 | |||
26 | struct suspend_header { |
||
27 | __u32 version_code; |
||
28 | unsigned long num_physpages; |
||
29 | char machine[8]; |
||
30 | char version[20]; |
||
31 | int num_cpus; |
||
32 | int page_size; |
||
33 | suspend_pagedir_t *suspend_pagedir; |
||
34 | unsigned int num_pbes; |
||
35 | struct swap_location { |
||
36 | char filename[SWAP_FILENAME_MAXLENGTH]; |
||
37 | } swap_location[MAX_SWAPFILES]; |
||
38 | }; |
||
39 | |||
40 | #define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1) |
||
41 | |||
42 | /* mm/vmscan.c */ |
||
43 | extern int shrink_mem(void); |
||
44 | |||
45 | /* mm/page_alloc.c */ |
||
46 | extern void drain_local_pages(void); |
||
47 | |||
48 | extern unsigned int nr_copy_pages __nosavedata; |
||
49 | extern suspend_pagedir_t *pagedir_nosave __nosavedata; |
||
50 | #endif /* CONFIG_PM */ |
||
51 | |||
52 | #ifdef CONFIG_SOFTWARE_SUSPEND |
||
53 | |||
54 | extern unsigned char software_suspend_enabled; |
||
55 | |||
56 | extern void software_suspend(void); |
||
57 | #else /* CONFIG_SOFTWARE_SUSPEND */ |
||
58 | static inline void software_suspend(void) |
||
59 | { |
||
60 | printk("Warning: fake suspend called\n"); |
||
61 | } |
||
62 | #endif /* CONFIG_SOFTWARE_SUSPEND */ |
||
63 | |||
64 | |||
65 | #ifdef CONFIG_PM |
||
66 | extern void refrigerator(unsigned long); |
||
67 | |||
68 | #else |
||
69 | static inline void refrigerator(unsigned long flag) |
||
70 | { |
||
71 | |||
72 | } |
||
73 | #endif /* CONFIG_PM */ |
||
74 | |||
75 | #endif /* _LINUX_SWSUSP_H */ |