summaryrefslogtreecommitdiff
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2002-05-21 01:57:49 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-05-21 01:57:49 -0700
commit542f96a52f55f50dae8b82e11dac096b094202f0 (patch)
tree4b15d74e79d2d137a36f37b93b9494ddeedaeeef /kernel/sys.c
parent79998decd54d550b61538a9248dc49b8db9a01e5 (diff)
[PATCH] suspend-to-{RAM,disk}
Here's suspend-to-{RAM,disk} combined patch for 2.5.17. Suspend-to-disk is pretty stable and was tested in 2.4-ac. Suspend-to-RAM is little more experimental, but works for me, and is certainly better than disk-eating version currently in kernel. Major parts are: process stopper, S3 specific code, S4 specific code.
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 143a77fedd7a..3bd38f344817 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -4,6 +4,7 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/utsname.h>
@@ -347,6 +348,16 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg)
machine_restart(buffer);
break;
+#ifdef CONFIG_SOFTWARE_SUSPEND
+ case LINUX_REBOOT_CMD_SW_SUSPEND:
+ if(!software_suspend_enabled)
+ return -EAGAIN;
+
+ software_suspend();
+ do_exit(0);
+ break;
+#endif
+
default:
unlock_kernel();
return -EINVAL;