2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* linux/kernel/power/swsusp.c
|
|
|
|
*
|
2005-10-31 06:59:58 +08:00
|
|
|
* This file provides code to write suspend image to swap and read it back.
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 1998-2001 Gabor Kuti <seasons@fornax.hu>
|
2005-10-31 06:59:56 +08:00
|
|
|
* Copyright (C) 1998,2001-2005 Pavel Machek <pavel@suse.cz>
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* This file is released under the GPLv2.
|
|
|
|
*
|
|
|
|
* I'd like to thank the following people for their work:
|
2005-06-26 05:55:12 +08:00
|
|
|
*
|
2005-04-17 06:20:36 +08:00
|
|
|
* Pavel Machek <pavel@ucw.cz>:
|
|
|
|
* Modifications, defectiveness pointing, being with me at the very beginning,
|
|
|
|
* suspend to swap space, stop all tasks. Port to 2.4.18-ac and 2.5.17.
|
|
|
|
*
|
2005-06-26 05:55:12 +08:00
|
|
|
* Steve Doddi <dirk@loth.demon.co.uk>:
|
2005-04-17 06:20:36 +08:00
|
|
|
* Support the possibility of hardware state restoring.
|
|
|
|
*
|
|
|
|
* Raph <grey.havens@earthling.net>:
|
|
|
|
* Support for preserving states of network devices and virtual console
|
|
|
|
* (including X and svgatextmode)
|
|
|
|
*
|
|
|
|
* Kurt Garloff <garloff@suse.de>:
|
|
|
|
* Straightened the critical function in order to prevent compilers from
|
|
|
|
* playing tricks with local variables.
|
|
|
|
*
|
|
|
|
* Andreas Mohr <a.mohr@mailto.de>
|
|
|
|
*
|
|
|
|
* Alex Badea <vampire@go.ro>:
|
|
|
|
* Fixed runaway init
|
|
|
|
*
|
2006-01-06 16:13:05 +08:00
|
|
|
* Rafael J. Wysocki <rjw@sisk.pl>
|
2006-03-23 19:00:00 +08:00
|
|
|
* Reworked the freeing of memory and the handling of swap
|
2006-01-06 16:13:05 +08:00
|
|
|
*
|
2005-04-17 06:20:36 +08:00
|
|
|
* More state savers are welcome. Especially for the scsi layer...
|
|
|
|
*
|
|
|
|
* For TODOs,FIXMEs also look in Documentation/power/swsusp.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/suspend.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/major.h>
|
|
|
|
#include <linux/swap.h>
|
|
|
|
#include <linux/pm.h>
|
|
|
|
#include <linux/swapops.h>
|
|
|
|
#include <linux/bootmem.h>
|
|
|
|
#include <linux/syscalls.h>
|
|
|
|
#include <linux/highmem.h>
|
2006-12-07 12:34:32 +08:00
|
|
|
#include <linux/time.h>
|
2007-05-07 05:50:47 +08:00
|
|
|
#include <linux/rbtree.h>
|
2009-04-01 06:23:37 +08:00
|
|
|
#include <linux/io.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include "power.h"
|
|
|
|
|
2006-03-23 18:59:59 +08:00
|
|
|
int in_suspend __nosavedata = 0;
|