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 */ 15typedef 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 27#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1) 28 29/* mm/vmscan.c */ 30extern int shrink_mem(void); 31 32/* mm/page_alloc.c */ 33extern void drain_local_pages(void); 34 35/* kernel/power/swsusp.c */ 36extern int software_suspend(void); 37 38#else /* CONFIG_SOFTWARE_SUSPEND */ 39static inline int software_suspend(void) 40{ 41 printk("Warning: fake suspend called\n"); 42 return -EPERM; 43} 44#endif /* CONFIG_SOFTWARE_SUSPEND */ 45 46 47#ifdef CONFIG_PM 48extern void refrigerator(unsigned long); 49extern int freeze_processes(void); 50extern void thaw_processes(void); 51 52extern int pm_prepare_console(void); 53extern void pm_restore_console(void); 54 55#else 56static inline void refrigerator(unsigned long flag) {} 57#endif /* CONFIG_PM */ 58 59#ifdef CONFIG_SMP 60extern void disable_nonboot_cpus(void); 61extern void enable_nonboot_cpus(void); 62#else 63static inline void disable_nonboot_cpus(void) {} 64static inline void enable_nonboot_cpus(void) {} 65#endif 66 67void save_processor_state(void); 68void restore_processor_state(void); 69struct saved_context; 70void __save_processor_state(struct saved_context *ctxt); 71void __restore_processor_state(struct saved_context *ctxt); 72 73#endif /* _LINUX_SWSUSP_H */ 74

