| 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/init.h> |
|---|
| 10 | #include <linux/pm.h> |
|---|
| 11 | |
|---|
| 12 | /* page backup entry */ |
|---|
| 13 | typedef struct pbe { |
|---|
| 14 | unsigned long address; /* address of the copy */ |
|---|
| 15 | unsigned long orig_address; /* original address of page */ |
|---|
| 16 | swp_entry_t swap_address; |
|---|
| 17 | |
|---|
| 18 | struct pbe *next; /* also used as scratch space at |
|---|
| 19 | * end of page (see link, diskpage) |
|---|
| 20 | */ |
|---|
| 21 | } suspend_pagedir_t; |
|---|
| 22 | |
|---|
| 23 | #define for_each_pbe(pbe, pblist) \ |
|---|
| 24 | for (pbe = pblist ; pbe ; pbe = pbe->next) |
|---|
| 25 | |
|---|
| 26 | #define PBES_PER_PAGE (PAGE_SIZE/sizeof(struct pbe)) |
|---|
| 27 | #define PB_PAGE_SKIP (PBES_PER_PAGE-1) |
|---|
| 28 | |
|---|
| 29 | #define for_each_pb_page(pbe, pblist) \ |
|---|
| 30 | for (pbe = pblist ; pbe ; pbe = (pbe+PB_PAGE_SKIP)->next) |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | #define SWAP_FILENAME_MAXLENGTH 32 |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | extern dev_t swsusp_resume_device; |
|---|
| 37 | |
|---|
| 38 | /* mm/vmscan.c */ |
|---|
| 39 | extern int shrink_mem(void); |
|---|
| 40 | |
|---|
| 41 | /* mm/page_alloc.c */ |
|---|
| 42 | extern void drain_local_pages(void); |
|---|
| 43 | extern void mark_free_pages(struct zone *zone); |
|---|
| 44 | |
|---|
| 45 | #ifdef CONFIG_PM |
|---|
| 46 | /* kernel/power/swsusp.c */ |
|---|
| 47 | extern int software_suspend(void); |
|---|
| 48 | |
|---|
| 49 | extern int pm_prepare_console(void); |
|---|
| 50 | extern void pm_restore_console(void); |
|---|
| 51 | |
|---|
| 52 | #else |
|---|
| 53 | static inline int software_suspend(void) |
|---|
| 54 | { |
|---|
| 55 | printk("Warning: fake suspend called\n"); |
|---|
| 56 | return -EPERM; |
|---|
| 57 | } |
|---|
| 58 | #endif |
|---|
| 59 | |
|---|
| 60 | #ifdef CONFIG_SMP |
|---|
| 61 | extern void disable_nonboot_cpus(void); |
|---|
| 62 | extern void enable_nonboot_cpus(void); |
|---|
| 63 | #else |
|---|
| 64 | static inline void disable_nonboot_cpus(void) {} |
|---|
| 65 | static inline void enable_nonboot_cpus(void) {} |
|---|
| 66 | #endif |
|---|
| 67 | |
|---|
| 68 | void save_processor_state(void); |
|---|
| 69 | void restore_processor_state(void); |
|---|
| 70 | struct saved_context; |
|---|
| 71 | void __save_processor_state(struct saved_context *ctxt); |
|---|
| 72 | void __restore_processor_state(struct saved_context *ctxt); |
|---|
| 73 | |
|---|
| 74 | #endif /* _LINUX_SWSUSP_H */ |
|---|