1#ifndef _LINUX_SWSUSP_H 2#define _LINUX_SWSUSP_H 3 4#if defined(CONFIG_X86) || defined(CONFIG_FRV) 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 swp_entry_t dummy; /* we need scratch space at 19 * end of page (see link, diskpage) 20 */ 21} suspend_pagedir_t; 22 23#define SWAP_FILENAME_MAXLENGTH 32 24 25 26#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1) 27 28/* mm/vmscan.c */ 29extern int shrink_mem(void); 30 31/* mm/page_alloc.c */ 32extern void drain_local_pages(void); 33extern void mark_free_pages(struct zone *zone); 34 35#ifdef CONFIG_PM 36/* kernel/power/swsusp.c */ 37extern int software_suspend(void); 38 39extern int pm_prepare_console(void); 40extern void pm_restore_console(void); 41 42#else 43static inline int software_suspend(void) 44{ 45 printk("Warning: fake suspend called\n"); 46 return -EPERM; 47} 48#endif 49 50#ifdef CONFIG_SMP 51extern void disable_nonboot_cpus(void); 52extern void enable_nonboot_cpus(void); 53#else 54static inline void disable_nonboot_cpus(void) {} 55static inline void enable_nonboot_cpus(void) {} 56#endif 57 58void save_processor_state(void); 59void restore_processor_state(void); 60struct saved_context; 61void __save_processor_state(struct saved_context *ctxt); 62void __restore_processor_state(struct saved_context *ctxt); 63 64#endif /* _LINUX_SWSUSP_H */ 65

