aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sys.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 18987c7f6add..d40e40a9446c 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -100,6 +100,13 @@ struct pid *cad_pid;
100EXPORT_SYMBOL(cad_pid); 100EXPORT_SYMBOL(cad_pid);
101 101
102/* 102/*
103 * If set, this is used for preparing the system to power off.
104 */
105
106void (*pm_power_off_prepare)(void);
107EXPORT_SYMBOL(pm_power_off_prepare);
108
109/*
103 * Notifier list for kernel code which wants to be called 110 * Notifier list for kernel code which wants to be called
104 * at shutdown. This is used to stop any idling DMA operations 111 * at shutdown. This is used to stop any idling DMA operations
105 * and the like. 112 * and the like.
@@ -867,6 +874,8 @@ EXPORT_SYMBOL_GPL(kernel_halt);
867void kernel_power_off(void) 874void kernel_power_off(void)
868{ 875{
869 kernel_shutdown_prepare(SYSTEM_POWER_OFF); 876 kernel_shutdown_prepare(SYSTEM_POWER_OFF);
877 if (pm_power_off_prepare)
878 pm_power_off_prepare();
870 printk(KERN_EMERG "Power down.\n"); 879 printk(KERN_EMERG "Power down.\n");
871 machine_power_off(); 880 machine_power_off();
872} 881}