aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-19 02:32:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-19 02:32:36 -0700
commitbf7c3d2de183a1c138ac667e41be357ce59f5998 (patch)
tree4b8e80989797cc6f4a697226889ba5b09aea0251 /kernel
parent2e7d2212302b8b660963aef7386d6719703f339d (diff)
downloadhistory-bf7c3d2de183a1c138ac667e41be357ce59f5998.tar.gz
[PATCH] system_state splitup
Split the system_state state `SYSTEM_SHUTDOWN' into SYSTEM_HALT, SYSTEM_POWER_OFF and SYSTEM_RESTART and export system_state to modules. This allows driver shutdown routines to know why they are being shutdown. The IDE subsystem wants this so that it knows to not spin the disks down across a reboot.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index ece6365b8c450d..14d58b2f983ac9 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -451,7 +451,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
switch (cmd) {
case LINUX_REBOOT_CMD_RESTART:
notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL);
- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_RESTART;
device_shutdown();
printk(KERN_EMERG "Restarting system.\n");
machine_restart(NULL);
@@ -467,7 +467,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
case LINUX_REBOOT_CMD_HALT:
notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_HALT;
device_shutdown();
printk(KERN_EMERG "System halted.\n");
machine_halt();
@@ -477,7 +477,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
case LINUX_REBOOT_CMD_POWER_OFF:
notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_POWER_OFF;
device_shutdown();
printk(KERN_EMERG "Power down.\n");
machine_power_off();
@@ -493,7 +493,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
buffer[sizeof(buffer) - 1] = '\0';
notifier_call_chain(&reboot_notifier_list, SYS_RESTART, buffer);
- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_RESTART;
device_shutdown();
printk(KERN_EMERG "Restarting system with command '%s'.\n", buffer);
machine_restart(buffer);