aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>2005-12-01 04:29:00 -0500
committerLen Brown <len.brown@intel.com>2005-12-15 13:28:14 -0500
commit729b4d4ce1982c52040bbf22d6711cdf8db07ad8 (patch)
tree1ae8b12dcbcd17c364f2df28db8ab3db9c8b89a2 /kernel/sys.c
parent7116317dc9148d783846299fc80a7d377baa6dca (diff)
[ACPI] fix reboot upon suspend-to-disk
http://bugzilla.kernel.org/show_bug.cgi?id=4320 Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index eecf84526afe..c3b1874661fa 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -427,23 +427,25 @@ void kernel_kexec(void)
427} 427}
428EXPORT_SYMBOL_GPL(kernel_kexec); 428EXPORT_SYMBOL_GPL(kernel_kexec);
429 429
430void kernel_shutdown_prepare(enum system_states state)
431{
432 notifier_call_chain(&reboot_notifier_list,
433 (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
434 system_state = state;
435 device_shutdown();
436}
430/** 437/**
431 * kernel_halt - halt the system 438 * kernel_halt - halt the system
432 * 439 *
433 * Shutdown everything and perform a clean system halt. 440 * Shutdown everything and perform a clean system halt.
434 */ 441 */
435void kernel_halt_prepare(void)
436{
437 notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
438 system_state = SYSTEM_HALT;
439 device_shutdown();
440}
441void kernel_halt(void) 442void kernel_halt(void)
442{ 443{
443 kernel_halt_prepare(); 444 kernel_shutdown_prepare(SYSTEM_HALT);
444 printk(KERN_EMERG "System halted.\n"); 445 printk(KERN_EMERG "System halted.\n");
445 machine_halt(); 446 machine_halt();
446} 447}
448
447EXPORT_SYMBOL_GPL(kernel_halt); 449EXPORT_SYMBOL_GPL(kernel_halt);
448 450
449/** 451/**
@@ -451,20 +453,13 @@ EXPORT_SYMBOL_GPL(kernel_halt);
451 * 453 *
452 * Shutdown everything and perform a clean system power_off. 454 * Shutdown everything and perform a clean system power_off.
453 */ 455 */
454void kernel_power_off_prepare(void)
455{
456 notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
457 system_state = SYSTEM_POWER_OFF;
458 device_shutdown();
459}
460void kernel_power_off(void) 456void kernel_power_off(void)
461{ 457{
462 kernel_power_off_prepare(); 458 kernel_shutdown_prepare(SYSTEM_POWER_OFF);
463 printk(KERN_EMERG "Power down.\n"); 459 printk(KERN_EMERG "Power down.\n");
464 machine_power_off(); 460 machine_power_off();
465} 461}
466EXPORT_SYMBOL_GPL(kernel_power_off); 462EXPORT_SYMBOL_GPL(kernel_power_off);
467
468/* 463/*
469 * Reboot system call: for obvious reasons only root may call it, 464 * Reboot system call: for obvious reasons only root may call it,
470 * and even root needs to set up some magic numbers in the registers 465 * and even root needs to set up some magic numbers in the registers